From f6a363bc4108f3d45b7a5bac706d10579f4d2772 Mon Sep 17 00:00:00 2001 From: Alexandre Julliard Date: Tue, 21 Apr 2020 11:28:03 +0200 Subject: [PATCH] winecrt0: Get rid of constructor support. Signed-off-by: Alexandre Julliard --- dlls/winecrt0/Makefile.in | 2 -- dlls/winecrt0/crt0_private.h | 41 ------------------------------ dlls/winecrt0/dll_entry.c | 49 ------------------------------------ dlls/winecrt0/init.c | 46 --------------------------------- 4 files changed, 138 deletions(-) delete mode 100644 dlls/winecrt0/crt0_private.h delete mode 100644 dlls/winecrt0/dll_entry.c delete mode 100644 dlls/winecrt0/init.c diff --git a/dlls/winecrt0/Makefile.in b/dlls/winecrt0/Makefile.in index 909959dcb68..bcbd4e3b556 100644 --- a/dlls/winecrt0/Makefile.in +++ b/dlls/winecrt0/Makefile.in @@ -4,7 +4,6 @@ C_SRCS = \ crt_dllmain.c \ debug.c \ delay_load.c \ - dll_entry.c \ dll_main.c \ exception.c \ exe16_entry.c \ @@ -12,6 +11,5 @@ C_SRCS = \ exe_main.c \ exe_wentry.c \ exe_wmain.c \ - init.c \ register.c \ stub.c diff --git a/dlls/winecrt0/crt0_private.h b/dlls/winecrt0/crt0_private.h deleted file mode 100644 index b2c902e6bb7..00000000000 --- a/dlls/winecrt0/crt0_private.h +++ /dev/null @@ -1,41 +0,0 @@ -/* - * crt0 library private definitions - * - * Copyright 2005 Alexandre Julliard - * - * This library is free software; you can redistribute it and/or - * modify it under the terms of the GNU Lesser General Public - * License as published by the Free Software Foundation; either - * version 2.1 of the License, or (at your option) any later version. - * - * This library is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - * Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public - * License along with this library; if not, write to the Free Software - * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA - */ - -#ifndef __WINE_CRT0_PRIVATE_H__ -#define __WINE_CRT0_PRIVATE_H__ - -#if defined(__APPLE__) || defined(__ANDROID__) -static inline void _init(int argc, char **argv, char **envp ) { /* nothing */ } -static inline void _fini(void) { /* nothing */ } -#else -extern void _init(int argc, char **argv, char **envp ) DECLSPEC_HIDDEN; -extern void _fini(void) DECLSPEC_HIDDEN; -#endif - -enum init_state -{ - NO_INIT_DONE, /* no initialization done yet */ - DLL_REGISTERED, /* the dll has been registered */ - CONSTRUCTORS_DONE /* the constructors have been run (implies dll registered too) */ -}; - -extern enum init_state __wine_spec_init_state DECLSPEC_HIDDEN; - -#endif /* __WINE_CRT0_PRIVATE_H__ */ diff --git a/dlls/winecrt0/dll_entry.c b/dlls/winecrt0/dll_entry.c deleted file mode 100644 index 92bd0695296..00000000000 --- a/dlls/winecrt0/dll_entry.c +++ /dev/null @@ -1,49 +0,0 @@ -/* - * Default entry point for a dll - * - * Copyright 2005 Alexandre Julliard - * - * This library is free software; you can redistribute it and/or - * modify it under the terms of the GNU Lesser General Public - * License as published by the Free Software Foundation; either - * version 2.1 of the License, or (at your option) any later version. - * - * This library is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - * Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public - * License along with this library; if not, write to the Free Software - * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA - */ - -#if 0 -#pragma makedep unix -#endif - -#include -#include "windef.h" -#include "winbase.h" -#include "wine/library.h" -#include "crt0_private.h" - -extern BOOL WINAPI DECLSPEC_HIDDEN DllMain( HINSTANCE inst, DWORD reason, LPVOID reserved ); - -BOOL WINAPI DECLSPEC_HIDDEN __wine_spec_dll_entry( HINSTANCE inst, DWORD reason, LPVOID reserved ) -{ - static BOOL call_fini; - BOOL ret; - - if (reason == DLL_PROCESS_ATTACH && __wine_spec_init_state != CONSTRUCTORS_DONE) - { - call_fini = TRUE; - _init( 0, NULL, NULL ); - } - - ret = DllMain( inst, reason, reserved ); - - if (reason == DLL_PROCESS_DETACH && call_fini) _fini(); - - return ret; -} diff --git a/dlls/winecrt0/init.c b/dlls/winecrt0/init.c deleted file mode 100644 index 2ffe8e564c0..00000000000 --- a/dlls/winecrt0/init.c +++ /dev/null @@ -1,46 +0,0 @@ -/* - * Initialization code for spec files - * - * Copyright 2005 Alexandre Julliard - * - * This library is free software; you can redistribute it and/or - * modify it under the terms of the GNU Lesser General Public - * License as published by the Free Software Foundation; either - * version 2.1 of the License, or (at your option) any later version. - * - * This library is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - * Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public - * License along with this library; if not, write to the Free Software - * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA - */ - -#if 0 -#pragma makedep unix -#endif - -#include -#include "windef.h" -#include "winbase.h" -#include "wine/library.h" -#include "crt0_private.h" - -enum init_state __wine_spec_init_state = NO_INIT_DONE; - -extern const IMAGE_NT_HEADERS __wine_spec_nt_header; -extern const char __wine_spec_file_name[]; - -void DECLSPEC_HIDDEN __wine_spec_init(void) -{ - __wine_spec_init_state = DLL_REGISTERED; - __wine_dll_register( &__wine_spec_nt_header, __wine_spec_file_name ); -} - -void DECLSPEC_HIDDEN __wine_spec_init_ctor(void) -{ - if (__wine_spec_init_state == NO_INIT_DONE) __wine_spec_init(); - __wine_spec_init_state = CONSTRUCTORS_DONE; -}