Alexandre Julliard : Get rid of the no longer needed
DECL_GLOBAL_CONSTRUCTOR macro.
Alexandre Julliard
julliard at wine.codeweavers.com
Sat Jan 14 10:56:34 CST 2006
Module: wine
Branch: refs/heads/master
Commit: cfe45cc130d70cfe037e012e4e4d475cdb87a681
URL: http://source.winehq.org/git/?p=wine.git;a=commit;h=cfe45cc130d70cfe037e012e4e4d475cdb87a681
Author: Alexandre Julliard <julliard at winehq.org>
Date: Sat Jan 14 17:08:52 2006 +0100
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 238c696..10be8ce 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 ddc9bb3..e27eb2e 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 =
{
More information about the wine-cvs
mailing list