diff options
Diffstat (limited to 'src/microhttpd/mhd_locks.h')
-rw-r--r-- | src/microhttpd/mhd_locks.h | 19 |
1 files changed, 10 insertions, 9 deletions
diff --git a/src/microhttpd/mhd_locks.h b/src/microhttpd/mhd_locks.h index 654ecb6c..ad9fa20e 100644 --- a/src/microhttpd/mhd_locks.h +++ b/src/microhttpd/mhd_locks.h | |||
@@ -62,10 +62,11 @@ | |||
62 | # include <stdlib.h> | 62 | # include <stdlib.h> |
63 | # endif /* HAVE_STDLIB_H */ | 63 | # endif /* HAVE_STDLIB_H */ |
64 | /* Simple implementation of MHD_PANIC, to be used outside lib */ | 64 | /* Simple implementation of MHD_PANIC, to be used outside lib */ |
65 | # define MHD_PANIC(msg) do { fprintf (stderr, \ | 65 | # define MHD_PANIC(msg) \ |
66 | "Abnormal termination at %d line in file %s: %s\n", \ | 66 | do { fprintf (stderr, \ |
67 | (int) __LINE__, __FILE__, msg); abort (); \ | 67 | "Abnormal termination at %d line in file %s: %s\n", \ |
68 | } while (0) | 68 | (int) __LINE__, __FILE__, msg); abort (); \ |
69 | } while (0) | ||
69 | #endif /* ! MHD_PANIC */ | 70 | #endif /* ! MHD_PANIC */ |
70 | 71 | ||
71 | #if defined(MHD_PTHREAD_MUTEX_) | 72 | #if defined(MHD_PTHREAD_MUTEX_) |
@@ -87,8 +88,8 @@ typedef CRITICAL_SECTION MHD_mutex_; | |||
87 | * @param pmutex pointer to mutex | 88 | * @param pmutex pointer to mutex |
88 | * @return nonzero on success, zero otherwise | 89 | * @return nonzero on success, zero otherwise |
89 | */ | 90 | */ |
90 | #define MHD_mutex_init_(pmutex) (InitializeCriticalSectionAndSpinCount ( \ | 91 | #define MHD_mutex_init_(pmutex) \ |
91 | (pmutex),16)) | 92 | (InitializeCriticalSectionAndSpinCount ((pmutex),16)) |
92 | #endif | 93 | #endif |
93 | 94 | ||
94 | #if defined(MHD_PTHREAD_MUTEX_) | 95 | #if defined(MHD_PTHREAD_MUTEX_) |
@@ -96,8 +97,8 @@ typedef CRITICAL_SECTION MHD_mutex_; | |||
96 | /** | 97 | /** |
97 | * Define static mutex and statically initialise it. | 98 | * Define static mutex and statically initialise it. |
98 | */ | 99 | */ |
99 | # define MHD_MUTEX_STATIC_DEFN_INIT_(m) static MHD_mutex_ m = \ | 100 | # define MHD_MUTEX_STATIC_DEFN_INIT_(m) \ |
100 | PTHREAD_MUTEX_INITIALIZER | 101 | static MHD_mutex_ m = PTHREAD_MUTEX_INITIALIZER |
101 | # endif /* PTHREAD_MUTEX_INITIALIZER */ | 102 | # endif /* PTHREAD_MUTEX_INITIALIZER */ |
102 | #endif | 103 | #endif |
103 | 104 | ||
@@ -125,7 +126,7 @@ typedef CRITICAL_SECTION MHD_mutex_; | |||
125 | #define MHD_mutex_destroy_chk_(pmutex) do { \ | 126 | #define MHD_mutex_destroy_chk_(pmutex) do { \ |
126 | if (! MHD_mutex_destroy_ (pmutex)) \ | 127 | if (! MHD_mutex_destroy_ (pmutex)) \ |
127 | MHD_PANIC (_ ("Failed to destroy mutex.\n")); \ | 128 | MHD_PANIC (_ ("Failed to destroy mutex.\n")); \ |
128 | } while (0) | 129 | } while (0) |
129 | 130 | ||
130 | 131 | ||
131 | #if defined(MHD_PTHREAD_MUTEX_) | 132 | #if defined(MHD_PTHREAD_MUTEX_) |