aboutsummaryrefslogtreecommitdiffstats
path: root/common/threads.h
diff options
context:
space:
mode:
authorChris Robinson <[email protected]>2018-01-12 03:55:33 -0800
committerChris Robinson <[email protected]>2018-01-12 03:55:33 -0800
commit4db1328bc58602619e12f67cb0b31e8785662ed2 (patch)
treee56f4f4011ccec480d27ebeeb4aa8c102eb3818e /common/threads.h
parente634564b26091fc315fdc592f4f87fdff86be729 (diff)
Move the FORCE_ALIGN macro to threads.h
Diffstat (limited to 'common/threads.h')
-rw-r--r--common/threads.h10
1 files changed, 10 insertions, 0 deletions
diff --git a/common/threads.h b/common/threads.h
index c2848ee7..87b8a6f5 100644
--- a/common/threads.h
+++ b/common/threads.h
@@ -3,6 +3,16 @@
#include <time.h>
+#if defined(__GNUC__) && defined(__i386__)
+/* force_align_arg_pointer is required for proper function arguments aligning
+ * when SSE code is used. Some systems (Windows, QNX) do not guarantee our
+ * thread functions will be properly aligned on the stack, even though GCC may
+ * generate code with the assumption that it is. */
+#define FORCE_ALIGN __attribute__((force_align_arg_pointer))
+#else
+#define FORCE_ALIGN
+#endif
+
#ifdef __cplusplus
extern "C" {
#endif