Define __STDC_CONSTANT_MACROS in bn_test.cc. C99 decided that, like PRI* macros, UINT64_C and friends should be conditioned on __STDC_CONSTANT_MACROS in C++. C++11 then decided this was ridiculous and overruled this decision. However, Android's headers in older NDKs mistakenly followed the C99 rules for C++, so work around this. This fixes the android_arm bots. Change-Id: I3b49e8dfc20190ebfa78876909bd0dccd3e210ea Reviewed-on: https://boringssl-review.googlesource.com/11089 Reviewed-by: David Benjamin <davidben@google.com> Commit-Queue: David Benjamin <davidben@google.com> CQ-Verified: CQ bot account: commit-bot@chromium.org <commit-bot@chromium.org>
diff --git a/crypto/bn/bn_test.cc b/crypto/bn/bn_test.cc index 67a5a31..0a359bd 100644 --- a/crypto/bn/bn_test.cc +++ b/crypto/bn/bn_test.cc
@@ -67,7 +67,12 @@ * Sheueling Chang Shantz and Douglas Stebila of Sun Microsystems * Laboratories. */ -/* For BIGNUM format macros. */ +/* Per C99, various stdint.h and inttypes.h macros (the latter used by bn.h) are + * unavailable in C++ unless some macros are defined. C++11 overruled this + * decision, but older Android NDKs still require it. */ +#if !defined(__STDC_CONSTANT_MACROS) +#define __STDC_CONSTANT_MACROS +#endif #if !defined(__STDC_FORMAT_MACROS) #define __STDC_FORMAT_MACROS #endif