Make all winecrt0 functions and variables hidden.

This commit is contained in:
Alexandre Julliard 2005-10-30 19:10:35 +00:00
parent 49c46e9d3d
commit 220f2ce9fb
10 changed files with 31 additions and 13 deletions

View File

@ -25,8 +25,8 @@
static inline void _init(int argc, char **argv, char **envp ) { /* nothing */ } static inline void _init(int argc, char **argv, char **envp ) { /* nothing */ }
static inline void _fini(void) { /* nothing */ } static inline void _fini(void) { /* nothing */ }
#else #else
extern void _init(int argc, char **argv, char **envp ); extern void _init(int argc, char **argv, char **envp ) DECLSPEC_HIDDEN;
extern void _fini(void); extern void _fini(void) DECLSPEC_HIDDEN;
#endif #endif
enum init_state enum init_state
@ -36,6 +36,6 @@ enum init_state
CONSTRUCTORS_DONE /* the constructors have been run (implies dll registered too) */ CONSTRUCTORS_DONE /* the constructors have been run (implies dll registered too) */
}; };
extern enum init_state __wine_spec_init_state; extern enum init_state __wine_spec_init_state DECLSPEC_HIDDEN;
#endif /* __WINE_CRT0_PRIVATE_H__ */ #endif /* __WINE_CRT0_PRIVATE_H__ */

View File

