diff options
Diffstat (limited to 'src/microhttpd/internal.h')
-rw-r--r-- | src/microhttpd/internal.h | 45 |
1 files changed, 2 insertions, 43 deletions
diff --git a/src/microhttpd/internal.h b/src/microhttpd/internal.h index 3c1a889d..277510d8 100644 --- a/src/microhttpd/internal.h +++ b/src/microhttpd/internal.h | |||
@@ -53,28 +53,8 @@ | |||
53 | #define PRIu64 "llu" | 53 | #define PRIu64 "llu" |
54 | #endif /* ! PRIu64 */ | 54 | #endif /* ! PRIu64 */ |
55 | 55 | ||
56 | #ifdef MHD_PANIC | 56 | /* Must be included before other internal headers! */ |
57 | /* Override any defined MHD_PANIC macro with proper one */ | 57 | #include "mhd_panic.h" |
58 | #undef MHD_PANIC | ||
59 | #endif /* MHD_PANIC */ | ||
60 | |||
61 | #ifdef HAVE_MESSAGES | ||
62 | /** | ||
63 | * Trigger 'panic' action based on fatal errors. | ||
64 | * | ||
65 | * @param msg error message (const char *) | ||
66 | */ | ||
67 | #define MHD_PANIC(msg) do { mhd_panic (mhd_panic_cls, __FILE__, __LINE__, msg); \ | ||
68 | BUILTIN_NOT_REACHED; } while (0) | ||
69 | #else | ||
70 | /** | ||
71 | * Trigger 'panic' action based on fatal errors. | ||
72 | * | ||
73 | * @param msg error message (const char *) | ||
74 | */ | ||
75 | #define MHD_PANIC(msg) do { mhd_panic (mhd_panic_cls, __FILE__, __LINE__, NULL); \ | ||
76 | BUILTIN_NOT_REACHED; } while (0) | ||
77 | #endif | ||
78 | 58 | ||
79 | #if defined(MHD_USE_POSIX_THREADS) || defined(MHD_USE_W32_THREADS) | 59 | #if defined(MHD_USE_POSIX_THREADS) || defined(MHD_USE_W32_THREADS) |
80 | #include "mhd_threads.h" | 60 | #include "mhd_threads.h" |
@@ -147,27 +127,6 @@ | |||
147 | */ | 127 | */ |
148 | #define MHD_BUF_INC_SIZE 1024 | 128 | #define MHD_BUF_INC_SIZE 1024 |
149 | 129 | ||
150 | |||
151 | /** | ||
152 | * Handler for fatal errors. | ||
153 | */ | ||
154 | extern MHD_PanicCallback mhd_panic; | ||
155 | |||
156 | /** | ||
157 | * Closure argument for "mhd_panic". | ||
158 | */ | ||
159 | extern void *mhd_panic_cls; | ||
160 | |||
161 | /* If we have Clang or gcc >= 4.5, use __builtin_unreachable() */ | ||
162 | #if defined(__clang__) || (__GNUC__ > 4) || \ | ||
163 | (__GNUC__ == 4 && __GNUC_MINOR__ >= 5) | ||
164 | #define BUILTIN_NOT_REACHED __builtin_unreachable () | ||
165 | #elif defined(_MSC_FULL_VER) | ||
166 | #define BUILTIN_NOT_REACHED __assume (0) | ||
167 | #else | ||
168 | #define BUILTIN_NOT_REACHED | ||
169 | #endif | ||
170 | |||
171 | #ifndef MHD_STATICSTR_LEN_ | 130 | #ifndef MHD_STATICSTR_LEN_ |
172 | /** | 131 | /** |
173 | * Determine length of static string / macro strings at compile time. | 132 | * Determine length of static string / macro strings at compile time. |