summaryrefslogtreecommitdiff
path: root/libavutil/mem.h
diff options
context:
space:
mode:
authorMåns Rullgård <mans@mansr.com>2010-01-22 03:25:25 +0000
committerMåns Rullgård <mans@mansr.com>2010-01-22 03:25:25 +0000
commit34e52abb626c692e19012f9c32c1681141a19cfb (patch)
tree48352053d3dcd239e869fc47e4e408c2156155cd /libavutil/mem.h
parentd408b77a3a1a2841ae18ecc1922b3b3465f77e5c (diff)
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. Originally committed as revision 21379 to svn://svn.ffmpeg.org/ffmpeg/trunk
Diffstat (limited to 'libavutil/mem.h')
-rw-r--r--libavutil/mem.h7
1 files changed, 7 insertions, 0 deletions
diff --git a/libavutil/mem.h b/libavutil/mem.h
index ec5d4f9abe..75beffb39a 100644
--- a/libavutil/mem.h
+++ b/libavutil/mem.h
@@ -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