- get back atexit handling as it was before.
(reverts 52838, 52829, 52828)
Thanks to Kai and Timo for the explanation

svn path=/trunk/; revision=52840
This commit is contained in:
Jérôme Gardou 2011-07-24 16:45:41 +00:00
parent a96df8f6f2
commit 3989ede5bb
8 changed files with 17 additions and 18 deletions

View file

@ -1156,7 +1156,7 @@
@ cdecl asin(double) @ cdecl asin(double)
@ cdecl atan(double) @ cdecl atan(double)
@ cdecl atan2(double double) @ cdecl atan2(double double)
@ cdecl atexit(ptr) @ extern atexit # <-- keep this as an extern, thank you
@ cdecl atof(str) @ cdecl atof(str)
@ cdecl atoi(str) @ cdecl atoi(str)
@ cdecl atol(str) @ cdecl atol(str)

View file

@ -937,7 +937,7 @@
@ cdecl asin(double) @ cdecl asin(double)
@ cdecl atan(double) @ cdecl atan(double)
@ cdecl atan2(double double) @ cdecl atan2(double double)
@ cdecl atexit(ptr) @ extern atexit # <-- do not touch this!
@ cdecl atof(str) @ cdecl atof(str)
@ cdecl atoi(str) @ cdecl atoi(str)
@ cdecl atol(str) @ cdecl atol(str)

View file

@ -975,7 +975,7 @@
@ cdecl asin(double) @ cdecl asin(double)
@ cdecl atan(double) @ cdecl atan(double)
@ cdecl atan2(double double) @ cdecl atan2(double double)
@ cdecl atexit(ptr) @ extern atexit # <-- changing this will kill your cat, understand?
@ cdecl atof(str) @ cdecl atof(str)
@ cdecl atoi(str) @ cdecl atoi(str)
@ cdecl atol(str) @ cdecl atol(str)

View file

@ -71,8 +71,8 @@ extern _CRTALLOC(".CRT$XCZ") _PVFV __xc_z[];
/* TLS initialization hook. */ /* TLS initialization hook. */
extern const PIMAGE_TLS_CALLBACK __dyn_tls_init_callback; extern const PIMAGE_TLS_CALLBACK __dyn_tls_init_callback;
//extern _PVFV *__onexitbegin; extern _PVFV *__onexitbegin;
//extern _PVFV *__onexitend; extern _PVFV *__onexitend;
extern int mingw_app_type; extern int mingw_app_type;
@ -119,7 +119,7 @@ pre_c_init (void)
__set_app_type(_GUI_APP); __set_app_type(_GUI_APP);
else else
__set_app_type (_CONSOLE_APP); __set_app_type (_CONSOLE_APP);
// __onexitbegin = __onexitend = (_PVFV *) _encode_pointer ((_PVFV *)(-1)); __onexitbegin = __onexitend = (_PVFV *) _encode_pointer ((_PVFV *)(-1));
* __MINGW_IMP_SYMBOL(_fmode) = _fmode; * __MINGW_IMP_SYMBOL(_fmode) = _fmode;
* __MINGW_IMP_SYMBOL(_commode) = _commode; * __MINGW_IMP_SYMBOL(_commode) = _commode;

View file

@ -12,7 +12,7 @@
<include base="ReactOS">include/reactos/mingw-w64</include> <include base="ReactOS">include/reactos/mingw-w64</include>
<library>kernel32</library> <library>kernel32</library>
<file>_newmode.c</file> <file>_newmode.c</file>
<!--file>atonexit.c</file--> <file>atonexit.c</file>
<file>binmode.c</file> <file>binmode.c</file>
<file>charmax.c</file> <file>charmax.c</file>
<file>cinitexe.c</file> <file>cinitexe.c</file>

View file

