From f2b6899298142ea30ee0e4f7c662e6d56d33c76f Mon Sep 17 00:00:00 2001 From: Andreas Schneider Date: Mon, 13 Aug 2018 09:21:39 +0200 Subject: [PATCH] init: Only use constructor attribute if available Signed-off-by: Andreas Schneider --- src/init.c | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/src/init.c b/src/init.c index f9422430..0d45917c 100644 --- a/src/init.c +++ b/src/init.c @@ -32,8 +32,17 @@ #include #endif +#ifdef HAVE_CONSTRUCTOR_ATTRIBUTE #define CONSTRUCTOR_ATTRIBUTE __attribute__((constructor)) +#else +#define CONSTRUCTOR_ATTRIBUTE +#endif /* HAVE_CONSTRUCTOR_ATTRIBUTE */ + +#ifdef HAVE_DESTRUCTOR_ATTRIBUTE #define DESTRUCTOR_ATTRIBUTE __attribute__((destructor)) +#else +#define DESTRUCTOR_ATTRIBUTE +#endif /* HAVE_DESTRUCTOR_ATTRIBUTE */ /* Declare static mutex */ static SSH_MUTEX ssh_init_mutex = SSH_MUTEX_STATIC_INIT;