]> git.ipfire.org Git - thirdparty/samba.git/commitdiff
talloc: alternatively use prama init for constructors if supported
authorBjörn Jacke <bj@sernet.de>
Fri, 30 Oct 2020 11:57:42 +0000 (12:57 +0100)
committerAndrew Bartlett <abartlet@samba.org>
Tue, 10 Nov 2020 06:53:43 +0000 (06:53 +0000)
Signed-off-by: Bjoern Jacke <bjacke@samba.org>
Reviewed-by: Andrew Bartlett <abartlet@samba.org>
lib/talloc/talloc.c

index 078e58ca352397e6ec4357d5a2785ce4dab463b7..ef49429307a1940cf134752301d5da754c0358f2 100644 (file)
@@ -392,7 +392,13 @@ _PUBLIC_ void talloc_set_log_fn(void (*log_fn)(const char *message))
 }
 
 #ifdef HAVE_CONSTRUCTOR_ATTRIBUTE
-void talloc_lib_init(void) __attribute__((constructor));
+#define CONSTRUCTOR __attribute__((constructor))
+#elif defined(HAVE_PRAGMA_INIT)
+#define CONSTRUCTOR
+#pragma init (talloc_lib_init)
+#endif
+#if defined(HAVE_CONSTRUCTOR_ATTRIBUTE) || defined(HAVE_PRAGMA_INIT)
+void talloc_lib_init(void) CONSTRUCTOR;
 void talloc_lib_init(void)
 {
        uint32_t random_value;