- Use __MINGW_NOTHROW instead of __attribute__
[reactos.git] / reactos / include / crt / setjmp.h
index 8caa577..673b4b5 100644 (file)
@@ -6,7 +6,7 @@
 #ifndef _INC_SETJMP
 #define _INC_SETJMP
 
-#include <_mingw.h>
+#include <crtdefs.h>
 
 #pragma pack(push,_CRT_PACKING)
 
@@ -130,48 +130,27 @@ extern "C" {
 #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
-}
+  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);
+  __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);
 
 #ifdef __cplusplus
 }