]> git.sesse.net Git - ffmpeg/blobdiff - libavutil/mem.h
Fix MSVC identification, patch by Eddie Pang.
[ffmpeg] / libavutil / mem.h
index 84b7728b4a691e19cca197e68e6db4fc0c3f8d40..7bf707001b59d51d7221466a4d3019f6e6734ac9 100644 (file)
 #define FFMPEG_MEM_H
 
 #ifdef __ICC
-  #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 __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)))
+    #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
 #else
-  #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
+//  #warning No align and asm directives, this might fail.
+    #define DECLARE_ALIGNED(n,t,v)      t v
+    #define DECLARE_ASM_CONST(n,t,v)    static const t v
 #endif
 
 /**