summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJacques Germishuys <jacquesg@striata.com>2014-09-25 12:05:26 +0200
committerCarlos Martín Nieto <cmn@dwim.me>2014-10-11 12:36:39 +0200
commitf975fe90d19084d8f37fb33315a38b146c4ea079 (patch)
tree9894dae6e9dee53d481c33bd5609109454f3ff90
parent2f83bfce4bf44313e941e595e503f8e5f1ee1d6e (diff)
downloadlibgit2-f975fe90d19084d8f37fb33315a38b146c4ea079.tar.gz
Introduce GIT_ALIGN
-rw-r--r--src/cc-compat.h8
1 files changed, 8 insertions, 0 deletions
diff --git a/src/cc-compat.h b/src/cc-compat.h
index e73cb6de8..0b66d8ba1 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 */