summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorEvgeny Grin (Karlson2k) <k2k@narod.ru>2016-08-16 12:17:46 +0000
committerEvgeny Grin (Karlson2k) <k2k@narod.ru>2016-08-16 12:17:46 +0000
commit3b4636871e82d88e545cfce8e93109a5ed00e548 (patch)
tree4f4072691af526b50e12eaa6bcba37b352378dd5
parente1257548dad58058dd3854acc79a906ed8ce501c (diff)
mhd_mono_clock: do not use large includes in header
-rw-r--r--src/microhttpd/mhd_mono_clock.c24
-rw-r--r--src/microhttpd/mhd_mono_clock.h8
2 files changed, 31 insertions, 1 deletions
diff --git a/src/microhttpd/mhd_mono_clock.c b/src/microhttpd/mhd_mono_clock.c
index 5cb566d8..54a3e9ad 100644
--- a/src/microhttpd/mhd_mono_clock.c
+++ b/src/microhttpd/mhd_mono_clock.c
@@ -30,6 +30,21 @@
#undef HAVE_CLOCK_GETTIME
#endif /* _WIN32 && HAVE_CLOCK_GETTIME */
+#ifdef HAVE_CLOCK_GETTIME
+#include <time.h>
+#endif /* HAVE_CLOCK_GETTIME */
+
+#ifdef HAVE_GETHRTIME
+#ifdef HAVE_SYS_TIME_H
+/* Solaris define gethrtime() in sys/time.h */
+#include <sys/time.h>
+#endif /* HAVE_SYS_TIME_H */
+#ifdef HAVE_TIME_H
+/* HP-UX define gethrtime() in time.h */
+#include <time.h>
+#endif /* HAVE_TIME_H */
+#endif /* HAVE_GETHRTIME */
+
#ifdef HAVE_CLOCK_GET_TIME
#include <mach/mach.h>
/* for host_get_clock_service(), mach_host_self(), mach_task_self() */
@@ -41,6 +56,15 @@
static clock_serv_t mono_clock_service = _MHD_INVALID_CLOCK_SERV;
#endif /* HAVE_CLOCK_GET_TIME */
+#ifdef _WIN32
+#ifndef WIN32_LEAN_AND_MEAN
+/* Do not include unneeded parts of W32 headers. */
+#define WIN32_LEAN_AND_MEAN 1
+#endif /* !WIN32_LEAN_AND_MEAN */
+#include <windows.h>
+#include <stdint.h>
+#endif /* _WIN32 */
+
#ifdef HAVE_CLOCK_GETTIME
#ifdef CLOCK_REALTIME
#define _MHD_UNWANTED_CLOCK CLOCK_REALTIME
diff --git a/src/microhttpd/mhd_mono_clock.h b/src/microhttpd/mhd_mono_clock.h
index 2c515d63..f4722af2 100644
--- a/src/microhttpd/mhd_mono_clock.h
+++ b/src/microhttpd/mhd_mono_clock.h
@@ -25,7 +25,13 @@
#ifndef MHD_MONO_CLOCK_H
#define MHD_MONO_CLOCK_H 1
-#include "platform.h"
+#include "mhd_options.h"
+
+#if defined(HAVE_TIME_H)
+#include <time.h>
+#elif defined(HAVE_SYS_TYPES_H)
+#include <sys/types.h>
+#endif
/**
* Initialise monotonic seconds counter.