summaryrefslogtreecommitdiff
path: root/src/thread.c
diff options
context:
space:
mode:
authorEli Zaretskii <eliz@gnu.org>2017-10-28 19:39:48 +0300
committerEli Zaretskii <eliz@gnu.org>2017-10-28 19:39:48 +0300
commit00c3c6d88d28c639626c5bbb43901775d5a13314 (patch)
treedc26ee06cf74ddc0aec398be15a488d9dc1dffd1 /src/thread.c
parenta8e67410662e653e60e8dcc7aaf27042492afee8 (diff)
downloademacs-00c3c6d88d28c639626c5bbb43901775d5a13314.tar.gz
Avoid segfaults in 64-bit Windows builds
* src/lisp.h (COMMON_MULTIPLE): Move here from alloc.c. * src/thread.c (THREAD_ALIGNMENT): New macro. (main_thread): Use THREAD_ALIGNMENT to align propertly. (Bug#29040)
Diffstat (limited to 'src/thread.c')
-rw-r--r--src/thread.c4
1 files changed, 3 insertions, 1 deletions
diff --git a/src/thread.c b/src/thread.c
index 6f12d796ff9..7a670ba410b 100644
--- a/src/thread.c
+++ b/src/thread.c
@@ -26,7 +26,9 @@ along with GNU Emacs. If not, see <https://www.gnu.org/licenses/>. */
#include "coding.h"
#include "syssignal.h"
-static struct thread_state alignas (GCALIGNMENT) main_thread;
+#define THREAD_ALIGNMENT COMMON_MULTIPLE (alignof (max_align_t), GCALIGNMENT)
+
+static struct thread_state alignas (THREAD_ALIGNMENT) main_thread;
struct thread_state *current_thread = &main_thread;