From be3a31b22bb262f57954486ec40f5cbf07a9d828 Mon Sep 17 00:00:00 2001 From: Eli Zaretskii Date: Tue, 26 Mar 2013 19:32:52 +0200 Subject: [PATCH] Fix problem with _setjmp in MinGW64-compiled Emacs. nt/inc/ms-w32.h (USE_NO_MINGW_SETJMP_TWO_ARGS): Don't define. nt/config.nt (HAVE__SETJMP) [!_W64]: Don't define for MinGW64, as its _setjmp accepts 2 arguments. --- nt/ChangeLog | 5 +++++ nt/config.nt | 6 +++++- nt/inc/ms-w32.h | 1 - 3 files changed, 10 insertions(+), 2 deletions(-) diff --git a/nt/ChangeLog b/nt/ChangeLog index 031735edac8..6f208f2a18f 100644 --- a/nt/ChangeLog +++ b/nt/ChangeLog @@ -1,5 +1,10 @@ 2013-03-26 Eli Zaretskii + * inc/ms-w32.h (USE_NO_MINGW_SETJMP_TWO_ARGS): Don't define. + + * config.nt (HAVE__SETJMP) [!_W64]: Don't define for MinGW64, as + its _setjmp accepts 2 arguments. + * addsection.c (_ANONYMOUS_UNION, _ANONYMOUS_STRUCT): Do not define for MinGW64. diff --git a/nt/config.nt b/nt/config.nt index 1fe707cce2d..4f151fcad20 100644 --- a/nt/config.nt +++ b/nt/config.nt @@ -1143,8 +1143,12 @@ along with GNU Emacs. If not, see . */ /* Define to 1 if you have the `_ftime' function. */ #undef HAVE__FTIME -/* Define to 1 if _setjmp and _longjmp work. */ +/* Define to 1 if _setjmp and _longjmp work. MinGW64 uses a + 2-argument _setjmp, and setjmp is a macro defined to supply the 2nd + arg correctly, so don't use _setjmp directly in that case. */ +#ifndef _W64 #define HAVE__SETJMP 1 +#endif /* Define to 1 if you have the `__builtin_unwind_init' function. */ #undef HAVE___BUILTIN_UNWIND_INIT diff --git a/nt/inc/ms-w32.h b/nt/inc/ms-w32.h index f721676f731..fd18e8fd1da 100644 --- a/nt/inc/ms-w32.h +++ b/nt/inc/ms-w32.h @@ -158,7 +158,6 @@ extern char *getenv (); #ifdef _W64 /* MinGW64 specific stuff. */ -#define USE_NO_MINGW_SETJMP_TWO_ARGS 1 /* Make sure 'struct timespec' and 'struct timezone' are defined. */ #include #include -- 2.39.2