Commit c51c257b authored by Alexandre Julliard's avatar Alexandre Julliard

msvcrt: Import longjmp from ntdll for PE builds.

parent d538432d
...@@ -434,7 +434,7 @@ ...@@ -434,7 +434,7 @@
@ cdecl -arch=win64 localtime(ptr) _localtime64 @ cdecl -arch=win64 localtime(ptr) _localtime64
@ cdecl log(double) @ cdecl log(double)
@ cdecl log10(double) @ cdecl log10(double)
@ cdecl longjmp(ptr long) MSVCRT_longjmp @ cdecl longjmp(ptr long)
@ cdecl malloc(long) @ cdecl malloc(long)
@ cdecl mblen(ptr long) @ cdecl mblen(ptr long)
@ cdecl mbstowcs(ptr str long) @ cdecl mbstowcs(ptr str long)
......
...@@ -1054,7 +1054,7 @@ ...@@ -1054,7 +1054,7 @@
@ cdecl _locking(long long long) @ cdecl _locking(long long long)
@ cdecl _logb(double) logb @ cdecl _logb(double) logb
@ cdecl -arch=!i386 _logbf(float) logbf @ cdecl -arch=!i386 _logbf(float) logbf
@ cdecl -arch=i386 _longjmpex(ptr long) MSVCRT_longjmp @ cdecl -arch=i386 _longjmpex(ptr long) longjmp
@ cdecl _lrotl(long long) MSVCRT__lrotl @ cdecl _lrotl(long long) MSVCRT__lrotl
@ cdecl _lrotr(long long) MSVCRT__lrotr @ cdecl _lrotr(long long) MSVCRT__lrotr
@ cdecl _lsearch(ptr ptr ptr long ptr) @ cdecl _lsearch(ptr ptr ptr long ptr)
...@@ -1739,7 +1739,7 @@ ...@@ -1739,7 +1739,7 @@
@ cdecl -arch=!i386 logf(float) @ cdecl -arch=!i386 logf(float)
@ cdecl log10(double) @ cdecl log10(double)
@ cdecl -arch=!i386 log10f(float) @ cdecl -arch=!i386 log10f(float)
@ cdecl longjmp(ptr long) MSVCRT_longjmp @ cdecl longjmp(ptr long)
@ cdecl malloc(long) @ cdecl malloc(long)
@ cdecl mblen(ptr long) @ cdecl mblen(ptr long)
@ cdecl mbrlen(ptr long ptr) @ cdecl mbrlen(ptr long ptr)
......
...@@ -1411,7 +1411,7 @@ ...@@ -1411,7 +1411,7 @@
@ cdecl _locking(long long long) @ cdecl _locking(long long long)
@ cdecl _logb(double) logb @ cdecl _logb(double) logb
@ cdecl -arch=!i386 _logbf(float) logbf @ cdecl -arch=!i386 _logbf(float) logbf
@ cdecl -arch=i386 _longjmpex(ptr long) MSVCRT_longjmp @ cdecl -arch=i386 _longjmpex(ptr long) longjmp
@ cdecl _lrotl(long long) MSVCRT__lrotl @ cdecl _lrotl(long long) MSVCRT__lrotl
@ cdecl _lrotr(long long) MSVCRT__lrotr @ cdecl _lrotr(long long) MSVCRT__lrotr
@ cdecl _lsearch(ptr ptr ptr long ptr) @ cdecl _lsearch(ptr ptr ptr long ptr)
...@@ -2097,7 +2097,7 @@ ...@@ -2097,7 +2097,7 @@
@ cdecl -arch=!i386 logf(float) @ cdecl -arch=!i386 logf(float)
@ cdecl log10(double) @ cdecl log10(double)
@ cdecl -arch=!i386 log10f(float) @ cdecl -arch=!i386 log10f(float)
@ cdecl longjmp(ptr long) MSVCRT_longjmp @ cdecl longjmp(ptr long)
@ cdecl malloc(long) @ cdecl malloc(long)
@ cdecl mblen(ptr long) @ cdecl mblen(ptr long)
@ cdecl mbrlen(ptr long ptr) @ cdecl mbrlen(ptr long ptr)
......
...@@ -1422,7 +1422,7 @@ ...@@ -1422,7 +1422,7 @@
@ cdecl _locking(long long long) @ cdecl _locking(long long long)
@ cdecl _logb(double) logb @ cdecl _logb(double) logb
@ cdecl -arch=!i386 _logbf(float) logbf @ cdecl -arch=!i386 _logbf(float) logbf
@ cdecl -arch=i386 _longjmpex(ptr long) MSVCRT_longjmp @ cdecl -arch=i386 _longjmpex(ptr long) longjmp
@ cdecl _lrotl(long long) MSVCRT__lrotl @ cdecl _lrotl(long long) MSVCRT__lrotl
@ cdecl _lrotr(long long) MSVCRT__lrotr @ cdecl _lrotr(long long) MSVCRT__lrotr
@ cdecl _lsearch(ptr ptr ptr long ptr) @ cdecl _lsearch(ptr ptr ptr long ptr)
...@@ -2269,7 +2269,7 @@ ...@@ -2269,7 +2269,7 @@
@ cdecl logb(double) @ cdecl logb(double)
@ cdecl logbf(float) @ cdecl logbf(float)
@ cdecl logbl(double) logb @ cdecl logbl(double) logb
@ cdecl longjmp(ptr long) MSVCRT_longjmp @ cdecl longjmp(ptr long)
@ cdecl lrint(double) @ cdecl lrint(double)
@ cdecl lrintf(float) @ cdecl lrintf(float)
@ cdecl lrintl(double) lrint @ cdecl lrintl(double) lrint
......
...@@ -409,7 +409,7 @@ ...@@ -409,7 +409,7 @@
@ cdecl _lock(long) @ cdecl _lock(long)
@ cdecl _locking(long long long) @ cdecl _locking(long long long)
@ cdecl _logb(double) logb @ cdecl _logb(double) logb
@ cdecl -arch=i386 _longjmpex(ptr long) MSVCRT_longjmp @ cdecl -arch=i386 _longjmpex(ptr long) longjmp
@ cdecl _lrotl(long long) MSVCRT__lrotl @ cdecl _lrotl(long long) MSVCRT__lrotl
@ cdecl _lrotr(long long) MSVCRT__lrotr @ cdecl _lrotr(long long) MSVCRT__lrotr
@ cdecl _lsearch(ptr ptr ptr long ptr) @ cdecl _lsearch(ptr ptr ptr long ptr)
...@@ -780,7 +780,7 @@ ...@@ -780,7 +780,7 @@
@ cdecl -arch=win64 localtime(ptr) _localtime64 @ cdecl -arch=win64 localtime(ptr) _localtime64
@ cdecl log(double) @ cdecl log(double)
@ cdecl log10(double) @ cdecl log10(double)
@ cdecl longjmp(ptr long) MSVCRT_longjmp @ cdecl longjmp(ptr long)
@ cdecl malloc(long) @ cdecl malloc(long)
@ cdecl mblen(ptr long) @ cdecl mblen(ptr long)
@ cdecl mbstowcs(ptr str long) @ cdecl mbstowcs(ptr str long)
......
...@@ -404,7 +404,7 @@ ...@@ -404,7 +404,7 @@
@ cdecl _lock(long) @ cdecl _lock(long)
@ cdecl _locking(long long long) @ cdecl _locking(long long long)
@ cdecl _logb(double) logb @ cdecl _logb(double) logb
@ cdecl -arch=i386 _longjmpex(ptr long) MSVCRT_longjmp @ cdecl -arch=i386 _longjmpex(ptr long) longjmp
@ cdecl _lrotl(long long) MSVCRT__lrotl @ cdecl _lrotl(long long) MSVCRT__lrotl
@ cdecl _lrotr(long long) MSVCRT__lrotr @ cdecl _lrotr(long long) MSVCRT__lrotr
@ cdecl _lsearch(ptr ptr ptr long ptr) @ cdecl _lsearch(ptr ptr ptr long ptr)
...@@ -776,7 +776,7 @@ ...@@ -776,7 +776,7 @@
@ cdecl -arch=win64 localtime(ptr) _localtime64 @ cdecl -arch=win64 localtime(ptr) _localtime64
@ cdecl log(double) @ cdecl log(double)
@ cdecl log10(double) @ cdecl log10(double)
@ cdecl longjmp(ptr long) MSVCRT_longjmp @ cdecl longjmp(ptr long)
@ cdecl malloc(long) @ cdecl malloc(long)
@ cdecl mblen(ptr long) @ cdecl mblen(ptr long)
@ cdecl mbstowcs(ptr str long) @ cdecl mbstowcs(ptr str long)
......
...@@ -726,7 +726,7 @@ ...@@ -726,7 +726,7 @@
@ cdecl _locking(long long long) @ cdecl _locking(long long long)
@ cdecl _logb(double) logb @ cdecl _logb(double) logb
@ cdecl -arch=!i386 _logbf(float) logbf @ cdecl -arch=!i386 _logbf(float) logbf
@ cdecl -arch=i386 _longjmpex(ptr long) MSVCRT_longjmp @ cdecl -arch=i386 _longjmpex(ptr long) longjmp
@ cdecl _lrotl(long long) MSVCRT__lrotl @ cdecl _lrotl(long long) MSVCRT__lrotl
@ cdecl _lrotr(long long) MSVCRT__lrotr @ cdecl _lrotr(long long) MSVCRT__lrotr
@ cdecl _lsearch(ptr ptr ptr long ptr) @ cdecl _lsearch(ptr ptr ptr long ptr)
...@@ -1420,7 +1420,7 @@ ...@@ -1420,7 +1420,7 @@
@ cdecl -arch=!i386 logf(float) @ cdecl -arch=!i386 logf(float)
@ cdecl log10(double) @ cdecl log10(double)
@ cdecl -arch=!i386 log10f(float) @ cdecl -arch=!i386 log10f(float)
@ cdecl longjmp(ptr long) MSVCRT_longjmp @ cdecl longjmp(ptr long)
@ cdecl malloc(long) @ cdecl malloc(long)
@ cdecl mblen(ptr long) @ cdecl mblen(ptr long)
@ cdecl mbrlen(ptr long ptr) @ cdecl mbrlen(ptr long ptr)
......
...@@ -704,7 +704,7 @@ ...@@ -704,7 +704,7 @@
@ cdecl _locking(long long long) @ cdecl _locking(long long long)
@ cdecl _logb(double) logb @ cdecl _logb(double) logb
@ cdecl -arch=!i386 _logbf(float) logbf @ cdecl -arch=!i386 _logbf(float) logbf
@ cdecl -arch=i386 _longjmpex(ptr long) MSVCRT_longjmp @ cdecl -arch=i386 _longjmpex(ptr long) longjmp
@ cdecl _lrotl(long long) MSVCRT__lrotl @ cdecl _lrotl(long long) MSVCRT__lrotl
@ cdecl _lrotr(long long) MSVCRT__lrotr @ cdecl _lrotr(long long) MSVCRT__lrotr
@ cdecl _lsearch(ptr ptr ptr long ptr) @ cdecl _lsearch(ptr ptr ptr long ptr)
...@@ -1392,7 +1392,7 @@ ...@@ -1392,7 +1392,7 @@
@ cdecl log10(double) @ cdecl log10(double)
@ cdecl -arch=!i386 log10f(float) @ cdecl -arch=!i386 log10f(float)
@ cdecl -arch=!i386 logf(float) @ cdecl -arch=!i386 logf(float)
@ cdecl longjmp(ptr long) MSVCRT_longjmp @ cdecl longjmp(ptr long)
@ cdecl malloc(long) @ cdecl malloc(long)
@ cdecl mblen(ptr long) @ cdecl mblen(ptr long)
@ cdecl mbrlen(ptr long ptr) @ cdecl mbrlen(ptr long ptr)
......
...@@ -105,27 +105,6 @@ unsigned int CDECL __CxxQueryExceptionSize(void) ...@@ -105,27 +105,6 @@ unsigned int CDECL __CxxQueryExceptionSize(void)
} }
/*******************************************************************
* longjmp (MSVCRT.@)
*/
void __cdecl MSVCRT_longjmp(_JUMP_BUFFER *jmp, int retval)
{
EXCEPTION_RECORD rec;
if (!retval) retval = 1;
if (jmp->Frame)
{
rec.ExceptionCode = STATUS_LONGJUMP;
rec.ExceptionFlags = 0;
rec.ExceptionRecord = NULL;
rec.ExceptionAddress = NULL;
rec.NumberParameters = 1;
rec.ExceptionInformation[0] = (DWORD_PTR)jmp;
RtlUnwind((void *)jmp->Frame, (void *)jmp->Pc, &rec, IntToPtr(retval));
}
__wine_longjmp( (__wine_jmp_buf *)jmp, retval );
}
/********************************************************************* /*********************************************************************
* _fpieee_flt (MSVCRT.@) * _fpieee_flt (MSVCRT.@)
*/ */
......
...@@ -111,26 +111,6 @@ unsigned int CDECL __CxxQueryExceptionSize(void) ...@@ -111,26 +111,6 @@ unsigned int CDECL __CxxQueryExceptionSize(void)
*/ */
__ASM_GLOBAL_FUNC( _setjmp, "b _setjmpex" ); __ASM_GLOBAL_FUNC( _setjmp, "b _setjmpex" );
/*******************************************************************
* longjmp (MSVCRT.@)
*/
void __cdecl MSVCRT_longjmp(_JUMP_BUFFER *jmp, int retval)
{
EXCEPTION_RECORD rec;
if (!retval) retval = 1;
if (jmp->Frame)
{
rec.ExceptionCode = STATUS_LONGJUMP;
rec.ExceptionFlags = 0;
rec.ExceptionRecord = NULL;
rec.ExceptionAddress = NULL;
rec.NumberParameters = 1;
rec.ExceptionInformation[0] = (DWORD_PTR)jmp;
RtlUnwind((void *)jmp->Frame, (void *)jmp->Lr, &rec, IntToPtr(retval));
}
__wine_longjmp( (__wine_jmp_buf *)jmp, retval );
}
/********************************************************************* /*********************************************************************
* _fpieee_flt (MSVCRT.@) * _fpieee_flt (MSVCRT.@)
......
...@@ -105,27 +105,6 @@ unsigned int CDECL __CxxQueryExceptionSize(void) ...@@ -105,27 +105,6 @@ unsigned int CDECL __CxxQueryExceptionSize(void)
} }
/*******************************************************************
* longjmp (MSVCRT.@)
*/
void __cdecl MSVCRT_longjmp( _JUMP_BUFFER *jmp, int retval )
{
EXCEPTION_RECORD rec;
if (!retval) retval = 1;
if (jmp->Frame)
{
rec.ExceptionCode = STATUS_LONGJUMP;
rec.ExceptionFlags = 0;
rec.ExceptionRecord = NULL;
rec.ExceptionAddress = NULL;
rec.NumberParameters = 1;
rec.ExceptionInformation[0] = (DWORD_PTR)jmp;
RtlUnwind( (void *)jmp->Frame, (void *)jmp->Rip, &rec, IntToPtr(retval) );
}
__wine_longjmp( (__wine_jmp_buf *)jmp, retval );
}
/********************************************************************* /*********************************************************************
* _fpieee_flt (MSVCRT.@) * _fpieee_flt (MSVCRT.@)
*/ */
......
...@@ -27,9 +27,11 @@ ...@@ -27,9 +27,11 @@
#ifdef __i386__ #ifdef __i386__
#include <setjmp.h>
#include <stdarg.h> #include <stdarg.h>
#include <fpieee.h> #include <fpieee.h>
#define longjmp ms_longjmp /* avoid prototype mismatch */
#include <setjmp.h>
#undef longjmp
#include "windef.h" #include "windef.h"
#include "winbase.h" #include "winbase.h"
...@@ -1074,7 +1076,7 @@ int WINAPIV __regs__setjmp3(_JUMP_BUFFER *jmp, int nb_args, ...) ...@@ -1074,7 +1076,7 @@ int WINAPIV __regs__setjmp3(_JUMP_BUFFER *jmp, int nb_args, ...)
/********************************************************************* /*********************************************************************
* longjmp (MSVCRT.@) * longjmp (MSVCRT.@)
*/ */
void CDECL MSVCRT_longjmp(_JUMP_BUFFER *jmp, int retval) void __cdecl longjmp(_JUMP_BUFFER *jmp, int retval)
{ {
unsigned long cur_frame = 0; unsigned long cur_frame = 0;
......
...@@ -20,9 +20,11 @@ ...@@ -20,9 +20,11 @@
#if defined(__x86_64__) && !defined(__arm64ec__) #if defined(__x86_64__) && !defined(__arm64ec__)
#include <setjmp.h>
#include <stdarg.h> #include <stdarg.h>
#include <fpieee.h> #include <fpieee.h>
#define longjmp ms_longjmp /* avoid prototype mismatch */
#include <setjmp.h>
#undef longjmp
#include "ntstatus.h" #include "ntstatus.h"
#define WIN32_NO_STATUS #define WIN32_NO_STATUS
...@@ -700,7 +702,8 @@ unsigned int CDECL __CxxQueryExceptionSize(void) ...@@ -700,7 +702,8 @@ unsigned int CDECL __CxxQueryExceptionSize(void)
/******************************************************************* /*******************************************************************
* longjmp (MSVCRT.@) * longjmp (MSVCRT.@)
*/ */
void __cdecl MSVCRT_longjmp( _JUMP_BUFFER *jmp, int retval ) #ifndef __WINE_PE_BUILD
void __cdecl longjmp( _JUMP_BUFFER *jmp, int retval )
{ {
EXCEPTION_RECORD rec; EXCEPTION_RECORD rec;
...@@ -717,6 +720,7 @@ void __cdecl MSVCRT_longjmp( _JUMP_BUFFER *jmp, int retval ) ...@@ -717,6 +720,7 @@ void __cdecl MSVCRT_longjmp( _JUMP_BUFFER *jmp, int retval )
} }
__wine_longjmp( (__wine_jmp_buf *)jmp, retval ); __wine_longjmp( (__wine_jmp_buf *)jmp, retval );
} }
#endif
/******************************************************************* /*******************************************************************
* _local_unwind (MSVCRT.@) * _local_unwind (MSVCRT.@)
......
...@@ -672,7 +672,7 @@ ...@@ -672,7 +672,7 @@
@ cdecl _locking(long long long) @ cdecl _locking(long long long)
@ cdecl _logb(double) logb @ cdecl _logb(double) logb
@ cdecl -arch=!i386 _logbf(float) logbf @ cdecl -arch=!i386 _logbf(float) logbf
@ cdecl -arch=i386 _longjmpex(ptr long) MSVCRT_longjmp @ cdecl -arch=i386 _longjmpex(ptr long) longjmp
@ cdecl _lrotl(long long) MSVCRT__lrotl @ cdecl _lrotl(long long) MSVCRT__lrotl
@ cdecl _lrotr(long long) MSVCRT__lrotr @ cdecl _lrotr(long long) MSVCRT__lrotr
@ cdecl _lsearch(ptr ptr ptr long ptr) @ cdecl _lsearch(ptr ptr ptr long ptr)
...@@ -1368,7 +1368,7 @@ ...@@ -1368,7 +1368,7 @@
@ cdecl log10(double) @ cdecl log10(double)
@ cdecl -arch=!i386 logf(float) @ cdecl -arch=!i386 logf(float)
@ cdecl -arch=!i386 log10f(float) @ cdecl -arch=!i386 log10f(float)
@ cdecl longjmp(ptr long) MSVCRT_longjmp @ cdecl longjmp(ptr long)
@ cdecl malloc(long) @ cdecl malloc(long)
@ cdecl mblen(ptr long) @ cdecl mblen(ptr long)
@ cdecl mbrlen(ptr long ptr) @ cdecl mbrlen(ptr long ptr)
......
...@@ -386,7 +386,7 @@ ...@@ -386,7 +386,7 @@
@ cdecl _lock(long) @ cdecl _lock(long)
@ cdecl _locking(long long long) @ cdecl _locking(long long long)
@ cdecl _logb(double) logb @ cdecl _logb(double) logb
@ cdecl -arch=i386 _longjmpex(ptr long) MSVCRT_longjmp @ cdecl -arch=i386 _longjmpex(ptr long) longjmp
@ cdecl _lrotl(long long) MSVCRT__lrotl @ cdecl _lrotl(long long) MSVCRT__lrotl
@ cdecl _lrotr(long long) MSVCRT__lrotr @ cdecl _lrotr(long long) MSVCRT__lrotr
@ cdecl _lsearch(ptr ptr ptr long ptr) @ cdecl _lsearch(ptr ptr ptr long ptr)
...@@ -733,7 +733,7 @@ ...@@ -733,7 +733,7 @@
@ cdecl -arch=win64 localtime(ptr) _localtime64 @ cdecl -arch=win64 localtime(ptr) _localtime64
@ cdecl log(double) @ cdecl log(double)
@ cdecl log10(double) @ cdecl log10(double)
@ cdecl longjmp(ptr long) MSVCRT_longjmp @ cdecl longjmp(ptr long)
@ cdecl malloc(long) @ cdecl malloc(long)
@ cdecl mblen(ptr long) @ cdecl mblen(ptr long)
@ cdecl mbstowcs(ptr str long) @ cdecl mbstowcs(ptr str long)
......
...@@ -570,7 +570,7 @@ ...@@ -570,7 +570,7 @@
@ cdecl _locking(long long long) @ cdecl _locking(long long long)
@ cdecl _logb(double) logb @ cdecl _logb(double) logb
@ cdecl -arch=!i386 _logbf(float) logbf @ cdecl -arch=!i386 _logbf(float) logbf
@ cdecl -arch=i386 _longjmpex(ptr long) MSVCRT_longjmp @ cdecl -arch=i386 _longjmpex(ptr long) longjmp
@ cdecl _lrotl(long long) MSVCRT__lrotl @ cdecl _lrotl(long long) MSVCRT__lrotl
@ cdecl _lrotr(long long) MSVCRT__lrotr @ cdecl _lrotr(long long) MSVCRT__lrotr
@ cdecl _lsearch(ptr ptr ptr long ptr) @ cdecl _lsearch(ptr ptr ptr long ptr)
...@@ -2405,7 +2405,7 @@ ...@@ -2405,7 +2405,7 @@
@ cdecl logbf(float) @ cdecl logbf(float)
@ cdecl logbl(double) logb @ cdecl logbl(double) logb
@ cdecl -arch=!i386 logf(float) @ cdecl -arch=!i386 logf(float)
@ cdecl longjmp(ptr long) MSVCRT_longjmp @ cdecl longjmp(ptr long)
@ cdecl lrint(double) @ cdecl lrint(double)
@ cdecl lrintf(float) @ cdecl lrintf(float)
@ cdecl lrintl(double) lrint @ cdecl lrintl(double) lrint
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment