diff internal.h @ 622:2ff7ac1e95dd libavutil

Move DECLARE_ALIGNED and DECLARE_ASM_CONST to internal.h. Their definition depends on preprocessor directives from config.h, thus they cannot be declared in a public header since public headers cannot #include config.h.
author diego
date Sun, 25 Jan 2009 19:18:56 +0000
parents 27481e5860c1
children e142a179745c
line wrap: on
line diff
--- a/internal.h	Sun Jan 25 17:36:48 2009 +0000
+++ b/internal.h	Sun Jan 25 19:18:56 2009 +0000
@@ -258,6 +258,23 @@
     }\
 }
 
+#if defined(__ICC) || defined(__SUNPRO_C)
+    #define DECLARE_ALIGNED(n,t,v)      t v __attribute__ ((aligned (n)))
+    #define DECLARE_ASM_CONST(n,t,v)    const t __attribute__ ((aligned (n))) v
+#elif defined(__GNUC__)
+    #define DECLARE_ALIGNED(n,t,v)      t v __attribute__ ((aligned (n)))
+    #define DECLARE_ASM_CONST(n,t,v)    static const t v attribute_used __attribute__ ((aligned (n)))
+#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
+#elif HAVE_INLINE_ASM
+    #error The asm code needs alignment, but we do not know how to do it for this compiler.
+#else
+    #define DECLARE_ALIGNED(n,t,v)      t v
+    #define DECLARE_ASM_CONST(n,t,v)    static const t v
+#endif
+
+
 #if !HAVE_LLRINT
 static av_always_inline av_const long long llrint(double x)
 {