Annotate COMPILE_ASSERT with __attribute__((unused)).

Also renames UNUSED -> ATTRIBUTE_UNUSED to be able to use this when
building peerconnection_jni.cc which apparently has this defined to
something else.

R=kjellander@webrtc.org
TBR=mflodman@webrtc.org
BUG=4018

Review URL: https://webrtc-codereview.appspot.com/28039005

git-svn-id: http://webrtc.googlecode.com/svn/trunk@7711 4adac7df-926f-26a2-2b94-8c16560cd09d
This commit is contained in:
pbos@webrtc.org
2014-11-17 13:47:38 +00:00
parent 4ef22d1d29
commit f5b56fbc41
3 changed files with 8 additions and 7 deletions

View File

@@ -110,13 +110,13 @@ typedef unsigned __int64 uint64_t;
#endif // WARN_UNUSED_RESULT
// Put after a variable that might not be used, to prevent compiler warnings:
// int result UNUSED = DoSomething();
// int result ATTRIBUTE_UNUSED = DoSomething();
// assert(result == 17);
#ifndef UNUSED
#ifdef __GNUC__
#define UNUSED __attribute__((unused))
#ifndef ATTRIBUTE_UNUSED
#if defined(__GNUC__) || defined(__clang__)
#define ATTRIBUTE_UNUSED __attribute__((unused))
#else
#define UNUSED
#define ATTRIBUTE_UNUSED
#endif
#endif