]> andersk Git - test.git/blobdiff - libhttp/server.c
Some changes to improve compatibility with MacOS X.
[test.git] / libhttp / server.c
index 3b115869c5167e1449fa5d4c78f6e9c3ba60f0f8..d0ab1c7b0b87443804845cc596fb802b8656d0a9 100644 (file)
 #include "libhttp/ssl.h"
 #include "logging/logging.h"
 
+#ifdef HAVE_UNUSED
+#defined ATTR_UNUSED __attribute__((unused))
+#defined UNUSED(x)   do { } while (0)
+#else
+#define ATTR_UNUSED
+#define UNUSED(x)    do { (void)(x); } while (0)
+#endif
+
 #define INITIAL_TIMEOUT    (10*60)
 
 // Maximum amount of payload (e.g. form values that have been POST'd) that we
@@ -128,8 +136,8 @@ static int serverCollectHandler(struct HttpConnection *http, void *handler_) {
 
 }
 
-static void serverDestroyHandlers(void *arg, char *value) {
-  (void)arg;
+static void serverDestroyHandlers(void *arg ATTR_UNUSED, char *value) {
+  UNUSED(arg);
   free(value);
 }
 
@@ -183,8 +191,9 @@ void serverRegisterWebSocketHandler(struct Server *server, const char *url,
   }
 }
 
-static int serverQuitHandler(struct HttpConnection *http, void *arg) {
-  (void)arg;
+static int serverQuitHandler(struct HttpConnection *http ATTR_UNUSED,
+                             void *arg) {
+  UNUSED(arg);
   httpSendReply(http, 200, "Good Bye", NO_MSG);
   httpExitLoop(http, 1);
   return HTTP_DONE;
This page took 0.025647 seconds and 4 git commands to generate.