From 3df38b442f6ba29722049b4c4d7121053003a1f8 Mon Sep 17 00:00:00 2001 From: "kwiberg@webrtc.org" Date: Tue, 13 Jan 2015 11:37:48 +0000 Subject: [PATCH] Unify the two copies of compile_assert.h This patch basically deletes webrtc/base/compile_assert.h (which is the more outdated copy) and moves webrtc/system_wrappers/source/compile_assert.h to take its place. R=aluebs@webrtc.org, andrew@webrtc.org, tommi@webrtc.org Review URL: https://webrtc-codereview.appspot.com/36719004 git-svn-id: http://webrtc.googlecode.com/svn/trunk@8048 4adac7df-926f-26a2-2b94-8c16560cd09d --- .../app/webrtc/java/jni/peerconnection_jni.cc | 2 +- webrtc/base/BUILD.gn | 1 + webrtc/base/base.gyp | 1 + webrtc/base/compile_assert.h | 17 ++-- .../common_audio/resampler/sinc_resampler.cc | 2 +- webrtc/common_audio/wav_header_unittest.cc | 2 +- .../main/acm2/audio_coding_module_unittest.cc | 2 +- .../audio_coding_module_unittest_oldapi.cc | 2 +- .../neteq/neteq_external_decoder_unittest.cc | 2 +- .../audio_coding/neteq/tools/audio_checksum.h | 2 +- webrtc/modules/audio_processing/agc/agc.cc | 2 +- .../audio_processing/agc/agc_audio_proc.cc | 2 +- .../agc/agc_audio_proc_internal.h | 2 +- .../agc/agc_manager_direct.cc | 2 +- .../modules/audio_processing/agc/histogram.cc | 2 +- .../audio_processing/agc/pitch_based_vad.cc | 2 +- .../agc/pole_zero_filter_unittest.cc | 2 +- .../audio_processing/audio_processing_impl.cc | 2 +- webrtc/modules/desktop_capture/win/cursor.cc | 2 +- .../media_file/source/media_file_unittest.cc | 2 +- .../source/rtp_format_vp8_unittest.cc | 2 +- webrtc/system_wrappers/BUILD.gn | 1 - .../interface/compile_assert.h | 90 ------------------- webrtc/system_wrappers/interface/scoped_ptr.h | 2 +- webrtc/system_wrappers/source/atomic32_win.cc | 2 +- .../source/system_wrappers.gyp | 1 - 26 files changed, 34 insertions(+), 117 deletions(-) delete mode 100644 webrtc/system_wrappers/interface/compile_assert.h diff --git a/talk/app/webrtc/java/jni/peerconnection_jni.cc b/talk/app/webrtc/java/jni/peerconnection_jni.cc index 28bd7b8d6..4a06364d8 100644 --- a/talk/app/webrtc/java/jni/peerconnection_jni.cc +++ b/talk/app/webrtc/java/jni/peerconnection_jni.cc @@ -78,12 +78,12 @@ #include "third_party/libyuv/include/libyuv/video_common.h" #include "webrtc/base/bind.h" #include "webrtc/base/checks.h" +#include "webrtc/base/compile_assert.h" #include "webrtc/base/logging.h" #include "webrtc/base/messagequeue.h" #include "webrtc/base/ssladapter.h" #include "webrtc/common_video/interface/texture_video_frame.h" #include "webrtc/modules/video_coding/codecs/interface/video_codec_interface.h" -#include "webrtc/system_wrappers/interface/compile_assert.h" #include "webrtc/system_wrappers/interface/trace.h" #include "webrtc/video_engine/include/vie_base.h" #include "webrtc/voice_engine/include/voe_base.h" diff --git a/webrtc/base/BUILD.gn b/webrtc/base/BUILD.gn index 4be96c2df..c254571f5 100644 --- a/webrtc/base/BUILD.gn +++ b/webrtc/base/BUILD.gn @@ -106,6 +106,7 @@ static_library("rtc_base_approved") { sources = [ "checks.cc", "checks.h", + "compile_assert.h", "exp_filter.cc", "exp_filter.h", "md5.cc", diff --git a/webrtc/base/base.gyp b/webrtc/base/base.gyp index 645c1dcf4..3444ce2f2 100644 --- a/webrtc/base/base.gyp +++ b/webrtc/base/base.gyp @@ -41,6 +41,7 @@ 'sources': [ 'checks.cc', 'checks.h', + 'compile_assert.h', 'exp_filter.cc', 'exp_filter.h', 'md5.cc', diff --git a/webrtc/base/compile_assert.h b/webrtc/base/compile_assert.h index ad9e179d6..47d40a9bd 100644 --- a/webrtc/base/compile_assert.h +++ b/webrtc/base/compile_assert.h @@ -8,16 +8,16 @@ * be found in the AUTHORS file in the root of the source tree. */ -// COMPILE_ASSERT macro, borrowed from google3/base/macros.h. +// Borrowed from Chromium's src/base/macros.h. + #ifndef WEBRTC_BASE_COMPILE_ASSERT_H_ #define WEBRTC_BASE_COMPILE_ASSERT_H_ -#include "webrtc/typedefs.h" // The COMPILE_ASSERT macro can be used to verify that a compile time // expression is true. For example, you could use it to verify the // size of a static array: // -// COMPILE_ASSERT(ARRAYSIZE(content_type_names) == CONTENT_NUM_TYPES, +// COMPILE_ASSERT(ARRAYSIZE_UNSAFE(content_type_names) == CONTENT_NUM_TYPES, // content_type_names_incorrect_size); // // or to make sure a struct is smaller than a certain size: @@ -31,13 +31,20 @@ // TODO(ajm): Hack to avoid multiple definitions until the base/ of webrtc and // libjingle are merged. #if !defined(COMPILE_ASSERT) +#if __cplusplus >= 201103L +// Under C++11, just use static_assert. +#define COMPILE_ASSERT(expr, msg) static_assert(expr, #msg) + +#else template struct CompileAssert { }; #define COMPILE_ASSERT(expr, msg) \ - typedef CompileAssert<(bool(expr))> msg[bool(expr) ? 1 : -1] ATTRIBUTE_UNUSED -#endif // COMPILE_ASSERT + typedef CompileAssert<(bool(expr))> msg[bool(expr) ? 1 : -1] + +#endif // __cplusplus >= 201103L +#endif // !defined(COMPILE_ASSERT) // Implementation details of COMPILE_ASSERT: // diff --git a/webrtc/common_audio/resampler/sinc_resampler.cc b/webrtc/common_audio/resampler/sinc_resampler.cc index 165cb356c..352c84cc1 100644 --- a/webrtc/common_audio/resampler/sinc_resampler.cc +++ b/webrtc/common_audio/resampler/sinc_resampler.cc @@ -85,8 +85,8 @@ // MSVC++ requires this to be set before any other includes to get M_PI. #define _USE_MATH_DEFINES +#include "webrtc/base/compile_assert.h" #include "webrtc/common_audio/resampler/sinc_resampler.h" -#include "webrtc/system_wrappers/interface/compile_assert.h" #include "webrtc/system_wrappers/interface/cpu_features_wrapper.h" #include "webrtc/typedefs.h" diff --git a/webrtc/common_audio/wav_header_unittest.cc b/webrtc/common_audio/wav_header_unittest.cc index 63ede8383..546cc1e44 100644 --- a/webrtc/common_audio/wav_header_unittest.cc +++ b/webrtc/common_audio/wav_header_unittest.cc @@ -11,8 +11,8 @@ #include #include "testing/gtest/include/gtest/gtest.h" +#include "webrtc/base/compile_assert.h" #include "webrtc/common_audio/wav_header.h" -#include "webrtc/system_wrappers/interface/compile_assert.h" namespace webrtc { diff --git a/webrtc/modules/audio_coding/main/acm2/audio_coding_module_unittest.cc b/webrtc/modules/audio_coding/main/acm2/audio_coding_module_unittest.cc index b64c74da1..7e3494b17 100644 --- a/webrtc/modules/audio_coding/main/acm2/audio_coding_module_unittest.cc +++ b/webrtc/modules/audio_coding/main/acm2/audio_coding_module_unittest.cc @@ -13,6 +13,7 @@ #include "testing/gtest/include/gtest/gtest.h" #include "webrtc/base/checks.h" +#include "webrtc/base/compile_assert.h" #include "webrtc/base/md5digest.h" #include "webrtc/base/thread_annotations.h" #include "webrtc/modules/audio_coding/main/acm2/acm_receive_test.h" @@ -27,7 +28,6 @@ #include "webrtc/modules/audio_coding/neteq/tools/rtp_file_source.h" #include "webrtc/modules/interface/module_common_types.h" #include "webrtc/system_wrappers/interface/clock.h" -#include "webrtc/system_wrappers/interface/compile_assert.h" #include "webrtc/system_wrappers/interface/critical_section_wrapper.h" #include "webrtc/system_wrappers/interface/event_wrapper.h" #include "webrtc/system_wrappers/interface/scoped_ptr.h" diff --git a/webrtc/modules/audio_coding/main/acm2/audio_coding_module_unittest_oldapi.cc b/webrtc/modules/audio_coding/main/acm2/audio_coding_module_unittest_oldapi.cc index e887317c3..b8f12af06 100644 --- a/webrtc/modules/audio_coding/main/acm2/audio_coding_module_unittest_oldapi.cc +++ b/webrtc/modules/audio_coding/main/acm2/audio_coding_module_unittest_oldapi.cc @@ -12,6 +12,7 @@ #include #include "testing/gtest/include/gtest/gtest.h" +#include "webrtc/base/compile_assert.h" #include "webrtc/base/md5digest.h" #include "webrtc/base/thread_annotations.h" #include "webrtc/modules/audio_coding/main/acm2/acm_receive_test_oldapi.h" @@ -27,7 +28,6 @@ #include "webrtc/modules/audio_coding/neteq/tools/rtp_file_source.h" #include "webrtc/modules/interface/module_common_types.h" #include "webrtc/system_wrappers/interface/clock.h" -#include "webrtc/system_wrappers/interface/compile_assert.h" #include "webrtc/system_wrappers/interface/critical_section_wrapper.h" #include "webrtc/system_wrappers/interface/event_wrapper.h" #include "webrtc/system_wrappers/interface/scoped_ptr.h" diff --git a/webrtc/modules/audio_coding/neteq/neteq_external_decoder_unittest.cc b/webrtc/modules/audio_coding/neteq/neteq_external_decoder_unittest.cc index ae2d1aeb2..5ed528d09 100644 --- a/webrtc/modules/audio_coding/neteq/neteq_external_decoder_unittest.cc +++ b/webrtc/modules/audio_coding/neteq/neteq_external_decoder_unittest.cc @@ -15,11 +15,11 @@ #include "testing/gmock/include/gmock/gmock.h" #include "testing/gtest/include/gtest/gtest.h" +#include "webrtc/base/compile_assert.h" #include "webrtc/modules/audio_coding/neteq/interface/neteq.h" #include "webrtc/modules/audio_coding/neteq/mock/mock_external_decoder_pcm16b.h" #include "webrtc/modules/audio_coding/neteq/tools/input_audio_file.h" #include "webrtc/modules/audio_coding/neteq/tools/rtp_generator.h" -#include "webrtc/system_wrappers/interface/compile_assert.h" #include "webrtc/system_wrappers/interface/scoped_ptr.h" #include "webrtc/test/testsupport/fileutils.h" #include "webrtc/test/testsupport/gtest_disable.h" diff --git a/webrtc/modules/audio_coding/neteq/tools/audio_checksum.h b/webrtc/modules/audio_coding/neteq/tools/audio_checksum.h index ac5682651..6070eff61 100644 --- a/webrtc/modules/audio_coding/neteq/tools/audio_checksum.h +++ b/webrtc/modules/audio_coding/neteq/tools/audio_checksum.h @@ -13,11 +13,11 @@ #include +#include "webrtc/base/compile_assert.h" #include "webrtc/base/constructormagic.h" #include "webrtc/base/md5digest.h" #include "webrtc/base/stringencode.h" #include "webrtc/modules/audio_coding/neteq/tools/audio_sink.h" -#include "webrtc/system_wrappers/interface/compile_assert.h" #include "webrtc/typedefs.h" namespace webrtc { diff --git a/webrtc/modules/audio_processing/agc/agc.cc b/webrtc/modules/audio_processing/agc/agc.cc index 298cfd9d8..8c2e1c3cc 100644 --- a/webrtc/modules/audio_processing/agc/agc.cc +++ b/webrtc/modules/audio_processing/agc/agc.cc @@ -15,6 +15,7 @@ #include +#include "webrtc/base/compile_assert.h" #include "webrtc/common_audio/resampler/include/resampler.h" #include "webrtc/modules/audio_processing/agc/agc_audio_proc.h" #include "webrtc/modules/audio_processing/agc/common.h" @@ -23,7 +24,6 @@ #include "webrtc/modules/audio_processing/agc/standalone_vad.h" #include "webrtc/modules/audio_processing/agc/utility.h" #include "webrtc/modules/interface/module_common_types.h" -#include "webrtc/system_wrappers/interface/compile_assert.h" namespace webrtc { namespace { diff --git a/webrtc/modules/audio_processing/agc/agc_audio_proc.cc b/webrtc/modules/audio_processing/agc/agc_audio_proc.cc index 002b201f8..bdefdf420 100644 --- a/webrtc/modules/audio_processing/agc/agc_audio_proc.cc +++ b/webrtc/modules/audio_processing/agc/agc_audio_proc.cc @@ -13,6 +13,7 @@ #include #include +#include "webrtc/base/compile_assert.h" #include "webrtc/modules/audio_processing/agc/agc_audio_proc_internal.h" #include "webrtc/modules/audio_processing/agc/pitch_internal.h" #include "webrtc/modules/audio_processing/agc/pole_zero_filter.h" @@ -24,7 +25,6 @@ extern "C" { #include "webrtc/modules/audio_processing/utility/fft4g.h" } #include "webrtc/modules/interface/module_common_types.h" -#include "webrtc/system_wrappers/interface/compile_assert.h" namespace webrtc { diff --git a/webrtc/modules/audio_processing/agc/agc_audio_proc_internal.h b/webrtc/modules/audio_processing/agc/agc_audio_proc_internal.h index dc125ef05..24ba74145 100644 --- a/webrtc/modules/audio_processing/agc/agc_audio_proc_internal.h +++ b/webrtc/modules/audio_processing/agc/agc_audio_proc_internal.h @@ -11,7 +11,7 @@ #ifndef WEBRTC_MODULES_AUDIO_PROCESSING_AGC_AGC_AUDIO_PROC_INTERNAL_H_ #define WEBRTC_MODULES_AUDIO_PROCESSING_AGC_AGC_AUDIO_PROC_INTERNAL_H_ -#include "webrtc/system_wrappers/interface/compile_assert.h" +#include "webrtc/base/compile_assert.h" namespace webrtc { diff --git a/webrtc/modules/audio_processing/agc/agc_manager_direct.cc b/webrtc/modules/audio_processing/agc/agc_manager_direct.cc index 37248c183..99f45090a 100644 --- a/webrtc/modules/audio_processing/agc/agc_manager_direct.cc +++ b/webrtc/modules/audio_processing/agc/agc_manager_direct.cc @@ -17,10 +17,10 @@ #include #endif +#include "webrtc/base/compile_assert.h" #include "webrtc/modules/audio_processing/agc/gain_map_internal.h" #include "webrtc/modules/audio_processing/gain_control_impl.h" #include "webrtc/modules/interface/module_common_types.h" -#include "webrtc/system_wrappers/interface/compile_assert.h" #include "webrtc/system_wrappers/interface/logging.h" namespace webrtc { diff --git a/webrtc/modules/audio_processing/agc/histogram.cc b/webrtc/modules/audio_processing/agc/histogram.cc index ab18c6580..fa511b695 100644 --- a/webrtc/modules/audio_processing/agc/histogram.cc +++ b/webrtc/modules/audio_processing/agc/histogram.cc @@ -13,8 +13,8 @@ #include #include +#include "webrtc/base/compile_assert.h" #include "webrtc/modules/interface/module_common_types.h" -#include "webrtc/system_wrappers/interface/compile_assert.h" namespace webrtc { diff --git a/webrtc/modules/audio_processing/agc/pitch_based_vad.cc b/webrtc/modules/audio_processing/agc/pitch_based_vad.cc index 675a1c8cb..bbbc40775 100644 --- a/webrtc/modules/audio_processing/agc/pitch_based_vad.cc +++ b/webrtc/modules/audio_processing/agc/pitch_based_vad.cc @@ -14,12 +14,12 @@ #include #include +#include "webrtc/base/compile_assert.h" #include "webrtc/modules/audio_processing/agc/circular_buffer.h" #include "webrtc/modules/audio_processing/agc/common.h" #include "webrtc/modules/audio_processing/agc/noise_gmm_tables.h" #include "webrtc/modules/audio_processing/agc/voice_gmm_tables.h" #include "webrtc/modules/interface/module_common_types.h" -#include "webrtc/system_wrappers/interface/compile_assert.h" namespace webrtc { diff --git a/webrtc/modules/audio_processing/agc/pole_zero_filter_unittest.cc b/webrtc/modules/audio_processing/agc/pole_zero_filter_unittest.cc index e487858ef..29837e79b 100644 --- a/webrtc/modules/audio_processing/agc/pole_zero_filter_unittest.cc +++ b/webrtc/modules/audio_processing/agc/pole_zero_filter_unittest.cc @@ -14,8 +14,8 @@ #include #include "gtest/gtest.h" +#include "webrtc/base/compile_assert.h" #include "webrtc/modules/audio_processing/agc/agc_audio_proc_internal.h" -#include "webrtc/system_wrappers/interface/compile_assert.h" #include "webrtc/system_wrappers/interface/scoped_ptr.h" #include "webrtc/test/testsupport/fileutils.h" diff --git a/webrtc/modules/audio_processing/audio_processing_impl.cc b/webrtc/modules/audio_processing/audio_processing_impl.cc index 2483841ec..0063608ac 100644 --- a/webrtc/modules/audio_processing/audio_processing_impl.cc +++ b/webrtc/modules/audio_processing/audio_processing_impl.cc @@ -12,6 +12,7 @@ #include +#include "webrtc/base/compile_assert.h" #include "webrtc/base/platform_file.h" #include "webrtc/common_audio/include/audio_util.h" #include "webrtc/common_audio/signal_processing/include/signal_processing_library.h" @@ -30,7 +31,6 @@ #include "webrtc/modules/audio_processing/transient/transient_suppressor.h" #include "webrtc/modules/audio_processing/voice_detection_impl.h" #include "webrtc/modules/interface/module_common_types.h" -#include "webrtc/system_wrappers/interface/compile_assert.h" #include "webrtc/system_wrappers/interface/critical_section_wrapper.h" #include "webrtc/system_wrappers/interface/file_wrapper.h" #include "webrtc/system_wrappers/interface/logging.h" diff --git a/webrtc/modules/desktop_capture/win/cursor.cc b/webrtc/modules/desktop_capture/win/cursor.cc index e3c272ce8..53a90e586 100644 --- a/webrtc/modules/desktop_capture/win/cursor.cc +++ b/webrtc/modules/desktop_capture/win/cursor.cc @@ -12,11 +12,11 @@ #include +#include "webrtc/base/compile_assert.h" #include "webrtc/modules/desktop_capture/win/scoped_gdi_object.h" #include "webrtc/modules/desktop_capture/desktop_frame.h" #include "webrtc/modules/desktop_capture/desktop_geometry.h" #include "webrtc/modules/desktop_capture/mouse_cursor.h" -#include "webrtc/system_wrappers/interface/compile_assert.h" #include "webrtc/system_wrappers/interface/logging.h" #include "webrtc/system_wrappers/interface/scoped_ptr.h" #include "webrtc/typedefs.h" diff --git a/webrtc/modules/media_file/source/media_file_unittest.cc b/webrtc/modules/media_file/source/media_file_unittest.cc index 15c529b1a..dc70b2bae 100644 --- a/webrtc/modules/media_file/source/media_file_unittest.cc +++ b/webrtc/modules/media_file/source/media_file_unittest.cc @@ -9,8 +9,8 @@ */ #include "testing/gtest/include/gtest/gtest.h" +#include "webrtc/base/compile_assert.h" #include "webrtc/modules/media_file/interface/media_file.h" -#include "webrtc/system_wrappers/interface/compile_assert.h" #include "webrtc/system_wrappers/interface/sleep.h" #include "webrtc/test/testsupport/fileutils.h" #include "webrtc/test/testsupport/gtest_disable.h" diff --git a/webrtc/modules/rtp_rtcp/source/rtp_format_vp8_unittest.cc b/webrtc/modules/rtp_rtcp/source/rtp_format_vp8_unittest.cc index d2416b29a..1412bdf6e 100644 --- a/webrtc/modules/rtp_rtcp/source/rtp_format_vp8_unittest.cc +++ b/webrtc/modules/rtp_rtcp/source/rtp_format_vp8_unittest.cc @@ -14,9 +14,9 @@ #include "testing/gmock/include/gmock/gmock.h" #include "testing/gtest/include/gtest/gtest.h" +#include "webrtc/base/compile_assert.h" #include "webrtc/modules/rtp_rtcp/source/rtp_format_vp8.h" #include "webrtc/modules/rtp_rtcp/source/rtp_format_vp8_test_helper.h" -#include "webrtc/system_wrappers/interface/compile_assert.h" #include "webrtc/typedefs.h" #define CHECK_ARRAY_SIZE(expected_size, array) \ diff --git a/webrtc/system_wrappers/BUILD.gn b/webrtc/system_wrappers/BUILD.gn index c4d219269..630b3dbd9 100644 --- a/webrtc/system_wrappers/BUILD.gn +++ b/webrtc/system_wrappers/BUILD.gn @@ -21,7 +21,6 @@ static_library("system_wrappers") { "interface/aligned_malloc.h", "interface/atomic32.h", "interface/clock.h", - "interface/compile_assert.h", "interface/condition_variable_wrapper.h", "interface/cpu_info.h", "interface/cpu_features_wrapper.h", diff --git a/webrtc/system_wrappers/interface/compile_assert.h b/webrtc/system_wrappers/interface/compile_assert.h deleted file mode 100644 index a075184b5..000000000 --- a/webrtc/system_wrappers/interface/compile_assert.h +++ /dev/null @@ -1,90 +0,0 @@ -/* - * Copyright (c) 2012 The WebRTC project authors. All Rights Reserved. - * - * Use of this source code is governed by a BSD-style license - * that can be found in the LICENSE file in the root of the source - * tree. An additional intellectual property rights grant can be found - * in the file PATENTS. All contributing project authors may - * be found in the AUTHORS file in the root of the source tree. - */ - -// Borrowed from Chromium's src/base/macros.h. - -#ifndef WEBRTC_SYSTEM_WRAPPERS_INTERFACE_COMPILE_ASSERT_H_ -#define WEBRTC_SYSTEM_WRAPPERS_INTERFACE_COMPILE_ASSERT_H_ - -// The COMPILE_ASSERT macro can be used to verify that a compile time -// expression is true. For example, you could use it to verify the -// size of a static array: -// -// COMPILE_ASSERT(ARRAYSIZE_UNSAFE(content_type_names) == CONTENT_NUM_TYPES, -// content_type_names_incorrect_size); -// -// or to make sure a struct is smaller than a certain size: -// -// COMPILE_ASSERT(sizeof(foo) < 128, foo_too_large); -// -// The second argument to the macro is the name of the variable. If -// the expression is false, most compilers will issue a warning/error -// containing the name of the variable. - -// TODO(ajm): Hack to avoid multiple definitions until the base/ of webrtc and -// libjingle are merged. -#if !defined(COMPILE_ASSERT) -#if __cplusplus >= 201103L -// Under C++11, just use static_assert. -#define COMPILE_ASSERT(expr, msg) static_assert(expr, #msg) - -#else -template -struct CompileAssert { -}; - -#define COMPILE_ASSERT(expr, msg) \ - typedef CompileAssert<(bool(expr))> msg[bool(expr) ? 1 : -1] - -#endif // __cplusplus >= 201103L -#endif // !defined(COMPILE_ASSERT) - -// Implementation details of COMPILE_ASSERT: -// -// - COMPILE_ASSERT works by defining an array type that has -1 -// elements (and thus is invalid) when the expression is false. -// -// - The simpler definition -// -// #define COMPILE_ASSERT(expr, msg) typedef char msg[(expr) ? 1 : -1] -// -// does not work, as gcc supports variable-length arrays whose sizes -// are determined at run-time (this is gcc's extension and not part -// of the C++ standard). As a result, gcc fails to reject the -// following code with the simple definition: -// -// int foo; -// COMPILE_ASSERT(foo, msg); // not supposed to compile as foo is -// // not a compile-time constant. -// -// - By using the type CompileAssert<(bool(expr))>, we ensures that -// expr is a compile-time constant. (Template arguments must be -// determined at compile-time.) -// -// - The outer parentheses in CompileAssert<(bool(expr))> are necessary -// to work around a bug in gcc 3.4.4 and 4.0.1. If we had written -// -// CompileAssert -// -// instead, these compilers will refuse to compile -// -// COMPILE_ASSERT(5 > 0, some_message); -// -// (They seem to think the ">" in "5 > 0" marks the end of the -// template argument list.) -// -// - The array size is (bool(expr) ? 1 : -1), instead of simply -// -// ((expr) ? 1 : -1). -// -// This is to avoid running into a bug in MS VC 7.1, which -// causes ((0.0) ? 1 : -1) to incorrectly evaluate to 1. - -#endif // WEBRTC_SYSTEM_WRAPPERS_INTERFACE_COMPILE_ASSERT_H_ diff --git a/webrtc/system_wrappers/interface/scoped_ptr.h b/webrtc/system_wrappers/interface/scoped_ptr.h index 0db0ee377..dc1a5a8ae 100644 --- a/webrtc/system_wrappers/interface/scoped_ptr.h +++ b/webrtc/system_wrappers/interface/scoped_ptr.h @@ -104,9 +104,9 @@ #include // For std::swap(). +#include "webrtc/base/compile_assert.h" #include "webrtc/base/constructormagic.h" #include "webrtc/base/move.h" -#include "webrtc/system_wrappers/interface/compile_assert.h" #include "webrtc/system_wrappers/interface/template_util.h" #include "webrtc/typedefs.h" diff --git a/webrtc/system_wrappers/source/atomic32_win.cc b/webrtc/system_wrappers/source/atomic32_win.cc index 7c70376fa..50c49895d 100644 --- a/webrtc/system_wrappers/source/atomic32_win.cc +++ b/webrtc/system_wrappers/source/atomic32_win.cc @@ -13,8 +13,8 @@ #include #include +#include "webrtc/base/compile_assert.h" #include "webrtc/common_types.h" -#include "webrtc/system_wrappers/interface/compile_assert.h" namespace webrtc { diff --git a/webrtc/system_wrappers/source/system_wrappers.gyp b/webrtc/system_wrappers/source/system_wrappers.gyp index 2cdd23de6..76df42b62 100644 --- a/webrtc/system_wrappers/source/system_wrappers.gyp +++ b/webrtc/system_wrappers/source/system_wrappers.gyp @@ -29,7 +29,6 @@ '../interface/aligned_malloc.h', '../interface/atomic32.h', '../interface/clock.h', - '../interface/compile_assert.h', '../interface/condition_variable_wrapper.h', '../interface/cpu_info.h', '../interface/cpu_features_wrapper.h',