msys2/64bit fixes

git-svn-id: svn+ssh://svn.gna.org/svn/gnustep/libs/base/trunk@39942 72102866-910b-0410-8b05-ffd578937521
This commit is contained in:
Richard Frith-MacDonald 2016-06-28 14:01:55 +00:00
parent 89c92b4f4e
commit 6f1ac918fa
3 changed files with 19 additions and 3 deletions

View file

@ -50,9 +50,19 @@
#endif
#import <Foundation/NSString.h>
#include <setjmp.h>
#include <stdarg.h>
#if defined(__WIN64__)
/* This hack is to deal with the fact that currently (June 2016) the
* implementation of longjmp in mingw-w64 sometimes crashes in msvcrt.dll
* but the builtin version provided by gcc seems to work.
*/
#define setjmp(X) __builtin_setjmp(X)
#define longjmp(X,Y) __builtin_longjmp(X,Y)
#endif
#if defined(__cplusplus)
extern "C" {
#endif
@ -354,7 +364,7 @@ GS_EXPORT void _NSRemoveHandler( NSHandler *handler );
#define NS_DURING { NSHandler NSLocalHandler; \
_NSAddHandler(&NSLocalHandler); \
if( !setjmp(NSLocalHandler.jumpState) ) {
if (!setjmp(NSLocalHandler.jumpState)) {
#define NS_HANDLER _NSRemoveHandler(&NSLocalHandler); } else { \
NSException __attribute__((unused)) *localException \