libmicrohttpd

HTTP/1.x server C library (MHD 1.x, stable)
Log | Files | Refs | Submodules | README | LICENSE

commit 3b4636871e82d88e545cfce8e93109a5ed00e548
parent e1257548dad58058dd3854acc79a906ed8ce501c
Author: Evgeny Grin (Karlson2k) <k2k@narod.ru>
Date:   Tue, 16 Aug 2016 12:17:46 +0000

mhd_mono_clock: do not use large includes in header

Diffstat:
Msrc/microhttpd/mhd_mono_clock.c | 24++++++++++++++++++++++++
Msrc/microhttpd/mhd_mono_clock.h | 8+++++++-
2 files changed, 31 insertions(+), 1 deletion(-)

diff --git 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 @@ -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.