Commit 3aaa5c7b468318d7391e8126d5ca2e30205435c7

Jacques Germishuys 2014-09-25T12:05:26

Introduce GIT_ALIGN

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
diff --git a/src/cc-compat.h b/src/cc-compat.h
index e73cb6d..0b66d8b 100644
--- a/src/cc-compat.h
+++ b/src/cc-compat.h
@@ -35,6 +35,14 @@
 #	define GIT_TYPEOF(x)
 #endif
 
+#if defined(__GNUC__)
+#	define GIT_ALIGN(x,size) x __attribute__ ((aligned(size)))
+#elif defined(_MSC_VER)
+#	define GIT_ALIGN(x,size) __declspec(align(size)) x
+#else
+#	define GIT_ALIGN(x,size) x
+#endif
+
 #define GIT_UNUSED(x) ((void)(x))
 
 /* Define the printf format specifer to use for size_t output */