Fix PowerMac compile on G4's and G5's

pull/755/head
Jeffrey Walton 2018-11-27 21:17:47 -05:00
parent 5685b0fdc4
commit 09bda53fc0
No known key found for this signature in database
GPG Key ID: B36AB348921B1838
1 changed files with 14 additions and 2 deletions

View File

@ -16,8 +16,10 @@
// Inline assembler available in GCC 3.2 or above. For practical // Inline assembler available in GCC 3.2 or above. For practical
// purposes we check for GCC 4.0 or above. GCC imposters claim // purposes we check for GCC 4.0 or above. GCC imposters claim
// to be GCC 4.2.1 so it will capture them, too. // to be GCC 4.2.1 so it will capture them, too. We exclude the
#if (__GNUC__ >= 4) || defined(__IBM_GCC_ASM) // Apple machines because they are not Power9 and use a slightly
// different syntax in their assembler.
#if ((__GNUC__ >= 4) || defined(__IBM_GCC_ASM)) && !defined(__APPLE__)
# define GCC_DARN_ASM_AVAILABLE 1 # define GCC_DARN_ASM_AVAILABLE 1
#endif #endif
@ -60,7 +62,12 @@ inline void DARN32(void* output)
// This is probably going to break some platforms. // This is probably going to break some platforms.
// We will deal with them as we encounter them. // We will deal with them as we encounter them.
*ptr = __builtin_darn_32(); *ptr = __builtin_darn_32();
#elif defined(__APPLE__)
// Nop. Apple G4 and G5 machines are too old. They will
// avoid this code path because HasPower9() returns false.
CRYPTOPP_ASSERT(0);
#else #else
// Catch other compile breaks
int XXX[-1]; int XXX[-1];
#endif #endif
} }
@ -97,7 +104,12 @@ inline void DARN64(void* output)
// This is probably going to break some platforms. // This is probably going to break some platforms.
// We will deal with them as we encounter them. // We will deal with them as we encounter them.
*ptr = __builtin_darn(); *ptr = __builtin_darn();
#elif defined(__APPLE__)
// Nop. Apple G4 and G5 machines are too old. They will
// avoid this code path because HasPower9() returns false.
CRYPTOPP_ASSERT(0);
#else #else
// Catch other compile breaks
int XXX[-1]; int XXX[-1];
#endif #endif
} }