aboutsummaryrefslogtreecommitdiff
path: root/src/microhttpd/internal.h
diff options
context:
space:
mode:
authorEvgeny Grin (Karlson2k) <k2k@narod.ru>2016-10-11 15:20:40 +0000
committerEvgeny Grin (Karlson2k) <k2k@narod.ru>2016-10-11 15:20:40 +0000
commita8948d201be986112a2a616b2ff30e58e8a8f08f (patch)
treecf8211f0691aa1a1f6f40b6e051b5be6ddd9dfae /src/microhttpd/internal.h
parent3675d8e5a77e91147a14da7bdbbdcc9fe6a3b5d6 (diff)
downloadlibmicrohttpd-a8948d201be986112a2a616b2ff30e58e8a8f08f.tar.gz
libmicrohttpd-a8948d201be986112a2a616b2ff30e58e8a8f08f.zip
Refactored mhd_locks.h and mhd_sockets.h: allow usage of macros without
aborting of execution.
Diffstat (limited to 'src/microhttpd/internal.h')
-rw-r--r--src/microhttpd/internal.h40
1 files changed, 23 insertions, 17 deletions
diff --git a/src/microhttpd/internal.h b/src/microhttpd/internal.h
index a42564de..a72fcf65 100644
--- a/src/microhttpd/internal.h
+++ b/src/microhttpd/internal.h
@@ -35,6 +35,29 @@
35#include <gnutls/abstract.h> 35#include <gnutls/abstract.h>
36#endif 36#endif
37#endif 37#endif
38#include "mhd_options.h"
39
40
41#ifdef MHD_PANIC
42/* Override any defined MHD_PANIC macro with proper one */
43#undef MHD_PANIC
44#endif /* MHD_PANIC */
45
46#ifdef HAVE_MESSAGES
47/**
48 * Trigger 'panic' action based on fatal errors.
49 *
50 * @param msg error message (const char *)
51 */
52#define MHD_PANIC(msg) do { mhd_panic (mhd_panic_cls, __FILE__, __LINE__, msg); BUILTIN_NOT_REACHED; } while (0)
53#else
54/**
55 * Trigger 'panic' action based on fatal errors.
56 *
57 * @param msg error message (const char *)
58 */
59#define MHD_PANIC(msg) do { mhd_panic (mhd_panic_cls, __FILE__, __LINE__, NULL); BUILTIN_NOT_REACHED; } while (0)
60#endif
38 61
39#include "mhd_threads.h" 62#include "mhd_threads.h"
40#include "mhd_locks.h" 63#include "mhd_locks.h"
@@ -82,23 +105,6 @@ extern void *mhd_panic_cls;
82#endif 105#endif
83 106
84 107
85#ifdef HAVE_MESSAGES
86/**
87 * Trigger 'panic' action based on fatal errors.
88 *
89 * @param msg error message (const char *)
90 */
91#define MHD_PANIC(msg) do { mhd_panic (mhd_panic_cls, __FILE__, __LINE__, msg); BUILTIN_NOT_REACHED; } while (0)
92#else
93/**
94 * Trigger 'panic' action based on fatal errors.
95 *
96 * @param msg error message (const char *)
97 */
98#define MHD_PANIC(msg) do { mhd_panic (mhd_panic_cls, __FILE__, __LINE__, NULL); BUILTIN_NOT_REACHED; } while (0)
99#endif
100
101
102/** 108/**
103 * State of the socket with respect to epoll (bitmask). 109 * State of the socket with respect to epoll (bitmask).
104 */ 110 */