Update attributes to match gclibc's ansidecl.h
To ease use of WebRTC in other codebases, update some macros to match glibc's ansidecl.h, which uses double-underscores for attributes. NOTRY=True Review URL: https://codereview.webrtc.org/1571653002 Cr-Commit-Position: refs/heads/master@{#11185}
This commit is contained in:
@ -178,7 +178,7 @@ inline bool ImplicitCastToBool(bool result) { return result; }
|
||||
|
||||
// Forces compiler to inline, even against its better judgement. Use wisely.
|
||||
#if defined(__GNUC__)
|
||||
#define FORCE_INLINE __attribute__((always_inline))
|
||||
#define FORCE_INLINE __attribute__ ((__always_inline__))
|
||||
#elif defined(WEBRTC_WIN)
|
||||
#define FORCE_INLINE __forceinline
|
||||
#else
|
||||
@ -193,7 +193,7 @@ inline bool ImplicitCastToBool(bool result) { return result; }
|
||||
// libjingle are merged.
|
||||
#if !defined(WARN_UNUSED_RESULT)
|
||||
#if defined(__GNUC__) || defined(__clang__)
|
||||
#define WARN_UNUSED_RESULT __attribute__((warn_unused_result))
|
||||
#define WARN_UNUSED_RESULT __attribute__ ((__warn_unused_result__))
|
||||
#else
|
||||
#define WARN_UNUSED_RESULT
|
||||
#endif
|
||||
|
||||
@ -89,7 +89,7 @@ class TryCritScope {
|
||||
#if defined(WEBRTC_WIN)
|
||||
_Check_return_ bool locked() const;
|
||||
#else
|
||||
bool locked() const __attribute__((warn_unused_result));
|
||||
bool locked() const __attribute__ ((__warn_unused_result__));
|
||||
#endif
|
||||
private:
|
||||
CriticalSection* const cs_;
|
||||
|
||||
@ -37,7 +37,7 @@
|
||||
// (https://bugs.chromium.org/p/webrtc/issues/detail?id=5368).
|
||||
#define RTC_DEPRECATED __declspec(deprecated)
|
||||
#elif defined(__GNUC__)
|
||||
#define RTC_DEPRECATED __attribute__((deprecated))
|
||||
#define RTC_DEPRECATED __attribute__ ((__deprecated__))
|
||||
#else
|
||||
#define RTC_DEPRECATED
|
||||
#endif
|
||||
|
||||
@ -73,7 +73,7 @@
|
||||
// libjingle are merged.
|
||||
#if !defined(WARN_UNUSED_RESULT)
|
||||
#if defined(__GNUC__) || defined(__clang__)
|
||||
#define WARN_UNUSED_RESULT __attribute__((warn_unused_result))
|
||||
#define WARN_UNUSED_RESULT __attribute__ ((__warn_unused_result__))
|
||||
#else
|
||||
#define WARN_UNUSED_RESULT
|
||||
#endif
|
||||
@ -84,7 +84,7 @@
|
||||
// assert(result == 17);
|
||||
#ifndef ATTRIBUTE_UNUSED
|
||||
#if defined(__GNUC__) || defined(__clang__)
|
||||
#define ATTRIBUTE_UNUSED __attribute__((unused))
|
||||
#define ATTRIBUTE_UNUSED __attribute__ ((__unused__))
|
||||
#else
|
||||
#define ATTRIBUTE_UNUSED
|
||||
#endif
|
||||
@ -104,7 +104,7 @@
|
||||
#if defined(_MSC_VER)
|
||||
#define NO_RETURN __declspec(noreturn)
|
||||
#elif defined(__GNUC__)
|
||||
#define NO_RETURN __attribute__((noreturn))
|
||||
#define NO_RETURN __attribute__ ((__noreturn__))
|
||||
#else
|
||||
#define NO_RETURN
|
||||
#endif
|
||||
|
||||
Reference in New Issue
Block a user