[FFmpeg-devel] [PATCH] DECLARE_ALIGNED for sun compilers

Reimar Doeffinger Reimar.Doeffinger
Thu May 17 16:46:40 CEST 2007


Hello,
newer Sun compilers support aligned attribute, so we should use that
instead of __declspec which fails.
Older versions only support #pragma align, which i have no idea how to
use with teh current system.
Attached patch would make them just ignore alignment which should be
fine in 99% percent of cases since it can't compile the asm anyway
(actually, I am not sure if it could handle the SPARC asm, only tested
x86...).
Or we could just ignore these old compilers and put the __GNUC__ and
__sun cases in one #if.
What do you think?

Greetings,
Reimar Doeffinger
-------------- next part --------------
Index: libavutil/mem.h
===================================================================
--- libavutil/mem.h	(revision 9047)
+++ libavutil/mem.h	(working copy)
@@ -28,6 +28,12 @@
 
 #ifdef __GNUC__
   #define DECLARE_ALIGNED(n,t,v)       t v __attribute__ ((aligned (n)))
+#elif defined(__sun)
+  #if __SUNPRO_C < 0x590
+    #define DECLARE_ALIGNED(n,t,v)       t v
+  #else
+    #define DECLARE_ALIGNED(n,t,v)       t v __attribute__ ((aligned (n)))
+  #endif
 #else
   #define DECLARE_ALIGNED(n,t,v)      __declspec(align(n)) t v
 #endif



More information about the ffmpeg-devel mailing list