init: Only use constructor attribute if available

Signed-off-by: Andreas Schneider <asn@cryptomilk.org>
(cherry picked from commit f2b6899298)
This commit is contained in:
Andreas Schneider
2018-08-13 09:21:39 +02:00
parent 120f11812d
commit c42410b560

View File

@@ -32,8 +32,17 @@
#include <winsock2.h>
#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;