gitattributes: do not rewrite patches containing crlf

This commit is contained in:
Leonid Pliushch 2020-05-23 15:43:47 +03:00
parent 7c3839bf5c
commit 3d82109504
6 changed files with 339 additions and 332 deletions

7
.gitattributes vendored
View File

@ -1,6 +1,13 @@
# Default.
* text eol=lf
# Patches.
*.diff text=auto
*.patch text=auto
*.patch32 text=auto
*.patch64 text=auto
*.patch.* text=auto
# Powershell scripts.
*.ps1 text eol=crlf

View File

@ -2,282 +2,282 @@ diff -uNr cryptopp/cpu.cpp cryptopp.mod/cpu.cpp
--- cryptopp/cpu.cpp 2019-04-28 23:36:50.000000000 +0000
+++ cryptopp.mod/cpu.cpp 2019-05-10 14:47:58.091890446 +0000
@@ -47,7 +47,7 @@
// "$ANDROID_NDK_ROOT/sources/android/cpufeatures".
// setenv-android.sh will copy the header and source file
// into PWD and the makefile will build it in place.
-#if defined(__ANDROID__)
+#if 0
# include "cpu-features.h"
#endif
// "$ANDROID_NDK_ROOT/sources/android/cpufeatures".
// setenv-android.sh will copy the header and source file
// into PWD and the makefile will build it in place.
-#if defined(__ANDROID__)
+#if 0
# include "cpu-features.h"
#endif
@@ -548,264 +548,64 @@
inline bool CPU_QueryARMv7()
{
-#if defined(__aarch32__) || defined(__aarch64__)
- // ARMv7 or above
+#if defined(__arm__) || defined(__aarch32__) || defined(__aarch64__)
return true;
-#elif defined(__ANDROID__) && defined(__arm__)
- if (((android_getCpuFamily() & ANDROID_CPU_FAMILY_ARM) != 0) &&
- ((android_getCpuFeatures() & ANDROID_CPU_ARM_FEATURE_ARMv7) != 0))
- return true;
-#elif defined(__linux__) && defined(__arm__)
- if ((getauxval(AT_HWCAP) & HWCAP_ARMv7) != 0)
- return true;
-#elif defined(__APPLE__) && defined(__arm__)
- // Apple hardware is ARMv7 or above.
- return true;
-#endif
+#else
return false;
+#endif
}
inline bool CPU_QueryNEON()
{
-#if defined(__ANDROID__) && defined(__aarch64__)
- if (((android_getCpuFamily() & ANDROID_CPU_FAMILY_ARM64) != 0) &&
- ((android_getCpuFeatures() & ANDROID_CPU_ARM64_FEATURE_ASIMD) != 0))
- return true;
-#elif defined(__ANDROID__) && defined(__arm__)
- if (((android_getCpuFamily() & ANDROID_CPU_FAMILY_ARM) != 0) &&
- ((android_getCpuFeatures() & ANDROID_CPU_ARM_FEATURE_NEON) != 0))
- return true;
-#elif defined(__linux__) && defined(__aarch64__)
- if ((getauxval(AT_HWCAP) & HWCAP_ASIMD) != 0)
- return true;
-#elif defined(__linux__) && defined(__aarch32__)
- if ((getauxval(AT_HWCAP2) & HWCAP2_ASIMD) != 0)
- return true;
-#elif defined(__linux__) && defined(__arm__)
- if ((getauxval(AT_HWCAP) & HWCAP_ARM_NEON) != 0)
- return true;
-#elif defined(__APPLE__) && defined(__aarch64__)
- // Core feature set for Aarch32 and Aarch64.
+#if defined(__arm__) || defined(__aarch32__) || defined(__aarch64__)
return true;
-#endif
+#else
return false;
+#endif
}
inline bool CPU_QueryCRC32()
{
-#if defined(__ANDROID__) && defined(__aarch64__)
- if (((android_getCpuFamily() & ANDROID_CPU_FAMILY_ARM64) != 0) &&
- ((android_getCpuFeatures() & ANDROID_CPU_ARM64_FEATURE_CRC32) != 0))
- return true;
-#elif defined(__ANDROID__) && defined(__aarch32__)
- if (((android_getCpuFamily() & ANDROID_CPU_FAMILY_ARM) != 0) &&
- ((android_getCpuFeatures() & ANDROID_CPU_ARM_FEATURE_CRC32) != 0))
- return true;
-#elif defined(__linux__) && defined(__aarch64__)
- if ((getauxval(AT_HWCAP) & HWCAP_CRC32) != 0)
- return true;
-#elif defined(__linux__) && defined(__aarch32__)
- if ((getauxval(AT_HWCAP2) & HWCAP2_CRC32) != 0)
- return true;
-#elif defined(__APPLE__) && defined(__aarch64__)
- // No compiler support. CRC intrinsics result in a failed compiled.
- return false;
-#endif
return false;
}
inline bool CPU_QueryPMULL()
{
-#if defined(__ANDROID__) && defined(__aarch64__)
- if (((android_getCpuFamily() & ANDROID_CPU_FAMILY_ARM64) != 0) &&
- ((android_getCpuFeatures() & ANDROID_CPU_ARM64_FEATURE_PMULL) != 0))
- return true;
-#elif defined(__ANDROID__) && defined(__aarch32__)
- if (((android_getCpuFamily() & ANDROID_CPU_FAMILY_ARM) != 0) &&
- ((android_getCpuFeatures() & ANDROID_CPU_ARM_FEATURE_PMULL) != 0))
- return true;
-#elif defined(__linux__) && defined(__aarch64__)
- if ((getauxval(AT_HWCAP) & HWCAP_PMULL) != 0)
- return true;
-#elif defined(__linux__) && defined(__aarch32__)
- if ((getauxval(AT_HWCAP2) & HWCAP2_PMULL) != 0)
- return true;
-#elif defined(__APPLE__) && defined(__aarch64__)
- // No compiler support. PMULL intrinsics result in a failed compiled.
- return false;
-#endif
return false;
}
inline bool CPU_QueryAES()
{
-#if defined(__ANDROID__) && defined(__aarch64__)
- if (((android_getCpuFamily() & ANDROID_CPU_FAMILY_ARM64) != 0) &&
- ((android_getCpuFeatures() & ANDROID_CPU_ARM64_FEATURE_AES) != 0))
- return true;
-#elif defined(__ANDROID__) && defined(__aarch32__)
- if (((android_getCpuFamily() & ANDROID_CPU_FAMILY_ARM) != 0) &&
- ((android_getCpuFeatures() & ANDROID_CPU_ARM_FEATURE_AES) != 0))
- return true;
-#elif defined(__linux__) && defined(__aarch64__)
- if ((getauxval(AT_HWCAP) & HWCAP_AES) != 0)
- return true;
-#elif defined(__linux__) && defined(__aarch32__)
- if ((getauxval(AT_HWCAP2) & HWCAP2_AES) != 0)
- return true;
-#elif defined(__APPLE__) && defined(__aarch64__)
- unsigned int device, version;
- GetAppleMachineInfo(device, version);
- return IsAppleMachineARMv8(device, version);
-#endif
return false;
}
inline bool CPU_QuerySHA1()
{
-#if defined(__ANDROID__) && defined(__aarch64__)
- if (((android_getCpuFamily() & ANDROID_CPU_FAMILY_ARM64) != 0) &&
- ((android_getCpuFeatures() & ANDROID_CPU_ARM64_FEATURE_SHA1) != 0))
- return true;
-#elif defined(__ANDROID__) && defined(__aarch32__)
- if (((android_getCpuFamily() & ANDROID_CPU_FAMILY_ARM) != 0) &&
- ((android_getCpuFeatures() & ANDROID_CPU_ARM_FEATURE_SHA1) != 0))
- return true;
-#elif defined(__linux__) && defined(__aarch64__)
- if ((getauxval(AT_HWCAP) & HWCAP_SHA1) != 0)
- return true;
-#elif defined(__linux__) && defined(__aarch32__)
- if ((getauxval(AT_HWCAP2) & HWCAP2_SHA1) != 0)
- return true;
-#elif defined(__APPLE__) && defined(__aarch64__)
- unsigned int device, version;
- GetAppleMachineInfo(device, version);
- return IsAppleMachineARMv8(device, version);
-#endif
return false;
}
inline bool CPU_QuerySHA2()
{
-#if defined(__ANDROID__) && defined(__aarch64__)
- if (((android_getCpuFamily() & ANDROID_CPU_FAMILY_ARM64) != 0) &&
- ((android_getCpuFeatures() & ANDROID_CPU_ARM64_FEATURE_SHA2) != 0))
- return true;
-#elif defined(__ANDROID__) && defined(__aarch32__)
- if (((android_getCpuFamily() & ANDROID_CPU_FAMILY_ARM) != 0) &&
- ((android_getCpuFeatures() & ANDROID_CPU_ARM_FEATURE_SHA2) != 0))
- return true;
-#elif defined(__linux__) && defined(__aarch64__)
- if ((getauxval(AT_HWCAP) & HWCAP_SHA2) != 0)
- return true;
-#elif defined(__linux__) && defined(__aarch32__)
- if ((getauxval(AT_HWCAP2) & HWCAP2_SHA2) != 0)
- return true;
-#elif defined(__APPLE__) && defined(__aarch64__)
- unsigned int device, version;
- GetAppleMachineInfo(device, version);
- return IsAppleMachineARMv8(device, version);
-#endif
return false;
}
inline bool CPU_QuerySHA512()
{
-// Some ARMv8.4 features are disabled at the moment
-#if defined(__ANDROID__) && defined(__aarch64__) && 0
- if (((android_getCpuFamily() & ANDROID_CPU_FAMILY_ARM64) != 0) &&
- ((android_getCpuFeatures() & ANDROID_CPU_ARM64_FEATURE_SHA512) != 0))
- return true;
-#elif defined(__ANDROID__) && defined(__aarch32__) && 0
- if (((android_getCpuFamily() & ANDROID_CPU_FAMILY_ARM) != 0) &&
- ((android_getCpuFeatures() & ANDROID_CPU_ARM_FEATURE_SHA512) != 0))
- return true;
-#elif defined(__linux__) && defined(__aarch64__)
- if ((getauxval(AT_HWCAP) & HWCAP_SHA512) != 0)
- return true;
-#elif defined(__linux__) && defined(__aarch32__)
- if ((getauxval(AT_HWCAP2) & HWCAP2_SHA512) != 0)
- return true;
-#elif defined(__APPLE__) && defined(__aarch64__) && 0
- unsigned int device, version;
- GetAppleMachineInfo(device, version);
- return IsAppleMachineARMv84(device, version);
-#endif
return false;
}
inline bool CPU_QuerySHA3()
{
-// Some ARMv8.4 features are disabled at the moment
-#if defined(__ANDROID__) && defined(__aarch64__) && 0
- if (((android_getCpuFamily() & ANDROID_CPU_FAMILY_ARM64) != 0) &&
- ((android_getCpuFeatures() & ANDROID_CPU_ARM64_FEATURE_SHA3) != 0))
- return true;
-#elif defined(__ANDROID__) && defined(__aarch32__) && 0
- if (((android_getCpuFamily() & ANDROID_CPU_FAMILY_ARM) != 0) &&
- ((android_getCpuFeatures() & ANDROID_CPU_ARM_FEATURE_SHA3) != 0))
- return true;
-#elif defined(__linux__) && defined(__aarch64__)
- if ((getauxval(AT_HWCAP) & HWCAP_SHA3) != 0)
- return true;
-#elif defined(__linux__) && defined(__aarch32__)
- if ((getauxval(AT_HWCAP2) & HWCAP2_SHA3) != 0)
- return true;
-#elif defined(__APPLE__) && defined(__aarch64__) && 0
- unsigned int device, version;
- GetAppleMachineInfo(device, version);
- return IsAppleMachineARMv84(device, version);
-#endif
return false;
}
inline bool CPU_QuerySM3()
{
-// Some ARMv8.4 features are disabled at the moment
-#if defined(__ANDROID__) && defined(__aarch64__) && 0
- if (((android_getCpuFamily() & ANDROID_CPU_FAMILY_ARM64) != 0) &&
- ((android_getCpuFeatures() & ANDROID_CPU_ARM64_FEATURE_SM3) != 0))
- return true;
-#elif defined(__ANDROID__) && defined(__aarch32__) && 0
- if (((android_getCpuFamily() & ANDROID_CPU_FAMILY_ARM) != 0) &&
- ((android_getCpuFeatures() & ANDROID_CPU_ARM_FEATURE_SM3) != 0))
- return true;
-#elif defined(__linux__) && defined(__aarch64__)
- if ((getauxval(AT_HWCAP) & HWCAP_SM3) != 0)
- return true;
-#elif defined(__linux__) && defined(__aarch32__)
- if ((getauxval(AT_HWCAP2) & HWCAP2_SM3) != 0)
- return true;
-#elif defined(__APPLE__) && defined(__aarch64__) && 0
- unsigned int device, version;
- GetAppleMachineInfo(device, version);
- return IsAppleMachineARMv84(device, version);
-#endif
return false;
}
inline bool CPU_QuerySM4()
{
-// Some ARMv8.4 features are disabled at the moment
-#if defined(__ANDROID__) && defined(__aarch64__) && 0
- if (((android_getCpuFamily() & ANDROID_CPU_FAMILY_ARM64) != 0) &&
- ((android_getCpuFeatures() & ANDROID_CPU_ARM64_FEATURE_SM4) != 0))
- return true;
-#elif defined(__ANDROID__) && defined(__aarch32__) && 0
- if (((android_getCpuFamily() & ANDROID_CPU_FAMILY_ARM) != 0) &&
- ((android_getCpuFeatures() & ANDROID_CPU_ARM_FEATURE_SM4) != 0))
- return true;
-#elif defined(__linux__) && defined(__aarch64__)
- if ((getauxval(AT_HWCAP) & HWCAP_SM4) != 0)
- return true;
-#elif defined(__linux__) && defined(__aarch32__)
- if ((getauxval(AT_HWCAP2) & HWCAP2_SM4) != 0)
- return true;
-#elif defined(__APPLE__) && defined(__aarch64__) && 0
- unsigned int device, version;
- GetAppleMachineInfo(device, version);
- return IsAppleMachineARMv84(device, version);
-#endif
return false;
}
inline bool CPU_QueryARMv7()
{
-#if defined(__aarch32__) || defined(__aarch64__)
- // ARMv7 or above
+#if defined(__arm__) || defined(__aarch32__) || defined(__aarch64__)
return true;
-#elif defined(__ANDROID__) && defined(__arm__)
- if (((android_getCpuFamily() & ANDROID_CPU_FAMILY_ARM) != 0) &&
- ((android_getCpuFeatures() & ANDROID_CPU_ARM_FEATURE_ARMv7) != 0))
- return true;
-#elif defined(__linux__) && defined(__arm__)
- if ((getauxval(AT_HWCAP) & HWCAP_ARMv7) != 0)
- return true;
-#elif defined(__APPLE__) && defined(__arm__)
- // Apple hardware is ARMv7 or above.
- return true;
-#endif
+#else
return false;
+#endif
}
inline bool CPU_QueryNEON()
{
-#if defined(__ANDROID__) && defined(__aarch64__)
- if (((android_getCpuFamily() & ANDROID_CPU_FAMILY_ARM64) != 0) &&
- ((android_getCpuFeatures() & ANDROID_CPU_ARM64_FEATURE_ASIMD) != 0))
- return true;
-#elif defined(__ANDROID__) && defined(__arm__)
- if (((android_getCpuFamily() & ANDROID_CPU_FAMILY_ARM) != 0) &&
- ((android_getCpuFeatures() & ANDROID_CPU_ARM_FEATURE_NEON) != 0))
- return true;
-#elif defined(__linux__) && defined(__aarch64__)
- if ((getauxval(AT_HWCAP) & HWCAP_ASIMD) != 0)
- return true;
-#elif defined(__linux__) && defined(__aarch32__)
- if ((getauxval(AT_HWCAP2) & HWCAP2_ASIMD) != 0)
- return true;
-#elif defined(__linux__) && defined(__arm__)
- if ((getauxval(AT_HWCAP) & HWCAP_ARM_NEON) != 0)
- return true;
-#elif defined(__APPLE__) && defined(__aarch64__)
- // Core feature set for Aarch32 and Aarch64.
+#if defined(__arm__) || defined(__aarch32__) || defined(__aarch64__)
return true;
-#endif
+#else
return false;
+#endif
}
inline bool CPU_QueryCRC32()
{
-#if defined(__ANDROID__) && defined(__aarch64__)
- if (((android_getCpuFamily() & ANDROID_CPU_FAMILY_ARM64) != 0) &&
- ((android_getCpuFeatures() & ANDROID_CPU_ARM64_FEATURE_CRC32) != 0))
- return true;
-#elif defined(__ANDROID__) && defined(__aarch32__)
- if (((android_getCpuFamily() & ANDROID_CPU_FAMILY_ARM) != 0) &&
- ((android_getCpuFeatures() & ANDROID_CPU_ARM_FEATURE_CRC32) != 0))
- return true;
-#elif defined(__linux__) && defined(__aarch64__)
- if ((getauxval(AT_HWCAP) & HWCAP_CRC32) != 0)
- return true;
-#elif defined(__linux__) && defined(__aarch32__)
- if ((getauxval(AT_HWCAP2) & HWCAP2_CRC32) != 0)
- return true;
-#elif defined(__APPLE__) && defined(__aarch64__)
- // No compiler support. CRC intrinsics result in a failed compiled.
- return false;
-#endif
return false;
}
inline bool CPU_QueryPMULL()
{
-#if defined(__ANDROID__) && defined(__aarch64__)
- if (((android_getCpuFamily() & ANDROID_CPU_FAMILY_ARM64) != 0) &&
- ((android_getCpuFeatures() & ANDROID_CPU_ARM64_FEATURE_PMULL) != 0))
- return true;
-#elif defined(__ANDROID__) && defined(__aarch32__)
- if (((android_getCpuFamily() & ANDROID_CPU_FAMILY_ARM) != 0) &&
- ((android_getCpuFeatures() & ANDROID_CPU_ARM_FEATURE_PMULL) != 0))
- return true;
-#elif defined(__linux__) && defined(__aarch64__)
- if ((getauxval(AT_HWCAP) & HWCAP_PMULL) != 0)
- return true;
-#elif defined(__linux__) && defined(__aarch32__)
- if ((getauxval(AT_HWCAP2) & HWCAP2_PMULL) != 0)
- return true;
-#elif defined(__APPLE__) && defined(__aarch64__)
- // No compiler support. PMULL intrinsics result in a failed compiled.
- return false;
-#endif
return false;
}
inline bool CPU_QueryAES()
{
-#if defined(__ANDROID__) && defined(__aarch64__)
- if (((android_getCpuFamily() & ANDROID_CPU_FAMILY_ARM64) != 0) &&
- ((android_getCpuFeatures() & ANDROID_CPU_ARM64_FEATURE_AES) != 0))
- return true;
-#elif defined(__ANDROID__) && defined(__aarch32__)
- if (((android_getCpuFamily() & ANDROID_CPU_FAMILY_ARM) != 0) &&
- ((android_getCpuFeatures() & ANDROID_CPU_ARM_FEATURE_AES) != 0))
- return true;
-#elif defined(__linux__) && defined(__aarch64__)
- if ((getauxval(AT_HWCAP) & HWCAP_AES) != 0)
- return true;
-#elif defined(__linux__) && defined(__aarch32__)
- if ((getauxval(AT_HWCAP2) & HWCAP2_AES) != 0)
- return true;
-#elif defined(__APPLE__) && defined(__aarch64__)
- unsigned int device, version;
- GetAppleMachineInfo(device, version);
- return IsAppleMachineARMv8(device, version);
-#endif
return false;
}
inline bool CPU_QuerySHA1()
{
-#if defined(__ANDROID__) && defined(__aarch64__)
- if (((android_getCpuFamily() & ANDROID_CPU_FAMILY_ARM64) != 0) &&
- ((android_getCpuFeatures() & ANDROID_CPU_ARM64_FEATURE_SHA1) != 0))
- return true;
-#elif defined(__ANDROID__) && defined(__aarch32__)
- if (((android_getCpuFamily() & ANDROID_CPU_FAMILY_ARM) != 0) &&
- ((android_getCpuFeatures() & ANDROID_CPU_ARM_FEATURE_SHA1) != 0))
- return true;
-#elif defined(__linux__) && defined(__aarch64__)
- if ((getauxval(AT_HWCAP) & HWCAP_SHA1) != 0)
- return true;
-#elif defined(__linux__) && defined(__aarch32__)
- if ((getauxval(AT_HWCAP2) & HWCAP2_SHA1) != 0)
- return true;
-#elif defined(__APPLE__) && defined(__aarch64__)
- unsigned int device, version;
- GetAppleMachineInfo(device, version);
- return IsAppleMachineARMv8(device, version);
-#endif
return false;
}
inline bool CPU_QuerySHA2()
{
-#if defined(__ANDROID__) && defined(__aarch64__)
- if (((android_getCpuFamily() & ANDROID_CPU_FAMILY_ARM64) != 0) &&
- ((android_getCpuFeatures() & ANDROID_CPU_ARM64_FEATURE_SHA2) != 0))
- return true;
-#elif defined(__ANDROID__) && defined(__aarch32__)
- if (((android_getCpuFamily() & ANDROID_CPU_FAMILY_ARM) != 0) &&
- ((android_getCpuFeatures() & ANDROID_CPU_ARM_FEATURE_SHA2) != 0))
- return true;
-#elif defined(__linux__) && defined(__aarch64__)
- if ((getauxval(AT_HWCAP) & HWCAP_SHA2) != 0)
- return true;
-#elif defined(__linux__) && defined(__aarch32__)
- if ((getauxval(AT_HWCAP2) & HWCAP2_SHA2) != 0)
- return true;
-#elif defined(__APPLE__) && defined(__aarch64__)
- unsigned int device, version;
- GetAppleMachineInfo(device, version);
- return IsAppleMachineARMv8(device, version);
-#endif
return false;
}
inline bool CPU_QuerySHA512()
{
-// Some ARMv8.4 features are disabled at the moment
-#if defined(__ANDROID__) && defined(__aarch64__) && 0
- if (((android_getCpuFamily() & ANDROID_CPU_FAMILY_ARM64) != 0) &&
- ((android_getCpuFeatures() & ANDROID_CPU_ARM64_FEATURE_SHA512) != 0))
- return true;
-#elif defined(__ANDROID__) && defined(__aarch32__) && 0
- if (((android_getCpuFamily() & ANDROID_CPU_FAMILY_ARM) != 0) &&
- ((android_getCpuFeatures() & ANDROID_CPU_ARM_FEATURE_SHA512) != 0))
- return true;
-#elif defined(__linux__) && defined(__aarch64__)
- if ((getauxval(AT_HWCAP) & HWCAP_SHA512) != 0)
- return true;
-#elif defined(__linux__) && defined(__aarch32__)
- if ((getauxval(AT_HWCAP2) & HWCAP2_SHA512) != 0)
- return true;
-#elif defined(__APPLE__) && defined(__aarch64__) && 0
- unsigned int device, version;
- GetAppleMachineInfo(device, version);
- return IsAppleMachineARMv84(device, version);
-#endif
return false;
}
inline bool CPU_QuerySHA3()
{
-// Some ARMv8.4 features are disabled at the moment
-#if defined(__ANDROID__) && defined(__aarch64__) && 0
- if (((android_getCpuFamily() & ANDROID_CPU_FAMILY_ARM64) != 0) &&
- ((android_getCpuFeatures() & ANDROID_CPU_ARM64_FEATURE_SHA3) != 0))
- return true;
-#elif defined(__ANDROID__) && defined(__aarch32__) && 0
- if (((android_getCpuFamily() & ANDROID_CPU_FAMILY_ARM) != 0) &&
- ((android_getCpuFeatures() & ANDROID_CPU_ARM_FEATURE_SHA3) != 0))
- return true;
-#elif defined(__linux__) && defined(__aarch64__)
- if ((getauxval(AT_HWCAP) & HWCAP_SHA3) != 0)
- return true;
-#elif defined(__linux__) && defined(__aarch32__)
- if ((getauxval(AT_HWCAP2) & HWCAP2_SHA3) != 0)
- return true;
-#elif defined(__APPLE__) && defined(__aarch64__) && 0
- unsigned int device, version;
- GetAppleMachineInfo(device, version);
- return IsAppleMachineARMv84(device, version);
-#endif
return false;
}
inline bool CPU_QuerySM3()
{
-// Some ARMv8.4 features are disabled at the moment
-#if defined(__ANDROID__) && defined(__aarch64__) && 0
- if (((android_getCpuFamily() & ANDROID_CPU_FAMILY_ARM64) != 0) &&
- ((android_getCpuFeatures() & ANDROID_CPU_ARM64_FEATURE_SM3) != 0))
- return true;
-#elif defined(__ANDROID__) && defined(__aarch32__) && 0
- if (((android_getCpuFamily() & ANDROID_CPU_FAMILY_ARM) != 0) &&
- ((android_getCpuFeatures() & ANDROID_CPU_ARM_FEATURE_SM3) != 0))
- return true;
-#elif defined(__linux__) && defined(__aarch64__)
- if ((getauxval(AT_HWCAP) & HWCAP_SM3) != 0)
- return true;
-#elif defined(__linux__) && defined(__aarch32__)
- if ((getauxval(AT_HWCAP2) & HWCAP2_SM3) != 0)
- return true;
-#elif defined(__APPLE__) && defined(__aarch64__) && 0
- unsigned int device, version;
- GetAppleMachineInfo(device, version);
- return IsAppleMachineARMv84(device, version);
-#endif
return false;
}
inline bool CPU_QuerySM4()
{
-// Some ARMv8.4 features are disabled at the moment
-#if defined(__ANDROID__) && defined(__aarch64__) && 0
- if (((android_getCpuFamily() & ANDROID_CPU_FAMILY_ARM64) != 0) &&
- ((android_getCpuFeatures() & ANDROID_CPU_ARM64_FEATURE_SM4) != 0))
- return true;
-#elif defined(__ANDROID__) && defined(__aarch32__) && 0
- if (((android_getCpuFamily() & ANDROID_CPU_FAMILY_ARM) != 0) &&
- ((android_getCpuFeatures() & ANDROID_CPU_ARM_FEATURE_SM4) != 0))
- return true;
-#elif defined(__linux__) && defined(__aarch64__)
- if ((getauxval(AT_HWCAP) & HWCAP_SM4) != 0)
- return true;
-#elif defined(__linux__) && defined(__aarch32__)
- if ((getauxval(AT_HWCAP2) & HWCAP2_SM4) != 0)
- return true;
-#elif defined(__APPLE__) && defined(__aarch64__) && 0
- unsigned int device, version;
- GetAppleMachineInfo(device, version);
- return IsAppleMachineARMv84(device, version);
-#endif
return false;
}

