[FFmpeg-cvslog] Merge commit 'f637046d3134a331e4b5a7243ac3dfb92735b8a5'
Clément Bœsch
git at videolan.org
Thu Feb 2 12:27:57 EET 2017
ffmpeg | branch: master | Clément Bœsch <cboesch at gopro.com> | Thu Feb 2 11:26:05 2017 +0100| [55b2cfa921c3ad5a821fc0ec85093a658b102caa] | committer: Clément Bœsch
Merge commit 'f637046d3134a331e4b5a7243ac3dfb92735b8a5'
* commit 'f637046d3134a331e4b5a7243ac3dfb92735b8a5':
libavutil: Always use some GCC style attributes on clang
Merged-by: Clément Bœsch <cboesch at gopro.com>
> http://git.videolan.org/gitweb.cgi/ffmpeg.git/?a=commit;h=55b2cfa921c3ad5a821fc0ec85093a658b102caa
---
libavutil/attributes.h | 5 ++---
libavutil/mem.h | 2 +-
2 files changed, 3 insertions(+), 4 deletions(-)
diff --git a/libavutil/attributes.h b/libavutil/attributes.h
index 5c6b9de..54d1901 100644
--- a/libavutil/attributes.h
+++ b/libavutil/attributes.h
@@ -121,8 +121,7 @@
#endif
#endif
-
-#if defined(__GNUC__)
+#if defined(__GNUC__) || defined(__clang__)
# define av_unused __attribute__((unused))
#else
# define av_unused
@@ -133,7 +132,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
diff --git a/libavutil/mem.h b/libavutil/mem.h
index f9d8884..718a143 100644
--- a/libavutil/mem.h
+++ b/libavutil/mem.h
@@ -97,7 +97,7 @@
#define DECLARE_ASM_CONST(n,t,v) \
AV_PRAGMA(DATA_ALIGN(v,n)) \
static const t __attribute__((aligned(n))) v
-#elif defined(__GNUC__)
+#elif defined(__GNUC__) || defined(__clang__)
#define DECLARE_ALIGNED(n,t,v) t __attribute__ ((aligned (n))) v
#define DECLARE_ASM_CONST(n,t,v) static const t av_used __attribute__ ((aligned (n))) v
#elif defined(_MSC_VER)
======================================================================
diff --cc libavutil/attributes.h
index 5c6b9de,c770f52..54d1901
--- a/libavutil/attributes.h
+++ b/libavutil/attributes.h
@@@ -98,31 -80,7 +98,30 @@@
# define attribute_deprecated
#endif
+/**
+ * Disable warnings about deprecated features
+ * This is useful for sections of code kept for backward compatibility and
+ * scheduled for removal.
+ */
+#ifndef AV_NOWARN_DEPRECATED
+#if AV_GCC_VERSION_AT_LEAST(4,6)
+# define AV_NOWARN_DEPRECATED(code) \
+ _Pragma("GCC diagnostic push") \
+ _Pragma("GCC diagnostic ignored \"-Wdeprecated-declarations\"") \
+ code \
+ _Pragma("GCC diagnostic pop")
+#elif defined(_MSC_VER)
+# define AV_NOWARN_DEPRECATED(code) \
+ __pragma(warning(push)) \
+ __pragma(warning(disable : 4996)) \
+ code; \
+ __pragma(warning(pop))
+#else
+# define AV_NOWARN_DEPRECATED(code) code
+#endif
+#endif
+
-
- #if defined(__GNUC__)
+ #if defined(__GNUC__) || defined(__clang__)
# define av_unused __attribute__((unused))
#else
# define av_unused
More information about the ffmpeg-cvslog
mailing list