@ -38,7 +38,7 @@ extern struct ImgDelayDescr __wine_spec_delay_imports[];
extern FARPROC WINAPI DelayLoadFailureHook( LPCSTR name, LPCSTR function ); extern FARPROC WINAPI DelayLoadFailureHook( LPCSTR name, LPCSTR function );
FARPROC WINAPI __wine_spec_delay_load( unsigned int id ) FARPROC WINAPI DECLSPEC_HIDDEN __wine_spec_delay_load( unsigned int id )
{ {
struct ImgDelayDescr *descr = __wine_spec_delay_imports + HIWORD(id); struct ImgDelayDescr *descr = __wine_spec_delay_imports + HIWORD(id);
WORD func = LOWORD(id); WORD func = LOWORD(id);

View File

@ -24,9 +24,9 @@
#include "wine/library.h" #include "wine/library.h"
#include "crt0_private.h" #include "crt0_private.h"
extern BOOL WINAPI DllMain( HINSTANCE inst, DWORD reason, LPVOID reserved ); extern BOOL WINAPI DECLSPEC_HIDDEN DllMain( HINSTANCE inst, DWORD reason, LPVOID reserved );
BOOL WINAPI __wine_spec_dll_entry( HINSTANCE inst, DWORD reason, LPVOID reserved ) BOOL WINAPI DECLSPEC_HIDDEN __wine_spec_dll_entry( HINSTANCE inst, DWORD reason, LPVOID reserved )
{ {
static BOOL call_fini; static BOOL call_fini;
BOOL ret; BOOL ret;

View File

@ -22,7 +22,7 @@
#include "windef.h" #include "windef.h"
#include "winbase.h" #include "winbase.h"
BOOL WINAPI DllMain( HINSTANCE inst, DWORD reason, LPVOID reserved ) BOOL WINAPI DECLSPEC_HIDDEN DllMain( HINSTANCE inst, DWORD reason, LPVOID reserved )
{ {
if (reason == DLL_PROCESS_ATTACH) DisableThreadLibraryCalls( inst ); if (reason == DLL_PROCESS_ATTACH) DisableThreadLibraryCalls( inst );
return TRUE; return TRUE;

View File

@ -27,7 +27,7 @@
struct _DRIVER_OBJECT; struct _DRIVER_OBJECT;
extern NTSTATUS DriverEntry( struct _DRIVER_OBJECT *obj, UNICODE_STRING *path ); extern NTSTATUS DriverEntry( struct _DRIVER_OBJECT *obj, UNICODE_STRING *path );
NTSTATUS __wine_spec_drv_entry( struct _DRIVER_OBJECT *obj, UNICODE_STRING *path ) NTSTATUS DECLSPEC_HIDDEN __wine_spec_drv_entry( struct _DRIVER_OBJECT *obj, UNICODE_STRING *path )
{ {
BOOL needs_init = (__wine_spec_init_state != CONSTRUCTORS_DONE); BOOL needs_init = (__wine_spec_init_state != CONSTRUCTORS_DONE);

View File

@ -27,7 +27,7 @@
extern int main( int argc, char *argv[] ); extern int main( int argc, char *argv[] );
DWORD WINAPI __wine_spec_exe_entry( PEB *peb ) DWORD WINAPI DECLSPEC_HIDDEN __wine_spec_exe_entry( PEB *peb )
{ {
BOOL needs_init = (__wine_spec_init_state != CONSTRUCTORS_DONE); BOOL needs_init = (__wine_spec_init_state != CONSTRUCTORS_DONE);
DWORD ret; DWORD ret;

View File

@ -27,7 +27,7 @@
extern int wmain( int argc, WCHAR *argv[] ); extern int wmain( int argc, WCHAR *argv[] );
DWORD WINAPI __wine_spec_exe_wentry( PEB *peb ) DWORD WINAPI DECLSPEC_HIDDEN __wine_spec_exe_wentry( PEB *peb )
{ {
BOOL needs_init = (__wine_spec_init_state != CONSTRUCTORS_DONE); BOOL needs_init = (__wine_spec_init_state != CONSTRUCTORS_DONE);
DWORD ret; DWORD ret;

View File

@ -29,13 +29,13 @@ enum init_state __wine_spec_init_state = NO_INIT_DONE;
extern const IMAGE_NT_HEADERS __wine_spec_nt_header; extern const IMAGE_NT_HEADERS __wine_spec_nt_header;
extern const char __wine_spec_file_name[]; extern const char __wine_spec_file_name[];
void __wine_spec_init(void) void DECLSPEC_HIDDEN __wine_spec_init(void)
{ {
__wine_spec_init_state = DLL_REGISTERED; __wine_spec_init_state = DLL_REGISTERED;
__wine_dll_register( &__wine_spec_nt_header, __wine_spec_file_name ); __wine_dll_register( &__wine_spec_nt_header, __wine_spec_file_name );
} }
void __wine_spec_init_ctor(void) void DECLSPEC_HIDDEN __wine_spec_init_ctor(void)
{ {
if (__wine_spec_init_state == NO_INIT_DONE) __wine_spec_init(); if (__wine_spec_init_state == NO_INIT_DONE) __wine_spec_init();
__wine_spec_init_state = CONSTRUCTORS_DONE; __wine_spec_init_state = CONSTRUCTORS_DONE;

View File

@ -23,7 +23,7 @@
#include "winbase.h" #include "winbase.h"
#include "wine/exception.h" #include "wine/exception.h"
void __wine_spec_unimplemented_stub( const char *module, const char *function ) void DECLSPEC_HIDDEN __wine_spec_unimplemented_stub( const char *module, const char *function )
{ {
ULONG_PTR args[2]; ULONG_PTR args[2];

View File

@ -130,6 +130,24 @@
# endif # endif
#endif #endif
/* a couple of useful Wine extensions */
#ifdef _MSC_VER
# define DECLSPEC_EXPORT __declspec(dllexport)
#elif defined(__MINGW32__)
# define DECLSPEC_EXPORT __attribute__((dllexport))
#elif defined(__GNUC__) && (__GNUC__ > 2)
# define DECLSPEC_EXPORT __attribute__((visibility ("default")))
#else
# define DECLSPEC_EXPORT
#endif
#if defined(__GNUC__) && (__GNUC__ > 2)
# define DECLSPEC_HIDDEN __attribute__((visibility ("hidden")))
#else
# define DECLSPEC_HIDDEN
#endif
/* Anonymous union/struct handling */ /* Anonymous union/struct handling */
#ifndef NONAMELESSSTRUCT #ifndef NONAMELESSSTRUCT