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.
|
// Forces compiler to inline, even against its better judgement. Use wisely.
|
||||||
#if defined(__GNUC__)
|
#if defined(__GNUC__)
|
||||||
#define FORCE_INLINE __attribute__((always_inline))
|
#define FORCE_INLINE __attribute__ ((__always_inline__))
|
||||||
#elif defined(WEBRTC_WIN)
|
#elif defined(WEBRTC_WIN)
|
||||||
#define FORCE_INLINE __forceinline
|
#define FORCE_INLINE __forceinline
|
||||||
#else
|
#else
|
||||||
@ -193,7 +193,7 @@ inline bool ImplicitCastToBool(bool result) { return result; }
|
|||||||
// libjingle are merged.
|
// libjingle are merged.
|
||||||
#if !defined(WARN_UNUSED_RESULT)
|
#if !defined(WARN_UNUSED_RESULT)
|
||||||
#if defined(__GNUC__) || defined(__clang__)
|
#if defined(__GNUC__) || defined(__clang__)
|
||||||
#define WARN_UNUSED_RESULT __attribute__((warn_unused_result))
|
#define WARN_UNUSED_RESULT __attribute__ ((__warn_unused_result__))
|
||||||
#else
|
#else
|
||||||
#define WARN_UNUSED_RESULT
|
#define WARN_UNUSED_RESULT
|
||||||
#endif
|
#endif
|
||||||
|
|||||||
@ -89,7 +89,7 @@ class TryCritScope {
|
|||||||
#if defined(WEBRTC_WIN)
|
#if defined(WEBRTC_WIN)
|
||||||
_Check_return_ bool locked() const;
|
_Check_return_ bool locked() const;
|
||||||
#else
|
#else
|
||||||
bool locked() const __attribute__((warn_unused_result));
|
bool locked() const __attribute__ ((__warn_unused_result__));
|
||||||
#endif
|
#endif
|
||||||
private:
|
private:
|
||||||
CriticalSection* const cs_;
|
CriticalSection* const cs_;
|
||||||
|
|||||||
@ -37,7 +37,7 @@
|
|||||||
// (https://bugs.chromium.org/p/webrtc/issues/detail?id=5368).
|
// (https://bugs.chromium.org/p/webrtc/issues/detail?id=5368).
|
||||||
#define RTC_DEPRECATED __declspec(deprecated)
|
#define RTC_DEPRECATED __declspec(deprecated)
|
||||||
#elif defined(__GNUC__)
|
#elif defined(__GNUC__)
|
||||||
#define RTC_DEPRECATED __attribute__((deprecated))
|
#define RTC_DEPRECATED __attribute__ ((__deprecated__))
|
||||||
#else
|
#else
|
||||||
#define RTC_DEPRECATED
|
#define RTC_DEPRECATED
|
||||||
#endif
|
#endif
|
||||||
|
|||||||
@ -73,7 +73,7 @@
|
|||||||
// libjingle are merged.
|
// libjingle are merged.
|
||||||
#if !defined(WARN_UNUSED_RESULT)
|
#if !defined(WARN_UNUSED_RESULT)
|
||||||
#if defined(__GNUC__) || defined(__clang__)
|
#if defined(__GNUC__) || defined(__clang__)
|
||||||
#define WARN_UNUSED_RESULT __attribute__((warn_unused_result))
|
#define WARN_UNUSED_RESULT __attribute__ ((__warn_unused_result__))
|
||||||
#else
|
#else
|
||||||
#define WARN_UNUSED_RESULT
|
#define WARN_UNUSED_RESULT
|
||||||
#endif
|
#endif
|
||||||
@ -84,7 +84,7 @@
|
|||||||
// assert(result == 17);
|
// assert(result == 17);
|
||||||
#ifndef ATTRIBUTE_UNUSED
|
#ifndef ATTRIBUTE_UNUSED
|
||||||
#if defined(__GNUC__) || defined(__clang__)
|
#if defined(__GNUC__) || defined(__clang__)
|
||||||
#define ATTRIBUTE_UNUSED __attribute__((unused))
|
#define ATTRIBUTE_UNUSED __attribute__ ((__unused__))
|
||||||
#else
|
#else
|
||||||
#define ATTRIBUTE_UNUSED
|
#define ATTRIBUTE_UNUSED
|
||||||
#endif
|
#endif
|
||||||
@ -104,7 +104,7 @@
|
|||||||
#if defined(_MSC_VER)
|
#if defined(_MSC_VER)
|
||||||
#define NO_RETURN __declspec(noreturn)
|
#define NO_RETURN __declspec(noreturn)
|
||||||
#elif defined(__GNUC__)
|
#elif defined(__GNUC__)
|
||||||
#define NO_RETURN __attribute__((noreturn))
|
#define NO_RETURN __attribute__ ((__noreturn__))
|
||||||
#else
|
#else
|
||||||
#define NO_RETURN
|
#define NO_RETURN
|
||||||
#endif
|
#endif
|
||||||
|
|||||||
Reference in New Issue
Block a user