@ -17,7 +17,7 @@ list(APPEND MSVCRTEX_SOURCE
startup/natstart.c startup/natstart.c
startup/charmax.c startup/charmax.c
startup/merr.c startup/merr.c
# startup/atonexit.c startup/atonexit.c
startup/txtmode.c startup/txtmode.c
startup/pesect.c startup/pesect.c
startup/tlsmcrt.c startup/tlsmcrt.c

View file

@ -49,8 +49,8 @@ extern const PIMAGE_TLS_CALLBACK __dyn_tls_init_callback;
static int __proc_attached = 0; static int __proc_attached = 0;
//extern _PVFV *__onexitbegin; extern _PVFV *__onexitbegin;
//extern _PVFV *__onexitend; extern _PVFV *__onexitend;
extern int mingw_app_type; extern int mingw_app_type;
@ -65,7 +65,7 @@ _CRTALLOC(".CRT$XIAA") _PIFV pcinit = pre_c_init;
static int static int
pre_c_init (void) pre_c_init (void)
{ {
/* _PVFV *onexitbegin; _PVFV *onexitbegin;
onexitbegin = (_PVFV *) malloc (32 * sizeof (_PVFV)); onexitbegin = (_PVFV *) malloc (32 * sizeof (_PVFV));
__onexitend = __onexitbegin = (_PVFV *) _encode_pointer (onexitbegin); __onexitend = __onexitbegin = (_PVFV *) _encode_pointer (onexitbegin);
@ -73,8 +73,7 @@ pre_c_init (void)
if (onexitbegin == NULL) if (onexitbegin == NULL)
return 1; return 1;
*onexitbegin = (_PVFV) NULL; *onexitbegin = (_PVFV) NULL;
return 0;*/ return 0;
return 1;
} }
WINBOOL WINAPI _CRT_INIT (HANDLE hDllHandle, DWORD dwReason, LPVOID lpreserved) WINBOOL WINAPI _CRT_INIT (HANDLE hDllHandle, DWORD dwReason, LPVOID lpreserved)
@ -136,7 +135,7 @@ WINBOOL WINAPI _CRT_INIT (HANDLE hDllHandle, DWORD dwReason, LPVOID lpreserved)
_amsg_exit (31); _amsg_exit (31);
} }
else else
{/* {
_PVFV * onexitbegin = (_PVFV *) _decode_pointer (__onexitbegin); _PVFV * onexitbegin = (_PVFV *) _decode_pointer (__onexitbegin);
if (onexitbegin) if (onexitbegin)
{ {
@ -146,7 +145,7 @@ WINBOOL WINAPI _CRT_INIT (HANDLE hDllHandle, DWORD dwReason, LPVOID lpreserved)
(**onexitend) (); (**onexitend) ();
free (onexitbegin); free (onexitbegin);
__onexitbegin = __onexitend = (_PVFV *) NULL; __onexitbegin = __onexitend = (_PVFV *) NULL;
}*/ }
__native_startup_state = __uninitialized; __native_startup_state = __uninitialized;
(void) InterlockedExchangePointer ((volatile PVOID *) &__native_startup_lock, 0); (void) InterlockedExchangePointer ((volatile PVOID *) &__native_startup_lock, 0);
} }

View file

@ -75,8 +75,8 @@ extern _CRTALLOC(".CRT$XCZ") _PVFV __xc_z[];
/* TLS initialization hook. */ /* TLS initialization hook. */
extern const PIMAGE_TLS_CALLBACK __dyn_tls_init_callback; extern const PIMAGE_TLS_CALLBACK __dyn_tls_init_callback;
//extern _PVFV *__onexitbegin; extern _PVFV *__onexitbegin;
//extern _PVFV *__onexitend; extern _PVFV *__onexitend;
extern int mingw_app_type; extern int mingw_app_type;
@ -128,7 +128,7 @@ pre_c_init (void)
__set_app_type(_GUI_APP); __set_app_type(_GUI_APP);
else else
__set_app_type (_CONSOLE_APP); __set_app_type (_CONSOLE_APP);
// __onexitbegin = __onexitend = (_PVFV *) _encode_pointer ((_PVFV *)(-1)); __onexitbegin = __onexitend = (_PVFV *) _encode_pointer ((_PVFV *)(-1));
* __MINGW_IMP_SYMBOL(_fmode) = _fmode; * __MINGW_IMP_SYMBOL(_fmode) = _fmode;
* __MINGW_IMP_SYMBOL(_commode) = _commode; * __MINGW_IMP_SYMBOL(_commode) = _commode;