aboutsummaryrefslogtreecommitdiff
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)
downloadlibmicrohttpd-3b4636871e82d88e545cfce8e93109a5ed00e548.tar.gz
libmicrohttpd-3b4636871e82d88e545cfce8e93109a5ed00e548.zip
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 @@
30#undef HAVE_CLOCK_GETTIME 30#undef HAVE_CLOCK_GETTIME
31#endif /* _WIN32 && HAVE_CLOCK_GETTIME */ 31#endif /* _WIN32 && HAVE_CLOCK_GETTIME */
32 32
33#ifdef HAVE_CLOCK_GETTIME
34#include <time.h>
35#endif /* HAVE_CLOCK_GETTIME */
36
37#ifdef HAVE_GETHRTIME
38#ifdef HAVE_SYS_TIME_H
39/* Solaris define gethrtime() in sys/time.h */
40#include <sys/time.h>
41#endif /* HAVE_SYS_TIME_H */
42#ifdef HAVE_TIME_H
43/* HP-UX define gethrtime() in time.h */
44#include <time.h>
45#endif /* HAVE_TIME_H */
46#endif /* HAVE_GETHRTIME */
47
33#ifdef HAVE_CLOCK_GET_TIME 48#ifdef HAVE_CLOCK_GET_TIME
34#include <mach/mach.h> 49#include <mach/mach.h>
35/* for host_get_clock_service(), mach_host_self(), mach_task_self() */ 50/* for host_get_clock_service(), mach_host_self(), mach_task_self() */
@@ -41,6 +56,15 @@
41static clock_serv_t mono_clock_service = _MHD_INVALID_CLOCK_SERV; 56static clock_serv_t mono_clock_service = _MHD_INVALID_CLOCK_SERV;
42#endif /* HAVE_CLOCK_GET_TIME */ 57#endif /* HAVE_CLOCK_GET_TIME */
43 58
59#ifdef _WIN32
60#ifndef WIN32_LEAN_AND_MEAN
61/* Do not include unneeded parts of W32 headers. */
62#define WIN32_LEAN_AND_MEAN 1
63#endif /* !WIN32_LEAN_AND_MEAN */
64#include <windows.h>
65#include <stdint.h>
66#endif /* _WIN32 */
67
44#ifdef HAVE_CLOCK_GETTIME 68#ifdef HAVE_CLOCK_GETTIME
45#ifdef CLOCK_REALTIME 69#ifdef CLOCK_REALTIME
46#define _MHD_UNWANTED_CLOCK CLOCK_REALTIME 70#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 @@
25 25
26#ifndef MHD_MONO_CLOCK_H 26#ifndef MHD_MONO_CLOCK_H
27#define MHD_MONO_CLOCK_H 1 27#define MHD_MONO_CLOCK_H 1
28#include "platform.h" 28#include "mhd_options.h"
29
30#if defined(HAVE_TIME_H)
31#include <time.h>
32#elif defined(HAVE_SYS_TYPES_H)
33#include <sys/types.h>
34#endif
29 35
30/** 36/**
31 * Initialise monotonic seconds counter. 37 * Initialise monotonic seconds counter.