diff options
Diffstat (limited to 'src/lib/init.c')
-rw-r--r-- | src/lib/init.c | 40 |
1 files changed, 20 insertions, 20 deletions
diff --git a/src/lib/init.c b/src/lib/init.c index b23bdadf..5dcb02c4 100644 --- a/src/lib/init.c +++ b/src/lib/init.c | |||
@@ -36,7 +36,7 @@ volatile unsigned int global_init_count = 0; | |||
36 | /** | 36 | /** |
37 | * Global initialisation mutex | 37 | * Global initialisation mutex |
38 | */ | 38 | */ |
39 | MHD_MUTEX_STATIC_DEFN_INIT_(global_init_mutex_); | 39 | MHD_MUTEX_STATIC_DEFN_INIT_ (global_init_mutex_); |
40 | #endif /* MHD_MUTEX_STATIC_DEFN_INIT_ */ | 40 | #endif /* MHD_MUTEX_STATIC_DEFN_INIT_ */ |
41 | 41 | ||
42 | #endif | 42 | #endif |
@@ -59,21 +59,21 @@ static int mhd_winsock_inited_ = 0; | |||
59 | */ | 59 | */ |
60 | static void | 60 | static void |
61 | mhd_panic_std (void *cls, | 61 | mhd_panic_std (void *cls, |
62 | const char *file, | 62 | const char *file, |
63 | unsigned int line, | 63 | unsigned int line, |
64 | const char *reason) | 64 | const char *reason) |
65 | { | 65 | { |
66 | (void)cls; /* Mute compiler warning. */ | 66 | (void) cls; /* Mute compiler warning. */ |
67 | #ifdef HAVE_MESSAGES | 67 | #ifdef HAVE_MESSAGES |
68 | fprintf (stderr, | 68 | fprintf (stderr, |
69 | _("Fatal error in GNU libmicrohttpd %s:%u: %s\n"), | 69 | _ ("Fatal error in GNU libmicrohttpd %s:%u: %s\n"), |
70 | file, | 70 | file, |
71 | line, | 71 | line, |
72 | reason); | 72 | reason); |
73 | #else /* ! HAVE_MESSAGES */ | 73 | #else /* ! HAVE_MESSAGES */ |
74 | (void)file; /* Mute compiler warning. */ | 74 | (void) file; /* Mute compiler warning. */ |
75 | (void)line; /* Mute compiler warning. */ | 75 | (void) line; /* Mute compiler warning. */ |
76 | (void)reason; /* Mute compiler warning. */ | 76 | (void) reason; /* Mute compiler warning. */ |
77 | #endif | 77 | #endif |
78 | abort (); | 78 | abort (); |
79 | } | 79 | } |
@@ -93,13 +93,13 @@ MHD_init (void) | |||
93 | mhd_panic = &mhd_panic_std; | 93 | mhd_panic = &mhd_panic_std; |
94 | 94 | ||
95 | #if defined(_WIN32) && ! defined(__CYGWIN__) | 95 | #if defined(_WIN32) && ! defined(__CYGWIN__) |
96 | if (0 != WSAStartup (MAKEWORD(2, 2), | 96 | if (0 != WSAStartup (MAKEWORD (2, 2), |
97 | &wsd)) | 97 | &wsd)) |
98 | MHD_PANIC (_("Failed to initialize winsock\n")); | 98 | MHD_PANIC (_ ("Failed to initialize winsock\n")); |
99 | mhd_winsock_inited_ = 1; | 99 | mhd_winsock_inited_ = 1; |
100 | if ( (2 != LOBYTE(wsd.wVersion)) && | 100 | if ( (2 != LOBYTE (wsd.wVersion)) && |
101 | (2 != HIBYTE(wsd.wVersion)) ) | 101 | (2 != HIBYTE (wsd.wVersion)) ) |
102 | MHD_PANIC (_("Winsock version 2.2 is not available\n")); | 102 | MHD_PANIC (_ ("Winsock version 2.2 is not available\n")); |
103 | #endif | 103 | #endif |
104 | MHD_monotonic_sec_counter_init (); | 104 | MHD_monotonic_sec_counter_init (); |
105 | #ifdef HAVE_FREEBSD_SENDFILE | 105 | #ifdef HAVE_FREEBSD_SENDFILE |
@@ -116,14 +116,14 @@ MHD_fini (void) | |||
116 | { | 116 | { |
117 | #if defined(_WIN32) && ! defined(__CYGWIN__) | 117 | #if defined(_WIN32) && ! defined(__CYGWIN__) |
118 | if (mhd_winsock_inited_) | 118 | if (mhd_winsock_inited_) |
119 | WSACleanup(); | 119 | WSACleanup (); |
120 | #endif | 120 | #endif |
121 | MHD_monotonic_sec_counter_finish (); | 121 | MHD_monotonic_sec_counter_finish (); |
122 | } | 122 | } |
123 | 123 | ||
124 | #ifdef _AUTOINIT_FUNCS_ARE_SUPPORTED | 124 | #ifdef _AUTOINIT_FUNCS_ARE_SUPPORTED |
125 | 125 | ||
126 | _SET_INIT_AND_DEINIT_FUNCS(MHD_init, MHD_fini); | 126 | _SET_INIT_AND_DEINIT_FUNCS (MHD_init, MHD_fini); |
127 | 127 | ||
128 | #else | 128 | #else |
129 | 129 | ||
@@ -135,12 +135,12 @@ void | |||
135 | MHD_check_global_init_ (void) | 135 | MHD_check_global_init_ (void) |
136 | { | 136 | { |
137 | #ifdef MHD_MUTEX_STATIC_DEFN_INIT_ | 137 | #ifdef MHD_MUTEX_STATIC_DEFN_INIT_ |
138 | MHD_mutex_lock_chk_(&global_init_mutex_); | 138 | MHD_mutex_lock_chk_ (&global_init_mutex_); |
139 | #endif /* MHD_MUTEX_STATIC_DEFN_INIT_ */ | 139 | #endif /* MHD_MUTEX_STATIC_DEFN_INIT_ */ |
140 | if (0 == global_init_count++) | 140 | if (0 == global_init_count++) |
141 | MHD_init (); | 141 | MHD_init (); |
142 | #ifdef MHD_MUTEX_STATIC_DEFN_INIT_ | 142 | #ifdef MHD_MUTEX_STATIC_DEFN_INIT_ |
143 | MHD_mutex_unlock_chk_(&global_init_mutex_); | 143 | MHD_mutex_unlock_chk_ (&global_init_mutex_); |
144 | #endif /* MHD_MUTEX_STATIC_DEFN_INIT_ */ | 144 | #endif /* MHD_MUTEX_STATIC_DEFN_INIT_ */ |
145 | } | 145 | } |
146 | #endif | 146 | #endif |