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}
diff --git a/webrtc/base/common.h b/webrtc/base/common.h index 2086754..1b1dac6 100644 --- a/webrtc/base/common.h +++ b/webrtc/base/common.h
@@ -178,7 +178,7 @@ // 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 @@ // 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
diff --git a/webrtc/base/criticalsection.h b/webrtc/base/criticalsection.h index ddbf857..5b3eaf5 100644 --- a/webrtc/base/criticalsection.h +++ b/webrtc/base/criticalsection.h
@@ -89,7 +89,7 @@ #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_;
diff --git a/webrtc/base/deprecation.h b/webrtc/base/deprecation.h index 459b898..ce950f9 100644 --- a/webrtc/base/deprecation.h +++ b/webrtc/base/deprecation.h
@@ -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
diff --git a/webrtc/typedefs.h b/webrtc/typedefs.h index f3839c7..6a3f441 100644 --- a/webrtc/typedefs.h +++ b/webrtc/typedefs.h
@@ -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