Author: gadamopoulos
Date: Thu Jul 29 12:23:03 2010
New Revision: 48352
URL:
http://svn.reactos.org/svn/reactos?rev=48352&view=rev
Log:
- Fix setjmp for msvc
Modified:
trunk/reactos/include/crt/setjmp.h
Modified: trunk/reactos/include/crt/setjmp.h
URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/include/crt/setjmp.h?rev=4…
==============================================================================
--- trunk/reactos/include/crt/setjmp.h [iso-8859-1] (original)
+++ trunk/reactos/include/crt/setjmp.h [iso-8859-1] Thu Jul 29 12:23:03 2010
@@ -136,29 +136,18 @@
#define _JMP_BUF_DEFINED
#endif
-static inline __attribute__((always_inline)) void * mingw_getsp(void)
-{
- void *value;
-#if defined(__x86_64)
#ifdef _MSC_VER
- __asm {mov value, rsp}
+int __cdecl __MINGW_NOTHROW setjmp(jmp_buf _Buf);
#else
- __asm__ __volatile__("movq %%rsp, %[value]" : [value] "=r"
(value) );
-#endif
-#elif defined(_X86_)
-#ifdef _MSC_VER
- __asm {mov value, esp}
-#else
- __asm__ __volatile__("movql %%esp, %[value]" : [value] "=r"
(value) );
-#endif
-#else
- #error mingw_getsp unimplemented
-#endif
- return value;
-}
-
#ifdef USE_MINGW_SETJMP_TWO_ARGS
#ifndef _INC_SETJMPEX
+#if defined(__x86_64)
+# define mingw_getsp() \
+ ({ void* value; __asm__ __volatile__("movq %%rsp, %[value]" : [value]
"=r" (value)); value; })
+#elif defined(_X86_)
+# define mingw_getsp() \
+ ({ void* value; __asm__ __volatile__("movl %%esp, %[value]" : [value]
"=r" (value)); value; })
+#endif
#define setjmp(BUF) _setjmp((BUF),mingw_getsp())
int __cdecl __MINGW_NOTHROW _setjmp(jmp_buf _Buf,void *_Ctx);
#else
@@ -173,6 +162,7 @@
#endif
int __cdecl __MINGW_NOTHROW setjmp(jmp_buf _Buf);
#endif
+#endif
__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);