[FFmpeg-cvslog] Rename attribute_used to av_used and move it to attributes.h

Mans Rullgard git
Mon Jan 31 18:48:16 CET 2011


ffmpeg | branch: master | Mans Rullgard <mans at mansr.com> | Mon Jan 31 02:19:30 2011 +0000| [0374152f8926bb3d0f2cd9cca56d12521fe0f71b] | committer: Michael Niedermayer

Rename attribute_used to av_used and move it to attributes.h

This is consistent with most of the other attribute macros.

Signed-off-by: Mans Rullgard <mans at mansr.com>
(cherry picked from commit 365e3c7878e4e821d5dec922d2d51f92ce13f926)

> http://git.videolan.org/gitweb.cgi/ffmpeg.git/?a=commit;h=0374152f8926bb3d0f2cd9cca56d12521fe0f71b
---

 libavutil/attributes.h |   13 +++++++++++++
 libavutil/internal.h   |   14 --------------
 libavutil/mem.h        |    2 +-
 3 files changed, 14 insertions(+), 15 deletions(-)

diff --git a/libavutil/attributes.h b/libavutil/attributes.h
index d93f460..65a9249 100644
--- a/libavutil/attributes.h
+++ b/libavutil/attributes.h
@@ -96,6 +96,19 @@
 #endif
 #endif
 
+/**
+ * Mark a variable as used and prevent the compiler from optimizing it
+ * away.  This is useful for variables accessed only from inline
+ * assembler without the compiler being aware.
+ */
+#ifndef av_used
+#if AV_GCC_VERSION_AT_LEAST(3,1)
+#    define av_used __attribute__((used))
+#else
+#    define av_used
+#endif
+#endif
+
 #ifndef av_alias
 #if (!defined(__ICC) || __ICC > 1200) && AV_GCC_VERSION_AT_LEAST(3,3)
 #   define av_alias __attribute__((may_alias))
diff --git a/libavutil/internal.h b/libavutil/internal.h
index 748a823..36d3e71 100644
--- a/libavutil/internal.h
+++ b/libavutil/internal.h
@@ -46,20 +46,6 @@
 #endif
 #endif
 
-
-/**
- * Mark a variable as used and prevent the compiler from optimizing it away.
- * This is useful for asm that accesses varibles in ways that the compiler does not
- * understand
- */
-#ifndef attribute_used
-#if AV_GCC_VERSION_AT_LEAST(3,1)
-#    define attribute_used __attribute__((used))
-#else
-#    define attribute_used
-#endif
-#endif
-
 #ifndef INT16_MIN
 #define INT16_MIN       (-0x7fff - 1)
 #endif
diff --git a/libavutil/mem.h b/libavutil/mem.h
index ab73a32..33ab48f 100644
--- a/libavutil/mem.h
+++ b/libavutil/mem.h
@@ -41,7 +41,7 @@
         static const t __attribute__((aligned(n))) v
 #elif defined(__GNUC__)
     #define DECLARE_ALIGNED(n,t,v)      t __attribute__ ((aligned (n))) v
-    #define DECLARE_ASM_CONST(n,t,v)    static const t attribute_used __attribute__ ((aligned (n))) v
+    #define DECLARE_ASM_CONST(n,t,v)    static const t av_used __attribute__ ((aligned (n))) v
 #elif defined(_MSC_VER)
     #define DECLARE_ALIGNED(n,t,v)      __declspec(align(n)) t v
     #define DECLARE_ASM_CONST(n,t,v)    __declspec(align(n)) static const t v




More information about the ffmpeg-cvslog mailing list