summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--src/socket_wrapper.c7
-rw-r--r--tests/thread_deadlock.c5
2 files changed, 11 insertions, 1 deletions
diff --git a/src/socket_wrapper.c b/src/socket_wrapper.c
index ffdd31a..35d61b5 100644
--- a/src/socket_wrapper.c
+++ b/src/socket_wrapper.c
@@ -334,7 +334,14 @@ static pthread_mutex_t mtu_update_mutex;
bool socket_wrapper_enabled(void);
+#if ! defined(HAVE_CONSTRUCTOR_ATTRIBUTE) && defined(HAVE_PRAGMA_INIT)
+/* xlC and other oldschool compilers support (only) this */
+#pragma init (swrap_constructor)
+#endif
void swrap_constructor(void) CONSTRUCTOR_ATTRIBUTE;
+#if ! defined(HAVE_DESTRUCTOR_ATTRIBUTE) && defined(HAVE_PRAGMA_FINI)
+#pragma fini (swrap_destructor)
+#endif
void swrap_destructor(void) DESTRUCTOR_ATTRIBUTE;
#ifndef HAVE_GETPROGNAME
diff --git a/tests/thread_deadlock.c b/tests/thread_deadlock.c
index b72367f..6c58af3 100644
--- a/tests/thread_deadlock.c
+++ b/tests/thread_deadlock.c
@@ -43,7 +43,10 @@
#else
#define CONSTRUCTOR_ATTRIBUTE
#endif /* HAVE_CONSTRUCTOR_ATTRIBUTE */
-
+#if ! defined(HAVE_CONSTRUCTOR_ATTRIBUTE) && defined(HAVE_PRAGMA_INIT)
+/* xlC and other oldschool compilers support (only) this */
+#pragma init (thread_deadlock_constructor)
+#endif
void thread_deadlock_constructor(void) CONSTRUCTOR_ATTRIBUTE;
static void thread_deadlock_prepare(void)