View File

@ -1,11 +1,11 @@
--- ../exiv2json.cpp.orig 2019-05-31 21:32:41.319959442 +0200
+++ ./samples/exiv2json.cpp 2019-05-31 21:33:11.399959231 +0200
@@ -236,7 +236,7 @@
{
Jzon::Object& fs = (Jzon::Object&) nfs;
fs.Add("path",path);
- char resolved_path[2000]; // PATH_MAX];
+ char resolved_path[PATH_MAX];
fs.Add("realpath",realpath(path,resolved_path));
struct stat buf;
{
Jzon::Object& fs = (Jzon::Object&) nfs;
fs.Add("path",path);
- char resolved_path[2000]; // PATH_MAX];
+ char resolved_path[PATH_MAX];
fs.Add("realpath",realpath(path,resolved_path));
struct stat buf;

View File

@ -12,21 +12,21 @@ index 13d1802..0605405 100644
--- a/k2pdfoptlib/k2pdfopt.h
+++ b/k2pdfoptlib/k2pdfopt.h
@@ -259,7 +259,6 @@ typedef struct
int text_only; /* Do not send figures to output file */
/* OCR */
-#ifdef HAVE_OCR_LIB
char ocrout[128];
int dst_ocr;
int ocr_detection_type; /* New in v2.50, 'w', 'l', or 'p' */
int text_only; /* Do not send figures to output file */
/* OCR */
-#ifdef HAVE_OCR_LIB
char ocrout[128];
int dst_ocr;
int ocr_detection_type; /* New in v2.50, 'w', 'l', or 'p' */
@@ -284,7 +283,6 @@ typedef struct
double ocr_max_height_inches;
OCRWORDS dst_ocrwords;
int sort_ocr_text;
-#endif
int dst_userdpi; /* Specified device DPI, not including magnification */
int dst_dpi; /* Device virtual DPI--takes magnification/fontsize into account */
double ocr_max_height_inches;
OCRWORDS dst_ocrwords;
int sort_ocr_text;
-#endif
int dst_userdpi; /* Specified device DPI, not including magnification */
int dst_dpi; /* Device virtual DPI--takes magnification/fontsize into account */
--
2.20.1

View File

@ -2,32 +2,32 @@ diff -uNr k2pdfopt_v2.51/k2pdfoptlib/k2sys.c k2pdfopt_v2.51.mod/k2pdfoptlib/k2sy
--- k2pdfopt_v2.51/k2pdfoptlib/k2sys.c 2019-01-04 20:41:52.000000000 +0200
+++ k2pdfopt_v2.51.mod/k2pdfoptlib/k2sys.c 2020-01-01 22:20:34.606541436 +0200
@@ -21,7 +21,7 @@
#include "k2pdfopt.h"
#include <stdarg.h>
-#ifdef __ANDROID__
+#if defined(__ANDROID__) && !defined(__TERMUX__)
#include <android/log.h>
#endif
#include "k2pdfopt.h"
#include <stdarg.h>
-#ifdef __ANDROID__
+#if defined(__ANDROID__) && !defined(__TERMUX__)
#include <android/log.h>
#endif
@@ -179,7 +179,7 @@
}
else
#endif
-#ifdef __ANDROID__
+#if defined(__ANDROID__) && !defined(__TERMUX__)
{
char buf[1024];
status=vsnprintf(buf,sizeof(buf),fmt,args);
}
else
#endif
-#ifdef __ANDROID__
+#if defined(__ANDROID__) && !defined(__TERMUX__)
{
char buf[1024];
status=vsnprintf(buf,sizeof(buf),fmt,args);
diff -uNr k2pdfopt_v2.51/k2pdfoptlib/wrapbmp.c k2pdfopt_v2.51.mod/k2pdfoptlib/wrapbmp.c
--- k2pdfopt_v2.51/k2pdfoptlib/wrapbmp.c 2019-01-04 20:41:40.000000000 +0200
+++ k2pdfopt_v2.51.mod/k2pdfoptlib/wrapbmp.c 2020-01-01 22:16:03.613556631 +0200
@@ -480,7 +480,7 @@
** but when I ask for back coordinates (original coordinates on source image)
** I got wrong results. It happens because 'wrmap' malformed during parsing.
*/
-#if (defined(__ANDROID__) && defined(K2PDFOPT_KINDLEPDFVIEWER))
+#if (defined(__ANDROID__) && defined(K2PDFOPT_KINDLEPDFVIEWER) && !defined(__TERMUX__))
{
int dstmar_pixels[4];
int i,w;
** but when I ask for back coordinates (original coordinates on source image)
** I got wrong results. It happens because 'wrmap' malformed during parsing.
*/
-#if (defined(__ANDROID__) && defined(K2PDFOPT_KINDLEPDFVIEWER))
+#if (defined(__ANDROID__) && defined(K2PDFOPT_KINDLEPDFVIEWER) && !defined(__TERMUX__))
{
int dstmar_pixels[4];
int i,w;

View File

@ -1,11 +1,11 @@
--- old/Project/GNU/Library/libmediainfo.pc.in 2019-09-10 21:27:35.000000000 +0200
+++ Project/GNU/Library/libmediainfo.pc.in 2019-12-05 13:05:47.469137700 +0100
@@ -3,7 +3,7 @@
libdir=@libdir@
includedir=@includedir@
Unicode=@MediaInfoLib_Unicode@
-Libs_Static=${libdir}/lib@MediaInfoLib_LibName@.a ${libdir}/libzen.a -lpthread -lz@Curl_Lib@
+Libs_Static=${libdir}/lib@MediaInfoLib_LibName@.a ${libdir}/libzen.a -lz@Curl_Lib@
la_name=lib@MediaInfoLib_LibName@.la
Name: libmediainfo
libdir=@libdir@
includedir=@includedir@
Unicode=@MediaInfoLib_Unicode@
-Libs_Static=${libdir}/lib@MediaInfoLib_LibName@.a ${libdir}/libzen.a -lpthread -lz@Curl_Lib@
+Libs_Static=${libdir}/lib@MediaInfoLib_LibName@.a ${libdir}/libzen.a -lz@Curl_Lib@
la_name=lib@MediaInfoLib_LibName@.la
Name: libmediainfo