Guard CPU_ProbeARMv7 with CRYPTOPP_BOOL_ARM32 (GH #844)

We make these queries available on all platforms so folks don't need to guard code.
pull/853/head
Jeffrey Walton 2019-05-20 23:30:12 -04:00
parent cc011d2e44
commit c456d6aa69
No known key found for this signature in database
GPG Key ID: B36AB348921B1838
1 changed files with 6 additions and 3 deletions

View File

@ -51,7 +51,8 @@ bool CPU_ProbeARMv7()
{ {
#if defined(CRYPTOPP_NO_CPU_FEATURE_PROBES) #if defined(CRYPTOPP_NO_CPU_FEATURE_PROBES)
return false; return false;
#elif defined(CRYPTOPP_MS_STYLE_INLINE_ASSEMBLY) #elif CRYPTOPP_BOOL_ARM32
# if defined(CRYPTOPP_MS_STYLE_INLINE_ASSEMBLY)
volatile bool result = true; volatile bool result = true;
__try __try
{ {
@ -63,7 +64,7 @@ bool CPU_ProbeARMv7()
return false; return false;
} }
return result; return result;
#elif defined(__GNUC__) || defined(__clang__) # elif defined(__GNUC__) || defined(__clang__)
// longjmp and clobber warnings. Volatile is required. // longjmp and clobber warnings. Volatile is required.
// http://github.com/weidai11/cryptopp/issues/24 and http://stackoverflow.com/q/7721854 // http://github.com/weidai11/cryptopp/issues/24 and http://stackoverflow.com/q/7721854
volatile bool result = true; volatile bool result = true;
@ -113,7 +114,9 @@ bool CPU_ProbeARMv7()
sigprocmask(SIG_SETMASK, (sigset_t*)&oldMask, NULLPTR); sigprocmask(SIG_SETMASK, (sigset_t*)&oldMask, NULLPTR);
signal(SIGILL, oldHandler); signal(SIGILL, oldHandler);
return result; return result;
#else # else
return false;
# endif
return false; return false;
#endif // CRYPTOPP_ARM_NEON_AVAILABLE #endif // CRYPTOPP_ARM_NEON_AVAILABLE
} }