Welcome to mirror list, hosted at ThFree Co, Russian Federation.

git.blender.org/blender.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorStefan Werner <stefan.werner@tangent-animation.com>2017-11-09 16:59:31 +0300
committerStefan Werner <stefan.werner@tangent-animation.com>2017-11-09 16:59:31 +0300
commitdf886b178c9c176eefb73617c997f85e9d750c2d (patch)
treef67327da4c800ac3f44dd6aaf2326e421e1aa03a /source/blender/blenlib/BLI_compiler_attrs.h
parent83d9f8e37963e622fbd7d8c0902d077b67618f7b (diff)
Moved alignment attributes from my last commit to BLI_compiler_attrs.h for future use.
Diffstat (limited to 'source/blender/blenlib/BLI_compiler_attrs.h')
-rw-r--r--source/blender/blenlib/BLI_compiler_attrs.h10
1 files changed, 8 insertions, 2 deletions
diff --git a/source/blender/blenlib/BLI_compiler_attrs.h b/source/blender/blenlib/BLI_compiler_attrs.h
index 4c548654e33..2b6baa0d67b 100644
--- a/source/blender/blenlib/BLI_compiler_attrs.h
+++ b/source/blender/blenlib/BLI_compiler_attrs.h
@@ -94,10 +94,16 @@
/* Use to suppress '-Wimplicit-fallthrough' (in place of 'break'). */
#if defined(__GNUC__) && (__GNUC__ >= 7) /* gcc7.0+ only */
-#define ATTR_FALLTHROUGH __attribute__((fallthrough))
+# define ATTR_FALLTHROUGH __attribute__((fallthrough))
#else
-#define ATTR_FALLTHROUGH ((void)0)
+# define ATTR_FALLTHROUGH ((void)0)
#endif
+/* Declare the memory alignment in Bytes. */
+#if defined(_WIN32) && !defined(FREE_WINDOWS)
+# define ATTR_ALIGN(x) __declspec(align(x))
+#else
+# define ATTR_ALIGN(x) __attribute__((aligned(x)))
+#endif
#endif /* __BLI_COMPILER_ATTRS_H__ */