Sfoglia il codice sorgente

memorypool: refactored includes, moved out unrelated function

Evgeny Grin (Karlson2k) 6 anni fa
parent
commit
2abfb2ccca
3 ha cambiato i file con 18 aggiunte e 16 eliminazioni
  1. 15 0
      src/microhttpd/daemon.c
  2. 1 15
      src/microhttpd/memorypool.c
  3. 2 1
      src/microhttpd/memorypool.h

+ 15 - 0
src/microhttpd/daemon.c

@@ -234,6 +234,21 @@ MHD_default_logger_ (void *cls,
 }
 
 
+/**
+ * Free the memory given by @a ptr. Calls "free(ptr)".  This function
+ * should be used to free the username returned by
+ * #MHD_digest_auth_get_username().
+ * @note Since v0.9.56
+ *
+ * @param ptr pointer to free.
+ */
+_MHD_EXTERN void
+MHD_free (void *ptr)
+{
+  free (ptr);
+}
+
+
 /**
  * Trace up to and return master daemon. If the supplied daemon
  * is a master, then return the daemon itself.

+ 1 - 15
src/microhttpd/memorypool.c

@@ -25,6 +25,7 @@
  * @author Karlson2k (Evgeny Grin)
  */
 #include "memorypool.h"
+#include "internal.h"
 #include "mhd_assert.h"
 
 /* define MAP_ANONYMOUS for Mac OS X */
@@ -80,21 +81,6 @@ struct MemoryPool
 };
 
 
-/**
- * Free the memory given by @a ptr. Calls "free(ptr)".  This function
- * should be used to free the username returned by
- * #MHD_digest_auth_get_username().
- * @note Since v0.9.56
- *
- * @param ptr pointer to free.
- */
-_MHD_EXTERN void
-MHD_free (void *ptr)
-{
-  free (ptr);
-}
-
-
 /**
  * Create a memory pool.
  *

+ 2 - 1
src/microhttpd/memorypool.h

@@ -30,7 +30,8 @@
 #ifndef MEMORYPOOL_H
 #define MEMORYPOOL_H
 
-#include "internal.h"
+#include "mhd_options.h"
+#include <stddef.h>
 
 /**
  * Opaque handle for a memory pool.