Rename COMPILE_ASSERT macro to RTC_COMPILE_ASSERT

This is needed to avoid name collision with some downstream projects.

BUG=b/37224347
TBR=henrika@webrtc.org
NOTRY=True

Review-Url: https://codereview.webrtc.org/2808343002
Cr-Commit-Position: refs/heads/master@{#17634}
This commit is contained in:
kjellander 2017-04-10 23:21:43 -07:00 committed by Commit bot
parent 0d4e068d0a
commit e0ab0ad85d
6 changed files with 9 additions and 9 deletions

View File

@ -46,7 +46,7 @@ static __inline int WebRtcSpl_CountLeadingZeros64_NotBuiltin(uint64_t n) {
// Returns the number of leading zero bits in the argument.
static __inline int WebRtcSpl_CountLeadingZeros32(uint32_t n) {
#ifdef __GNUC__
COMPILE_ASSERT(sizeof(unsigned int) == sizeof(uint32_t));
RTC_COMPILE_ASSERT(sizeof(unsigned int) == sizeof(uint32_t));
return n == 0 ? 32 : __builtin_clz(n);
#else
return WebRtcSpl_CountLeadingZeros32_NotBuiltin(n);
@ -56,7 +56,7 @@ static __inline int WebRtcSpl_CountLeadingZeros32(uint32_t n) {
// Returns the number of leading zero bits in the argument.
static __inline int WebRtcSpl_CountLeadingZeros64(uint64_t n) {
#ifdef __GNUC__
COMPILE_ASSERT(sizeof(unsigned long long) == sizeof(uint64_t)); // NOLINT
RTC_COMPILE_ASSERT(sizeof(unsigned long long) == sizeof(uint64_t)); // NOLINT
return n == 0 ? 64 : __builtin_clzll(n);
#else
return WebRtcSpl_CountLeadingZeros64_NotBuiltin(n);

View File

@ -64,7 +64,7 @@ void WebRtcIsacfix_PCorr2Q32(const int16_t* in, int32_t* logcorQ8) {
// Can't shift a Neon register to right with a non-constant shift value.
int32x4_t int_32x4_scale = vdupq_n_s32(-scaling);
// Assert a codition used in loop unrolling at compile-time.
COMPILE_ASSERT(PITCH_CORR_LEN2 %4 == 0);
RTC_COMPILE_ASSERT(PITCH_CORR_LEN2 %4 == 0);
for (n = 0; n < PITCH_CORR_LEN2; n += 4) {
int16x4_t int_16x4_x = vld1_s16(&x[n]);

View File

@ -33,7 +33,7 @@ void WebRtcIsacfix_PCorr2Q32(const int16_t* in, int32_t* logcorQ8) {
const int16_t* tmp_in = in;
int32_t tmp1, tmp2, tmp3, tmp4, tmp5, tmp6, tmp7, tmp8;
n = PITCH_CORR_LEN2;
COMPILE_ASSERT(PITCH_CORR_LEN2 % 4 == 0);
RTC_COMPILE_ASSERT(PITCH_CORR_LEN2 % 4 == 0);
__asm __volatile (
".set push \n\t"
".set noreorder \n\t"

View File

@ -59,8 +59,8 @@ void WebRtcIsacfix_PitchFilter(int16_t* indatQQ, // Q10 if type is 1 or 4,
const int16_t* fracoeffQQ = NULL;
// Assumptions in ARM assembly for WebRtcIsacfix_PitchFilterCoreARM().
COMPILE_ASSERT(PITCH_FRACORDER == 9);
COMPILE_ASSERT(PITCH_DAMPORDER == 5);
RTC_COMPILE_ASSERT(PITCH_FRACORDER == 9);
RTC_COMPILE_ASSERT(PITCH_DAMPORDER == 5);
// Set up buffer and states.
memcpy(ubufQQ, pfp->ubufQQ, sizeof(pfp->ubufQQ));

View File

@ -277,7 +277,7 @@ static void FilterFrame(const double* in_data, PitchFiltstr* filter_state,
/* Copy states to local variables. */
memcpy(filter_parameters.buffer, filter_state->ubuf,
sizeof(filter_state->ubuf));
COMPILE_ASSERT(sizeof(filter_parameters.buffer) >=
RTC_COMPILE_ASSERT(sizeof(filter_parameters.buffer) >=
sizeof(filter_state->ubuf));
memset(filter_parameters.buffer +
sizeof(filter_state->ubuf) / sizeof(filter_state->ubuf[0]),

View File

@ -14,8 +14,8 @@
// Use this macro to verify at compile time that certain restrictions are met.
// The argument is the boolean expression to evaluate.
// Example:
// COMPILE_ASSERT(sizeof(foo) < 128);
// RTC_COMPILE_ASSERT(sizeof(foo) < 128);
// Note: In C++, use static_assert instead!
#define COMPILE_ASSERT(expression) switch (0) {case 0: case expression:;}
#define RTC_COMPILE_ASSERT(expression) switch (0) {case 0: case expression:;}
#endif // WEBRTC_SYSTEM_WRAPPERS_INCLUDE_COMPILE_ASSERT_H_