#ifndef _INC_SETJMP
#define _INC_SETJMP
-#include <_mingw.h>
+#include <crtdefs.h>
#pragma pack(push,_CRT_PACKING)
extern "C" {
#endif
+#ifndef _INC_SETJMPEX
+#define setjmp _setjmp
+#endif
+
#if (defined(_X86_) && !defined(__x86_64))
#define _JBLEN 16
unsigned long UnwindFunc;
unsigned long UnwindData[6];
} _JUMP_BUFFER;
+
#elif defined(__ia64__)
+
typedef _CRT_ALIGN(16) struct _SETJMP_FLOAT128 {
__int64 LowPart;
__int64 HighPart;
__int64 Preds;
} _JUMP_BUFFER;
+
#elif defined(__x86_64)
+
typedef _CRT_ALIGN(16) struct _SETJMP_FLOAT128 {
unsigned __int64 Part[2];
} SETJMP_FLOAT128;
SETJMP_FLOAT128 Xmm14;
SETJMP_FLOAT128 Xmm15;
} _JUMP_BUFFER;
+
#endif
+
#ifndef _JMP_BUF_DEFINED
typedef _JBTYPE jmp_buf[_JBLEN];
#define _JMP_BUF_DEFINED
#endif
-__CRT_INLINE void * __cdecl __attribute__ ((__nothrow__)) mingw_getsp(void)
-{
-#ifdef __GNUC__
-#ifdef __x86_64
- __int64 *ret;
- __asm__ __volatile__("leaq 16(%%rsp),%0\n"
- :"=r"(ret)
- :
- );
- return ret;
-#elif __i386__
- __int32 *ret;
- __asm__ __volatile__("lea 8(%esp),%0\n"
- :"=r"(ret)
- :
- );
- return ret;
-#endif
-#else
-#error Unsupported Compiler
-#endif
-}
+#if 0
+ void * __cdecl __MINGW_NOTHROW mingw_getsp(void);
#ifdef USE_MINGW_SETJMP_TWO_ARGS
#ifndef _INC_SETJMPEX
#define setjmp(BUF) _setjmp((BUF),mingw_getsp())
- int __cdecl __attribute__ ((__nothrow__)) _setjmp(jmp_buf _Buf,void *_Ctx);
+ int __cdecl __MINGW_NOTHROW _setjmp(jmp_buf _Buf,void *_Ctx);
#else
#undef setjmp
#define setjmp(BUF) _setjmpex((BUF),mingw_getsp())
#define setjmpex(BUF) _setjmpex((BUF),mingw_getsp())
- int __cdecl __attribute__ ((__nothrow__)) _setjmpex(jmp_buf _Buf,void *_Ctx);
+ int __cdecl __MINGW_NOTHROW _setjmpex(jmp_buf _Buf,void *_Ctx);
#endif
#else
#ifndef _INC_SETJMPEX
#define setjmp _setjmp
#endif
- int __cdecl __attribute__ ((__nothrow__)) setjmp(jmp_buf _Buf);
+ int __cdecl __MINGW_NOTHROW setjmp(jmp_buf _Buf);
#endif
- __declspec(noreturn) __attribute__ ((__nothrow__)) void __cdecl ms_longjmp(jmp_buf _Buf,int _Value)/* throw(...)*/;
- __declspec(noreturn) __attribute__ ((__nothrow__)) void __cdecl longjmp(jmp_buf _Buf,int _Value);
+#endif // 0
+
+ __declspec(noreturn) __MINGW_NOTHROW void __cdecl ms_longjmp(jmp_buf _Buf,int _Value)/* throw(...)*/;
+ __declspec(noreturn) __MINGW_NOTHROW void __cdecl longjmp(jmp_buf _Buf,int _Value);
+ int __cdecl setjmp(jmp_buf _Buf);
#ifdef __cplusplus
}