[FFmpeg-cvslog] r21379 - trunk/libavutil/mem.h

mru subversion
Fri Jan 22 04:25:25 CET 2010


Author: mru
Date: Fri Jan 22 04:25:25 2010
New Revision: 21379

Log:
DECLARE_ALIGNED macro for TMS470 compiler

This compiler supports gcc-style alignment attributes for struct,
but not for global variables.  For the latter, alignment can be
specified with a pragma, which does not work for struct members or
local variables.  By using both pragma and attribute, one or the
other will always take effect.

Unfortunately, no means exists for aligning stack variables.

Modified:
   trunk/libavutil/mem.h

Modified: trunk/libavutil/mem.h
==============================================================================
--- trunk/libavutil/mem.h	Fri Jan 22 04:25:21 2010	(r21378)
+++ trunk/libavutil/mem.h	Fri Jan 22 04:25:25 2010	(r21379)
@@ -31,6 +31,13 @@
 #if defined(__ICC) || defined(__SUNPRO_C)
     #define DECLARE_ALIGNED(n,t,v)      t __attribute__ ((aligned (n))) v
     #define DECLARE_ASM_CONST(n,t,v)    const t __attribute__ ((aligned (n))) v
+#elif defined(__TI_COMPILER_VERSION__)
+    #define DECLARE_ALIGNED(n,t,v)                      \
+        AV_PRAGMA(DATA_ALIGN(v,n))                      \
+        t __attribute__((aligned(n))) v
+    #define DECLARE_ASM_CONST(n,t,v)                    \
+        AV_PRAGMA(DATA_ALIGN(v,n))                      \
+        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



More information about the ffmpeg-cvslog mailing list