From c4a049de25c5e898a57821b83d97879f66a4151b Mon Sep 17 00:00:00 2001 From: Ivan Maidanski Date: Thu, 13 Apr 2017 19:19:00 +0300 Subject: [PATCH] Eliminate 'incompatible function pointer' warning in mark_some (MinGW/x86) * include/private/gc_priv.h [__MINGW32__ && __i386__ && GC_EXTERN] (__MINGW_EXCPT_DEFINE_PSDK): Define (before any system header include); this macro definition is needed only when extra/gc.c is compiled. * mark.c [__MINGW32__ && __i386__] (__MINGW_EXCPT_DEFINE_PSDK): Define (before include gc_pmark.h). --- include/private/gc_priv.h | 6 ++++++ mark.c | 10 ++++++++++ 2 files changed, 16 insertions(+) diff --git a/include/private/gc_priv.h b/include/private/gc_priv.h index f7a0a714..c5a575c9 100644 --- a/include/private/gc_priv.h +++ b/include/private/gc_priv.h @@ -37,6 +37,12 @@ # define _USING_POSIX4A_DRAFT10 1 #endif +#if defined(__MINGW32__) && !defined(__MINGW_EXCPT_DEFINE_PSDK) \ + && defined(__i386__) && defined(GC_EXTERN) /* defined in gc.c */ + /* See the description in mark.c. */ +# define __MINGW_EXCPT_DEFINE_PSDK 1 +#endif + # if defined(NO_DEBUGGING) && !defined(GC_ASSERTIONS) && !defined(NDEBUG) /* To turn off assertion checking (in atomic_ops.h). */ # define NDEBUG 1 diff --git a/mark.c b/mark.c index d5682134..4d7670cc 100644 --- a/mark.c +++ b/mark.c @@ -14,6 +14,16 @@ * */ +#if defined(__MINGW32__) && !defined(__MINGW_EXCPT_DEFINE_PSDK) \ + && defined(__i386__) /* cannot use macros from gcconfig.h */ + /* Otherwise EXCEPTION_REGISTRATION type declaration from winnt.h */ + /* might be used. That declaration has "handler" callback with NTAPI */ + /* attribute. The proper type (with "handler" field compatible with */ + /* GC mark_ex_handler) is declared in excpt.h. The given macro is */ + /* defined before any system header include. */ +# define __MINGW_EXCPT_DEFINE_PSDK 1 +#endif + #include "private/gc_pmark.h" #include -- 2.40.0