
Clang version changed 223108:230914
Details: e144d30..6fdb142
/tools/clang/scripts/update.sh
Removes the OVERRIDE macro defined in:
* webrtc/base/common.h
* webrtc/typedefs.h
The majority of the source changes were done by running this in src/:
perl -0pi -e "s/virtual\s([^({;]*(\([^({;]*\)[^({;]*))(OVERRIDE|override)/\1override/sg" `find {talk,webrtc} -name "*.h" -o -name "*.cc*" -o -name "*.mm*"`
which converted all:
virtual Foo() OVERRIDE
functions to:
Foo() override
Then I manually edited:
* talk/media/webrtc/fakewebrtccommon.h
* webrtc/test/fake_common.h
Remaining uses of OVERRIDE was fixed by search+replace.
Manual edits were done to fix virtual destructors that were
overriding inherited ones.
Finally a build error related to the pure virtual definitions of
Read, Write and Rewind in common_types.h required a bit of
refactoring in:
* webrtc/common_types.cc
* webrtc/common_types.h
* webrtc/system_wrappers/interface/file_wrapper.h
* webrtc/system_wrappers/source/file_impl.cc
This roll should make it possible for us to finally re-enable deadlock
detection for TSan on the buildbots.
BUG=4106
R=pbos@webrtc.org, tommi@webrtc.org
Review URL: https://webrtc-codereview.appspot.com/41069004
Cr-Commit-Position: refs/heads/master@{#8596}
git-svn-id: http://webrtc.googlecode.com/svn/trunk@8596 4adac7df-926f-26a2-2b94-8c16560cd09d
121 lines
3.8 KiB
C
121 lines
3.8 KiB
C
/*
|
|
* 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.
|
|
*/
|
|
|
|
// This file contains platform-specific typedefs and defines.
|
|
// Much of it is derived from Chromium's build/build_config.h.
|
|
|
|
#ifndef WEBRTC_TYPEDEFS_H_
|
|
#define WEBRTC_TYPEDEFS_H_
|
|
|
|
// Processor architecture detection. For more info on what's defined, see:
|
|
// http://msdn.microsoft.com/en-us/library/b0084kay.aspx
|
|
// http://www.agner.org/optimize/calling_conventions.pdf
|
|
// or with gcc, run: "echo | gcc -E -dM -"
|
|
#if defined(_M_X64) || defined(__x86_64__)
|
|
#define WEBRTC_ARCH_X86_FAMILY
|
|
#define WEBRTC_ARCH_X86_64
|
|
#define WEBRTC_ARCH_64_BITS
|
|
#define WEBRTC_ARCH_LITTLE_ENDIAN
|
|
#elif defined(__aarch64__)
|
|
#define WEBRTC_ARCH_64_BITS
|
|
#define WEBRTC_ARCH_LITTLE_ENDIAN
|
|
#elif defined(_M_IX86) || defined(__i386__)
|
|
#define WEBRTC_ARCH_X86_FAMILY
|
|
#define WEBRTC_ARCH_X86
|
|
#define WEBRTC_ARCH_32_BITS
|
|
#define WEBRTC_ARCH_LITTLE_ENDIAN
|
|
#elif defined(__ARMEL__)
|
|
// TODO(ajm): We'd prefer to control platform defines here, but this is
|
|
// currently provided by the Android makefiles. Commented to avoid duplicate
|
|
// definition warnings.
|
|
//#define WEBRTC_ARCH_ARM
|
|
// TODO(ajm): Chromium uses the following two defines. Should we switch?
|
|
//#define WEBRTC_ARCH_ARM_FAMILY
|
|
//#define WEBRTC_ARCH_ARMEL
|
|
#define WEBRTC_ARCH_32_BITS
|
|
#define WEBRTC_ARCH_LITTLE_ENDIAN
|
|
#elif defined(__MIPSEL__)
|
|
#define WEBRTC_ARCH_32_BITS
|
|
#define WEBRTC_ARCH_LITTLE_ENDIAN
|
|
#elif defined(__pnacl__)
|
|
#define WEBRTC_ARCH_32_BITS
|
|
#define WEBRTC_ARCH_LITTLE_ENDIAN
|
|
#else
|
|
#error Please add support for your architecture in typedefs.h
|
|
#endif
|
|
|
|
#if !(defined(WEBRTC_ARCH_LITTLE_ENDIAN) ^ defined(WEBRTC_ARCH_BIG_ENDIAN))
|
|
#error Define either WEBRTC_ARCH_LITTLE_ENDIAN or WEBRTC_ARCH_BIG_ENDIAN
|
|
#endif
|
|
|
|
#if (defined(WEBRTC_ARCH_X86_FAMILY) && !defined(__SSE2__)) || \
|
|
(defined(WEBRTC_ARCH_ARM_V7) && !defined(WEBRTC_ARCH_ARM_NEON))
|
|
#define WEBRTC_CPU_DETECTION
|
|
#endif
|
|
|
|
#if !defined(_MSC_VER)
|
|
#include <stdint.h>
|
|
#else
|
|
// Define C99 equivalent types, since pre-2010 MSVC doesn't provide stdint.h.
|
|
typedef signed char int8_t;
|
|
typedef signed short int16_t;
|
|
typedef signed int int32_t;
|
|
typedef __int64 int64_t;
|
|
typedef unsigned char uint8_t;
|
|
typedef unsigned short uint16_t;
|
|
typedef unsigned int uint32_t;
|
|
typedef unsigned __int64 uint64_t;
|
|
#endif
|
|
|
|
// Annotate a function indicating the caller must examine the return value.
|
|
// Use like:
|
|
// int foo() WARN_UNUSED_RESULT;
|
|
// TODO(ajm): Hack to avoid multiple definitions until the base/ of webrtc and
|
|
// libjingle are merged.
|
|
#if !defined(WARN_UNUSED_RESULT)
|
|
#if defined(__GNUC__)
|
|
#define WARN_UNUSED_RESULT __attribute__((warn_unused_result))
|
|
#else
|
|
#define WARN_UNUSED_RESULT
|
|
#endif
|
|
#endif // WARN_UNUSED_RESULT
|
|
|
|
// Put after a variable that might not be used, to prevent compiler warnings:
|
|
// int result ATTRIBUTE_UNUSED = DoSomething();
|
|
// assert(result == 17);
|
|
#ifndef ATTRIBUTE_UNUSED
|
|
#if defined(__GNUC__) || defined(__clang__)
|
|
#define ATTRIBUTE_UNUSED __attribute__((unused))
|
|
#else
|
|
#define ATTRIBUTE_UNUSED
|
|
#endif
|
|
#endif
|
|
|
|
// Macro to be used for switch-case fallthrough (required for enabling
|
|
// -Wimplicit-fallthrough warning on Clang).
|
|
#ifndef FALLTHROUGH
|
|
#if defined(__clang__)
|
|
#define FALLTHROUGH() [[clang::fallthrough]]
|
|
#else
|
|
#define FALLTHROUGH() do { } while (0)
|
|
#endif
|
|
#endif
|
|
|
|
// Annotate a function that will not return control flow to the caller.
|
|
#if defined(_MSC_VER)
|
|
#define NO_RETURN __declspec(noreturn)
|
|
#elif defined(__GNUC__)
|
|
#define NO_RETURN __attribute__((noreturn))
|
|
#else
|
|
#define NO_RETURN
|
|
#endif
|
|
|
|
#endif // WEBRTC_TYPEDEFS_H_
|