shithub: openh264

Download patch

ref: af76ec0a6b2648254f318e792d7c4cdbf311685f
parent: 9d16e0f897a5fd9ef98ac32022d7a7eb3812fb44
author: Martin Storsjö <[email protected]>
date: Fri Jan 24 10:29:28 EST 2014

Bundle all MSVC/GCC alignment macros together

This reduces the number of lines spent on having the same
ifdef conditions over and over.

--- a/codec/common/macros.h
+++ b/codec/common/macros.h
@@ -73,26 +73,20 @@
 
 #define ALIGNED_DECLARE( type, var, n ) __declspec(align(n)) type var
 #define __align16(t,v) __declspec(align(16)) t v
-#elif defined(__GNUC__)
-#define ALIGNED_DECLARE( type, var, n ) type var __attribute__((aligned(n)))
-#define __align16(t,v) t v __attribute__ ((aligned (16)))
-#endif//_MSC_VER
-
-#if defined(_MACH_PLATFORM) || defined(__GNUC__)
+#define ALIGNED_DECLARE_MATRIX_1D(name,size,type,alignment) \
+	__declspec(align(alignment)) type name[(size)]
 #define ALIGNED_DECLARE_MATRIX_2D(name,sizex,sizey,type,alignment) \
-	type name[(sizex)*(sizey)] __attribute__((aligned(alignment)))
-#else //_MSC_VER <= 1200
-#define ALIGNED_DECLARE_MATRIX_2D(name,sizex,sizey,type,alignment) \
 __declspec(align(alignment)) type name[(sizex)*(sizey)]
-#endif//#if _MACH_PLATFORM
 
-#if defined(_MACH_PLATFORM) || defined(__GNUC__)
+#elif defined(__GNUC__)
+
+#define ALIGNED_DECLARE( type, var, n ) type var __attribute__((aligned(n)))
+#define __align16(t,v) t v __attribute__ ((aligned (16)))
 #define ALIGNED_DECLARE_MATRIX_1D(name,size,type,alignment) \
 	type name[size] __attribute__((aligned(alignment)))
-#else //_MSC_VER <= 1200
-#define ALIGNED_DECLARE_MATRIX_1D(name,size,type,alignment) \
-	__declspec(align(alignment)) type name[(size)]
-#endif//#if _MACH_PLATFORM
+#define ALIGNED_DECLARE_MATRIX_2D(name,sizex,sizey,type,alignment) \
+	type name[(sizex)*(sizey)] __attribute__((aligned(alignment)))
+#endif//_MSC_VER
 
 
 #ifndef	WELS_ALIGN