diff options
Diffstat (limited to 'src/microhttpd/daemon.c')
-rw-r--r-- | src/microhttpd/daemon.c | 15 |
1 files changed, 5 insertions, 10 deletions
diff --git a/src/microhttpd/daemon.c b/src/microhttpd/daemon.c index 66453094..0816a4a9 100644 --- a/src/microhttpd/daemon.c +++ b/src/microhttpd/daemon.c | |||
@@ -37,6 +37,7 @@ | |||
37 | #include "connection.h" | 37 | #include "connection.h" |
38 | #include "memorypool.h" | 38 | #include "memorypool.h" |
39 | #include <limits.h> | 39 | #include <limits.h> |
40 | #include "autoinit_funcs.h" | ||
40 | 41 | ||
41 | #if HAVE_SEARCH_H | 42 | #if HAVE_SEARCH_H |
42 | #include <search.h> | 43 | #include <search.h> |
@@ -4538,14 +4539,6 @@ MHD_is_feature_supported(enum MHD_FEATURE feature) | |||
4538 | } | 4539 | } |
4539 | 4540 | ||
4540 | 4541 | ||
4541 | #ifdef __GNUC__ | ||
4542 | #define FUNC_CONSTRUCTOR(f) static void __attribute__ ((constructor)) f | ||
4543 | #define FUNC_DESTRUCTOR(f) static void __attribute__ ((destructor)) f | ||
4544 | #else // !__GNUC__ | ||
4545 | #define FUNC_CONSTRUCTOR(f) _MHD_EXTERN void f | ||
4546 | #define FUNC_DESTRUCTOR(f) _MHD_EXTERN void f | ||
4547 | #endif // __GNUC__ | ||
4548 | |||
4549 | #if HTTPS_SUPPORT && GCRYPT_VERSION_NUMBER < 0x010600 | 4542 | #if HTTPS_SUPPORT && GCRYPT_VERSION_NUMBER < 0x010600 |
4550 | #if defined(MHD_USE_POSIX_THREADS) | 4543 | #if defined(MHD_USE_POSIX_THREADS) |
4551 | GCRY_THREAD_OPTION_PTHREAD_IMPL; | 4544 | GCRY_THREAD_OPTION_PTHREAD_IMPL; |
@@ -4587,7 +4580,7 @@ static struct gcry_thread_cbs gcry_threads_w32 = { | |||
4587 | /** | 4580 | /** |
4588 | * Initialize do setup work. | 4581 | * Initialize do setup work. |
4589 | */ | 4582 | */ |
4590 | FUNC_CONSTRUCTOR (MHD_init) () | 4583 | void MHD_init(void) |
4591 | { | 4584 | { |
4592 | mhd_panic = &mhd_panic_std; | 4585 | mhd_panic = &mhd_panic_std; |
4593 | mhd_panic_cls = NULL; | 4586 | mhd_panic_cls = NULL; |
@@ -4619,7 +4612,7 @@ FUNC_CONSTRUCTOR (MHD_init) () | |||
4619 | } | 4612 | } |
4620 | 4613 | ||
4621 | 4614 | ||
4622 | FUNC_DESTRUCTOR (MHD_fini) () | 4615 | void MHD_fini(void) |
4623 | { | 4616 | { |
4624 | #if HTTPS_SUPPORT | 4617 | #if HTTPS_SUPPORT |
4625 | gnutls_global_deinit (); | 4618 | gnutls_global_deinit (); |
@@ -4630,5 +4623,7 @@ FUNC_DESTRUCTOR (MHD_fini) () | |||
4630 | #endif | 4623 | #endif |
4631 | } | 4624 | } |
4632 | 4625 | ||
4626 | _SET_INIT_AND_DEINIT_FUNCS(MHD_init, MHD_fini); | ||
4627 | |||
4633 | /* end of daemon.c */ | 4628 | /* end of daemon.c */ |
4634 | 4629 | ||