mirror of
https://git.libssh.org/projects/libssh.git
synced 2025-11-27 13:21:11 +03:00
init: Only use constructor attribute if available
Signed-off-by: Andreas Schneider <asn@cryptomilk.org>
This commit is contained in:
@@ -32,8 +32,17 @@
|
|||||||
#include <winsock2.h>
|
#include <winsock2.h>
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
#ifdef HAVE_CONSTRUCTOR_ATTRIBUTE
|
||||||
#define CONSTRUCTOR_ATTRIBUTE __attribute__((constructor))
|
#define CONSTRUCTOR_ATTRIBUTE __attribute__((constructor))
|
||||||
|
#else
|
||||||
|
#define CONSTRUCTOR_ATTRIBUTE
|
||||||
|
#endif /* HAVE_CONSTRUCTOR_ATTRIBUTE */
|
||||||
|
|
||||||
|
#ifdef HAVE_DESTRUCTOR_ATTRIBUTE
|
||||||
#define DESTRUCTOR_ATTRIBUTE __attribute__((destructor))
|
#define DESTRUCTOR_ATTRIBUTE __attribute__((destructor))
|
||||||
|
#else
|
||||||
|
#define DESTRUCTOR_ATTRIBUTE
|
||||||
|
#endif /* HAVE_DESTRUCTOR_ATTRIBUTE */
|
||||||
|
|
||||||
/* Declare static mutex */
|
/* Declare static mutex */
|
||||||
static SSH_MUTEX ssh_init_mutex = SSH_MUTEX_STATIC_INIT;
|
static SSH_MUTEX ssh_init_mutex = SSH_MUTEX_STATIC_INIT;
|
||||||
|
|||||||
Reference in New Issue
Block a user