summaryrefslogtreecommitdiffstats
path: root/tests
diff options
context:
space:
mode:
authorBjörn Jacke <bjacke@samba.org>2020-10-30 15:44:53 +0100
committerAndreas Schneider <asn@samba.org>2020-11-04 16:39:54 +0100
commite0af87fff246887aacab8c94c3cf4dca2a28a94c (patch)
treef15823c230f4883ceb9f3848536c33ec72037914 /tests
parent83a4c3c3c53c6ab171ee786ba7c9f509d73f36fd (diff)
downloadsocket_wrapper-e0af87fff246887aacab8c94c3cf4dca2a28a94c.tar.gz
socket_wrapper-e0af87fff246887aacab8c94c3cf4dca2a28a94c.tar.xz
socket_wrapper-e0af87fff246887aacab8c94c3cf4dca2a28a94c.zip
socket_wrapper.c/tests: fall back to pragma init/fini for constructor/destructor if possible
Signed-off-by: Bjoern Jacke <bjacke@samba.org> Reviewed-by: Andreas Schneider <asn@samba.org>
Diffstat (limited to 'tests')
-rw-r--r--tests/thread_deadlock.c5
1 files changed, 4 insertions, 1 deletions
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)