From cfe45cc130d70cfe037e012e4e4d475cdb87a681 Mon Sep 17 00:00:00 2001 From: Alexandre Julliard Date: Sat, 14 Jan 2006 17:08:52 +0100 Subject: [PATCH] Get rid of the no longer needed DECL_GLOBAL_CONSTRUCTOR macro. --- include/wine/port.h | 26 -------------------------- loader/kthread.c | 9 ++++++++- 2 files changed, 8 insertions(+), 27 deletions(-) diff --git a/include/wine/port.h b/include/wine/port.h index 238c6965ab7..10be8ce2489 100644 --- a/include/wine/port.h +++ b/include/wine/port.h @@ -210,32 +210,6 @@ struct statvfs #endif /* __GNUC__ */ -/* Constructor functions */ - -#ifdef __GNUC__ -# define DECL_GLOBAL_CONSTRUCTOR(func) \ - static void func(void) __attribute__((constructor)); \ - static void func(void) -#elif defined(__i386__) -# define DECL_GLOBAL_CONSTRUCTOR(func) \ - static void __dummy_init_##func(void) { \ - asm(".section .init,\"ax\"\n\t" \ - "call " #func "\n\t" \ - ".previous"); } \ - static void func(void) -#elif defined(__sparc__) -# define DECL_GLOBAL_CONSTRUCTOR(func) \ - static void __dummy_init_##func(void) { \ - asm("\t.section \".init\",#alloc,#execinstr\n" \ - "\tcall " #func "\n" \ - "\tnop\n" \ - "\t.section \".text\",#alloc,#execinstr\n" ); } \ - static void func(void) -#else -# error You must define the DECL_GLOBAL_CONSTRUCTOR macro for your platform -#endif - - /* Register functions */ #ifdef __i386__ diff --git a/loader/kthread.c b/loader/kthread.c index ddc9bb348a2..e27eb2ee829 100644 --- a/loader/kthread.c +++ b/loader/kthread.c @@ -974,7 +974,14 @@ void __pthread_initialize(void) if (libc_pthread_init) libc_multiple_threads = libc_pthread_init( &libc_pthread_functions ); } } -DECL_GLOBAL_CONSTRUCTOR(init) { __pthread_initialize(); } + +#ifdef __GNUC__ +static void init(void) __attribute__((constructor)); +static void init(void) +{ + __pthread_initialize(); +} +#endif static struct pthread_functions libc_pthread_functions = {