aboutsummaryrefslogtreecommitdiffstats
path: root/libavutil/attributes.h
diff options
context:
space:
mode:
authorMartin Storsjö <martin@martin.st>2016-07-18 23:25:11 +0300
committerMartin Storsjö <martin@martin.st>2016-07-21 12:52:19 +0300
commitf637046d3134a331e4b5a7243ac3dfb92735b8a5 (patch)
tree4d9ed42c86596e53697ffcd1496d4e90d7b9506e /libavutil/attributes.h
parent6f9e34baea4f6f484392e4e67f606a0835d07b73 (diff)
downloadffmpeg-f637046d3134a331e4b5a7243ac3dfb92735b8a5.tar.gz
libavutil: Always use some GCC style attributes on clang
Clang normally disguises as GCC (defining __GNUC__), and thus get all the normal GCC specific attributes. Clang can also work as a drop-in replacement for MSVC, and in these cases, it doesn't define __GNUC__, but defines _MSC_VER instead. Even in these setups, it still supports the GCC style attributes, thus use them, especially where there isn't any MSVC specific version, or where the MSVC specific version doesn't work on clang (for DECLARE_ASM_CONST). Signed-off-by: Martin Storsjö <martin@martin.st>
Diffstat (limited to 'libavutil/attributes.h')
-rw-r--r--libavutil/attributes.h4
1 files changed, 2 insertions, 2 deletions
diff --git a/libavutil/attributes.h b/libavutil/attributes.h
index d7f2bb5c6f..c770f52a43 100644
--- a/libavutil/attributes.h
+++ b/libavutil/attributes.h
@@ -80,7 +80,7 @@
# define attribute_deprecated
#endif
-#if defined(__GNUC__)
+#if defined(__GNUC__) || defined(__clang__)
# define av_unused __attribute__((unused))
#else
# define av_unused
@@ -91,7 +91,7 @@
* away. This is useful for variables accessed only from inline
* assembler without the compiler being aware.
*/
-#if AV_GCC_VERSION_AT_LEAST(3,1)
+#if AV_GCC_VERSION_AT_LEAST(3,1) || defined(__clang__)
# define av_used __attribute__((used))
#else
# define av_used