From 0d2688a98bfc4f32b393fc581ec04e97d9b11449 Mon Sep 17 00:00:00 2001 From: "Evgeny Grin (Karlson2k)" Date: Sat, 22 Aug 2015 15:45:36 +0000 Subject: fix file names, include missing files to Makefile --- src/microhttpd/MHD_byteorder.h | 160 ------------------------------- src/microhttpd/MHD_limits.h | 73 -------------- src/microhttpd/Makefile.am | 1 + src/microhttpd/daemon.c | 2 +- src/microhttpd/md5.c | 2 +- src/microhttpd/mhd_byteorder.h | 160 +++++++++++++++++++++++++++++++ src/microhttpd/mhd_limits.h | 73 ++++++++++++++ src/microhttpd/response.c | 2 +- w32/VS2013/libmicrohttpd.vcxproj | 4 +- w32/VS2013/libmicrohttpd.vcxproj.filters | 4 +- 10 files changed, 241 insertions(+), 240 deletions(-) delete mode 100644 src/microhttpd/MHD_byteorder.h delete mode 100644 src/microhttpd/MHD_limits.h create mode 100644 src/microhttpd/mhd_byteorder.h create mode 100644 src/microhttpd/mhd_limits.h diff --git a/src/microhttpd/MHD_byteorder.h b/src/microhttpd/MHD_byteorder.h deleted file mode 100644 index 9cce33e5..00000000 --- a/src/microhttpd/MHD_byteorder.h +++ /dev/null @@ -1,160 +0,0 @@ -/* - This file is part of libmicrohttpd - Copyright (C) 2015 Karlson2k (Evgeny Grin) - - This library is free software; you can redistribute it and/or - modify it under the terms of the GNU Lesser General Public - License as published by the Free Software Foundation; either - version 2.1 of the License, or (at your option) any later version. - - This library is distributed in the hope that it will be useful, - but WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - Lesser General Public License for more details. - - You should have received a copy of the GNU Lesser General Public - License along with this library. - If not, see . -*/ - -/** - * @file microhttpd/MHD_byteorder.h - * @brief macro definitions for host byte order - * @author Karlson2k (Evgeny Grin) - */ - -#ifndef MHD_BYTEORDER_H -#define MHD_BYTEORDER_H - -#include "platform.h" - -#if HAVE_ENDIAN_H -#include -#endif - -#if HAVE_SYS_PARAM_H -#include -#endif - -#if HAVE_MACHINE_ENDIAN_H -#include -#endif - -#if HAVE_SYS_ENDIAN_H -#include -#endif - -#if HAVE_SYS_TYPES_H -#include -#endif - -#if HAVE_SYS_BYTEORDER_H -#include -#endif - -#if HAVE_SYS_MACHINE_H -#include -#endif - -#if HAVE_MACHINE_PARAM_H -#include -#endif - -#if HAVE_SYS_ISA_DEFS_H -#include -#endif - -#define _MHD_BIG_ENDIAN 1234 -#define _MHD_LITTLE_ENDIAN 4321 -#define _MHD_PDP_ENDIAN 2143 - -#if defined(__BYTE_ORDER__) -#if defined(__ORDER_BIG_ENDIAN__) && __BYTE_ORDER__ == __ORDER_BIG_ENDIAN__ -#define _MHD_BYTE_ORDER _MHD_BIG_ENDIAN -#elif defined(__ORDER_LITTLE_ENDIAN__) && __BYTE_ORDER__ == __ORDER_LITTLE_ENDIAN__ -#define _MHD_BYTE_ORDER _MHD_LITTLE_ENDIAN -#elif defined(__ORDER_PDP_ENDIAN__) && __BYTE_ORDER__ == __ORDER_PDP_ENDIAN__ -#define _MHD_BYTE_ORDER _MHD_PDP_ENDIAN -#endif /* __BYTE_ORDER__ == __ORDER_PDP_ENDIAN__ */ -#elif defined(__BYTE_ORDER) -#if defined(__BIG_ENDIAN) && __BYTE_ORDER == __BIG_ENDIAN -#define _MHD_BYTE_ORDER _MHD_BIG_ENDIAN -#elif defined(__LITTLE_ENDIAN) && __BYTE_ORDER == __LITTLE_ENDIAN -#define _MHD_BYTE_ORDER _MHD_LITTLE_ENDIAN -#elif defined(__PDP_ENDIAN) && __BYTE_ORDER == __PDP_ENDIAN -#define _MHD_BYTE_ORDER _MHD_PDP_ENDIAN -#endif /* __BYTE_ORDER == __PDP_ENDIAN */ -#elif defined (BYTE_ORDER) -#if defined(BIG_ENDIAN) && BYTE_ORDER == BIG_ENDIAN -#define _MHD_BYTE_ORDER _MHD_BIG_ENDIAN -#elif defined(LITTLE_ENDIAN) && BYTE_ORDER == LITTLE_ENDIAN -#define _MHD_BYTE_ORDER _MHD_LITTLE_ENDIAN -#elif defined(PDP_ENDIAN) && BYTE_ORDER == PDP_ENDIAN -#define _MHD_BYTE_ORDER _MHD_PDP_ENDIAN -#endif /* __BYTE_ORDER == _PDP_ENDIAN */ -#elif defined (_BYTE_ORDER) -#if defined(_BIG_ENDIAN) && _BYTE_ORDER == _BIG_ENDIAN -#define _MHD_BYTE_ORDER _MHD_BIG_ENDIAN -#elif defined(_LITTLE_ENDIAN) && _BYTE_ORDER == _LITTLE_ENDIAN -#define _MHD_BYTE_ORDER _MHD_LITTLE_ENDIAN -#elif defined(_PDP_ENDIAN) && _BYTE_ORDER == _PDP_ENDIAN -#define _MHD_BYTE_ORDER _MHD_PDP_ENDIAN -#endif /* _BYTE_ORDER == _PDP_ENDIAN */ -#endif /* _BYTE_ORDER */ - -#ifndef _MHD_BYTE_ORDER -/* Byte order specification didn't detected in system headers */ -/* Try some guessing */ - -#if (defined(__BIG_ENDIAN__) && !defined(__LITTLE_ENDIAN__)) || \ - (defined(_BIG_ENDIAN) && !defined(_LITTLE_ENDIAN)) -/* Seems that we are on big endian platform */ -#define _MHD_BYTE_ORDER _MHD_BIG_ENDIAN -#elif (defined(__LITTLE_ENDIAN__) && !defined(__BIG_ENDIAN__)) || \ - (defined(_LITTLE_ENDIAN) && !defined(_BIG_ENDIAN)) -/* Seems that we are on little endian platform */ -#define _MHD_BYTE_ORDER _MHD_LITTLE_ENDIAN -#elif defined(__amd64__) || defined(__amd64) || defined(__x86_64__) || defined(__x86_64) || \ - defined(_M_X64) || defined(_M_AMD64) || defined(i386) || defined(__i386) || \ - defined(__i386__) || defined(__i486__) || defined(__i586__) || defined(__i686__) || \ - defined(_M_IX86) || defined(_X86_) || defined (__THW_INTEL__) -/* x86 family is little endian */ -#define _MHD_BYTE_ORDER _MHD_LITTLE_ENDIAN -#elif defined(__ARMEB__) || defined(__THUMBEB__) || defined(__AARCH64EB__) || \ - defined(_MIPSEB) || defined(__MIPSEB) || defined(__MIPSEB__) -/* Looks like we are on ARM/MIPS in big endian mode */ -#define _MHD_BYTE_ORDER _MHD_BIG_ENDIAN -#elif defined(__ARMEL__) || defined(__THUMBEL__) || defined(__AARCH64EL__) || \ - defined(_MIPSEL) || defined(__MIPSEL) || defined(__MIPSEL__) -/* Looks like we are on ARM/MIPS in little endian mode */ -#define _MHD_BYTE_ORDER _MHD_LITTLE_ENDIAN -#elif defined(__m68k__) || defined(M68000) || defined(__hppa__) || defined(__hppa) || \ - defined(__HPPA__) || defined(__370__) || defined(__THW_370__) || \ - defined(__s390__) || defined(__s390x__) || defined(__SYSC_ZARCH__) -/* Looks like we are on big endian platform */ -#define _MHD_BYTE_ORDER _MHD_BIG_ENDIAN -#elif defined(__ia64__) || defined(_IA64) || defined(__IA64__) || defined(__ia64) || \ - defined(_M_IA64) || defined(__itanium__) || defined(__bfin__) || \ - defined(__BFIN__) || defined(bfin) || defined(BFIN) -/* Looks like we are on little endian platform */ -#define _MHD_BYTE_ORDER _MHD_LITTLE_ENDIAN -#elif defined(_WIN32) -/* W32 is always little endian on all platforms */ -#define _MHD_BYTE_ORDER _MHD_LITTLE_ENDIAN -#elif defined(WORDS_BIGENDIAN) -/* Use byte order detected by configure */ -#define _MHD_BYTE_ORDER _MHD_BIG_ENDIAN -#endif /* _WIN32 */ - -#endif /* !_MHD_BYTE_ORDER */ - -#ifdef _MHD_BYTE_ORDER -/* Some safety checks */ -#if defined(WORDS_BIGENDIAN) && _MHD_BYTE_ORDER != _MHD_BIG_ENDIAN -#error Configure detected big endian byte order but headers specify different byte order -#elif !defined(WORDS_BIGENDIAN) && _MHD_BYTE_ORDER == _MHD_BIG_ENDIAN -#error Configure did not detect big endian byte order but headers specify big endian byte order -#endif /* !WORDS_BIGENDIAN && _MHD_BYTE_ORDER == _MHD_BIG_ENDIAN */ -#endif /* _MHD_BYTE_ORDER */ - -#endif /* !MHD_BYTEORDER_H */ diff --git a/src/microhttpd/MHD_limits.h b/src/microhttpd/MHD_limits.h deleted file mode 100644 index 2236b08e..00000000 --- a/src/microhttpd/MHD_limits.h +++ /dev/null @@ -1,73 +0,0 @@ -/* - This file is part of libmicrohttpd - Copyright (C) 2015 Karlson2k (Evgeny Grin) - - This library is free software; you can redistribute it and/or - modify it under the terms of the GNU Lesser General Public - License as published by the Free Software Foundation; either - version 2.1 of the License, or (at your option) any later version. - - This library is distributed in the hope that it will be useful, - but WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - Lesser General Public License for more details. - - You should have received a copy of the GNU Lesser General Public - License along with this library; if not, write to the Free Software - Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA -*/ - -/** - * @file microhttpd/MHD_limits.h - * @brief limits values definitions - * @author Karlson2k (Evgeny Grin) - */ - -#ifndef MHD_LIMITS_H -#define MHD_LIMITS_H - -#include "platform.h" - -#ifdef HAVE_LIMITS_H -#include -#endif /* HAVE_LIMITS_H */ - -#ifndef LONG_MAX -#define LONG_MAX ((long) ~(((uint64_t) 1) << (8 * sizeof(long) - 1))) -#endif /* !OFF_T_MAX */ - -#ifndef ULLONG_MAX -#define ((MHD_UNSIGNED_LONG_LONG) ~((MHD_UNSIGNED_LONG_LONG)0)) -#endif /* !ULLONG_MAX */ - -#ifndef INT32_MAX -#define INT32_MAX ((int32_t)0x7FFFFFFF) -#endif /* !INT32_MAX */ - -#ifndef SIZE_MAX -#define SIZE_MAX ((size_t) ~((size_t)0)) -#endif /* !SIZE_MAX */ - -#ifndef OFF_T_MAX -#define OFF_T_MAX ((off_t) ~(((uint64_t) 1) << (8 * sizeof(off_t) - 1))) -#endif /* !OFF_T_MAX */ - -#if defined(_LARGEFILE64_SOURCE) && !defined(OFF64_T_MAX) -#define OFF64_T_MAX ((off64_t) ~(((uint64_t) 1) << (8 * sizeof(off64_t) - 1))) -#endif /* _LARGEFILE64_SOURCE && !OFF64_T_MAX */ - -#ifndef TIME_T_MAX -/* Assume that time_t is signed type. */ -/* Even if time_t is unsigned, TIME_T_MAX will be safe limit */ -#define TIME_T_MAX ( (time_t) ~(((uint64_t) 1) << (8 * sizeof(time_t) - 1)) ) -#endif /* !TIME_T_MAX */ - -#ifndef TIMEVAL_TV_SEC_MAX -#ifndef _WIN32 -#define TIMEVAL_TV_SEC_MAX TIME_T_MAX -#else /* _WIN32 */ -#define TIMEVAL_TV_SEC_MAX LONG_MAX -#endif /* _WIN32 */ -#endif /* !TIMEVAL_TV_SEC_MAX */ - -#endif /* MHD_LIMITS_H */ diff --git a/src/microhttpd/Makefile.am b/src/microhttpd/Makefile.am index 40879036..020579d6 100644 --- a/src/microhttpd/Makefile.am +++ b/src/microhttpd/Makefile.am @@ -62,6 +62,7 @@ libmicrohttpd_la_SOURCES = \ daemon.c \ internal.c internal.h \ memorypool.c memorypool.h \ + mhd_limits.h mhd_byteorder.h \ response.c response.h libmicrohttpd_la_CPPFLAGS = \ $(AM_CPPFLAGS) $(MHD_LIB_CPPFLAGS) \ diff --git a/src/microhttpd/daemon.c b/src/microhttpd/daemon.c index f4da2c8c..d8540abe 100644 --- a/src/microhttpd/daemon.c +++ b/src/microhttpd/daemon.c @@ -36,7 +36,7 @@ #include "response.h" #include "connection.h" #include "memorypool.h" -#include "MHD_limits.h" +#include "mhd_limits.h" #include "autoinit_funcs.h" #if HAVE_SEARCH_H diff --git a/src/microhttpd/md5.c b/src/microhttpd/md5.c index 906ac356..d92a42ee 100644 --- a/src/microhttpd/md5.c +++ b/src/microhttpd/md5.c @@ -18,7 +18,7 @@ /* Based on OpenBSD modifications */ #include "md5.h" -#include "MHD_byteorder.h" +#include "mhd_byteorder.h" #define PUT_64BIT_LE(cp, value) do { \ (cp)[7] = (uint8_t)((value) >> 56); \ diff --git a/src/microhttpd/mhd_byteorder.h b/src/microhttpd/mhd_byteorder.h new file mode 100644 index 00000000..66689804 --- /dev/null +++ b/src/microhttpd/mhd_byteorder.h @@ -0,0 +1,160 @@ +/* + This file is part of libmicrohttpd + Copyright (C) 2015 Karlson2k (Evgeny Grin) + + This library is free software; you can redistribute it and/or + modify it under the terms of the GNU Lesser General Public + License as published by the Free Software Foundation; either + version 2.1 of the License, or (at your option) any later version. + + This library is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + Lesser General Public License for more details. + + You should have received a copy of the GNU Lesser General Public + License along with this library. + If not, see . +*/ + +/** + * @file microhttpd/mhd_byteorder.h + * @brief macro definitions for host byte order + * @author Karlson2k (Evgeny Grin) + */ + +#ifndef MHD_BYTEORDER_H +#define MHD_BYTEORDER_H + +#include "platform.h" + +#if HAVE_ENDIAN_H +#include +#endif + +#if HAVE_SYS_PARAM_H +#include +#endif + +#if HAVE_MACHINE_ENDIAN_H +#include +#endif + +#if HAVE_SYS_ENDIAN_H +#include +#endif + +#if HAVE_SYS_TYPES_H +#include +#endif + +#if HAVE_SYS_BYTEORDER_H +#include +#endif + +#if HAVE_SYS_MACHINE_H +#include +#endif + +#if HAVE_MACHINE_PARAM_H +#include +#endif + +#if HAVE_SYS_ISA_DEFS_H +#include +#endif + +#define _MHD_BIG_ENDIAN 1234 +#define _MHD_LITTLE_ENDIAN 4321 +#define _MHD_PDP_ENDIAN 2143 + +#if defined(__BYTE_ORDER__) +#if defined(__ORDER_BIG_ENDIAN__) && __BYTE_ORDER__ == __ORDER_BIG_ENDIAN__ +#define _MHD_BYTE_ORDER _MHD_BIG_ENDIAN +#elif defined(__ORDER_LITTLE_ENDIAN__) && __BYTE_ORDER__ == __ORDER_LITTLE_ENDIAN__ +#define _MHD_BYTE_ORDER _MHD_LITTLE_ENDIAN +#elif defined(__ORDER_PDP_ENDIAN__) && __BYTE_ORDER__ == __ORDER_PDP_ENDIAN__ +#define _MHD_BYTE_ORDER _MHD_PDP_ENDIAN +#endif /* __BYTE_ORDER__ == __ORDER_PDP_ENDIAN__ */ +#elif defined(__BYTE_ORDER) +#if defined(__BIG_ENDIAN) && __BYTE_ORDER == __BIG_ENDIAN +#define _MHD_BYTE_ORDER _MHD_BIG_ENDIAN +#elif defined(__LITTLE_ENDIAN) && __BYTE_ORDER == __LITTLE_ENDIAN +#define _MHD_BYTE_ORDER _MHD_LITTLE_ENDIAN +#elif defined(__PDP_ENDIAN) && __BYTE_ORDER == __PDP_ENDIAN +#define _MHD_BYTE_ORDER _MHD_PDP_ENDIAN +#endif /* __BYTE_ORDER == __PDP_ENDIAN */ +#elif defined (BYTE_ORDER) +#if defined(BIG_ENDIAN) && BYTE_ORDER == BIG_ENDIAN +#define _MHD_BYTE_ORDER _MHD_BIG_ENDIAN +#elif defined(LITTLE_ENDIAN) && BYTE_ORDER == LITTLE_ENDIAN +#define _MHD_BYTE_ORDER _MHD_LITTLE_ENDIAN +#elif defined(PDP_ENDIAN) && BYTE_ORDER == PDP_ENDIAN +#define _MHD_BYTE_ORDER _MHD_PDP_ENDIAN +#endif /* __BYTE_ORDER == _PDP_ENDIAN */ +#elif defined (_BYTE_ORDER) +#if defined(_BIG_ENDIAN) && _BYTE_ORDER == _BIG_ENDIAN +#define _MHD_BYTE_ORDER _MHD_BIG_ENDIAN +#elif defined(_LITTLE_ENDIAN) && _BYTE_ORDER == _LITTLE_ENDIAN +#define _MHD_BYTE_ORDER _MHD_LITTLE_ENDIAN +#elif defined(_PDP_ENDIAN) && _BYTE_ORDER == _PDP_ENDIAN +#define _MHD_BYTE_ORDER _MHD_PDP_ENDIAN +#endif /* _BYTE_ORDER == _PDP_ENDIAN */ +#endif /* _BYTE_ORDER */ + +#ifndef _MHD_BYTE_ORDER +/* Byte order specification didn't detected in system headers */ +/* Try some guessing */ + +#if (defined(__BIG_ENDIAN__) && !defined(__LITTLE_ENDIAN__)) || \ + (defined(_BIG_ENDIAN) && !defined(_LITTLE_ENDIAN)) +/* Seems that we are on big endian platform */ +#define _MHD_BYTE_ORDER _MHD_BIG_ENDIAN +#elif (defined(__LITTLE_ENDIAN__) && !defined(__BIG_ENDIAN__)) || \ + (defined(_LITTLE_ENDIAN) && !defined(_BIG_ENDIAN)) +/* Seems that we are on little endian platform */ +#define _MHD_BYTE_ORDER _MHD_LITTLE_ENDIAN +#elif defined(__amd64__) || defined(__amd64) || defined(__x86_64__) || defined(__x86_64) || \ + defined(_M_X64) || defined(_M_AMD64) || defined(i386) || defined(__i386) || \ + defined(__i386__) || defined(__i486__) || defined(__i586__) || defined(__i686__) || \ + defined(_M_IX86) || defined(_X86_) || defined (__THW_INTEL__) +/* x86 family is little endian */ +#define _MHD_BYTE_ORDER _MHD_LITTLE_ENDIAN +#elif defined(__ARMEB__) || defined(__THUMBEB__) || defined(__AARCH64EB__) || \ + defined(_MIPSEB) || defined(__MIPSEB) || defined(__MIPSEB__) +/* Looks like we are on ARM/MIPS in big endian mode */ +#define _MHD_BYTE_ORDER _MHD_BIG_ENDIAN +#elif defined(__ARMEL__) || defined(__THUMBEL__) || defined(__AARCH64EL__) || \ + defined(_MIPSEL) || defined(__MIPSEL) || defined(__MIPSEL__) +/* Looks like we are on ARM/MIPS in little endian mode */ +#define _MHD_BYTE_ORDER _MHD_LITTLE_ENDIAN +#elif defined(__m68k__) || defined(M68000) || defined(__hppa__) || defined(__hppa) || \ + defined(__HPPA__) || defined(__370__) || defined(__THW_370__) || \ + defined(__s390__) || defined(__s390x__) || defined(__SYSC_ZARCH__) +/* Looks like we are on big endian platform */ +#define _MHD_BYTE_ORDER _MHD_BIG_ENDIAN +#elif defined(__ia64__) || defined(_IA64) || defined(__IA64__) || defined(__ia64) || \ + defined(_M_IA64) || defined(__itanium__) || defined(__bfin__) || \ + defined(__BFIN__) || defined(bfin) || defined(BFIN) +/* Looks like we are on little endian platform */ +#define _MHD_BYTE_ORDER _MHD_LITTLE_ENDIAN +#elif defined(_WIN32) +/* W32 is always little endian on all platforms */ +#define _MHD_BYTE_ORDER _MHD_LITTLE_ENDIAN +#elif defined(WORDS_BIGENDIAN) +/* Use byte order detected by configure */ +#define _MHD_BYTE_ORDER _MHD_BIG_ENDIAN +#endif /* _WIN32 */ + +#endif /* !_MHD_BYTE_ORDER */ + +#ifdef _MHD_BYTE_ORDER +/* Some safety checks */ +#if defined(WORDS_BIGENDIAN) && _MHD_BYTE_ORDER != _MHD_BIG_ENDIAN +#error Configure detected big endian byte order but headers specify different byte order +#elif !defined(WORDS_BIGENDIAN) && _MHD_BYTE_ORDER == _MHD_BIG_ENDIAN +#error Configure did not detect big endian byte order but headers specify big endian byte order +#endif /* !WORDS_BIGENDIAN && _MHD_BYTE_ORDER == _MHD_BIG_ENDIAN */ +#endif /* _MHD_BYTE_ORDER */ + +#endif /* !MHD_BYTEORDER_H */ diff --git a/src/microhttpd/mhd_limits.h b/src/microhttpd/mhd_limits.h new file mode 100644 index 00000000..5ce2f9c4 --- /dev/null +++ b/src/microhttpd/mhd_limits.h @@ -0,0 +1,73 @@ +/* + This file is part of libmicrohttpd + Copyright (C) 2015 Karlson2k (Evgeny Grin) + + This library is free software; you can redistribute it and/or + modify it under the terms of the GNU Lesser General Public + License as published by the Free Software Foundation; either + version 2.1 of the License, or (at your option) any later version. + + This library is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + Lesser General Public License for more details. + + You should have received a copy of the GNU Lesser General Public + License along with this library; if not, write to the Free Software + Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA +*/ + +/** + * @file microhttpd/mhd_limits.h + * @brief limits values definitions + * @author Karlson2k (Evgeny Grin) + */ + +#ifndef MHD_LIMITS_H +#define MHD_LIMITS_H + +#include "platform.h" + +#ifdef HAVE_LIMITS_H +#include +#endif /* HAVE_LIMITS_H */ + +#ifndef LONG_MAX +#define LONG_MAX ((long) ~(((uint64_t) 1) << (8 * sizeof(long) - 1))) +#endif /* !OFF_T_MAX */ + +#ifndef ULLONG_MAX +#define ((MHD_UNSIGNED_LONG_LONG) ~((MHD_UNSIGNED_LONG_LONG)0)) +#endif /* !ULLONG_MAX */ + +#ifndef INT32_MAX +#define INT32_MAX ((int32_t)0x7FFFFFFF) +#endif /* !INT32_MAX */ + +#ifndef SIZE_MAX +#define SIZE_MAX ((size_t) ~((size_t)0)) +#endif /* !SIZE_MAX */ + +#ifndef OFF_T_MAX +#define OFF_T_MAX ((off_t) ~(((uint64_t) 1) << (8 * sizeof(off_t) - 1))) +#endif /* !OFF_T_MAX */ + +#if defined(_LARGEFILE64_SOURCE) && !defined(OFF64_T_MAX) +#define OFF64_T_MAX ((off64_t) ~(((uint64_t) 1) << (8 * sizeof(off64_t) - 1))) +#endif /* _LARGEFILE64_SOURCE && !OFF64_T_MAX */ + +#ifndef TIME_T_MAX +/* Assume that time_t is signed type. */ +/* Even if time_t is unsigned, TIME_T_MAX will be safe limit */ +#define TIME_T_MAX ( (time_t) ~(((uint64_t) 1) << (8 * sizeof(time_t) - 1)) ) +#endif /* !TIME_T_MAX */ + +#ifndef TIMEVAL_TV_SEC_MAX +#ifndef _WIN32 +#define TIMEVAL_TV_SEC_MAX TIME_T_MAX +#else /* _WIN32 */ +#define TIMEVAL_TV_SEC_MAX LONG_MAX +#endif /* _WIN32 */ +#endif /* !TIMEVAL_TV_SEC_MAX */ + +#endif /* MHD_LIMITS_H */ diff --git a/src/microhttpd/response.c b/src/microhttpd/response.c index 12948352..2cca3c74 100644 --- a/src/microhttpd/response.c +++ b/src/microhttpd/response.c @@ -28,7 +28,7 @@ #include "internal.h" #include "response.h" -#include "MHD_limits.h" +#include "mhd_limits.h" #if defined(_WIN32) && defined(MHD_W32_MUTEX_) #ifndef WIN32_LEAN_AND_MEAN diff --git a/w32/VS2013/libmicrohttpd.vcxproj b/w32/VS2013/libmicrohttpd.vcxproj index 3a2e3128..d5beffe8 100644 --- a/w32/VS2013/libmicrohttpd.vcxproj +++ b/w32/VS2013/libmicrohttpd.vcxproj @@ -92,8 +92,8 @@ - - + + diff --git a/w32/VS2013/libmicrohttpd.vcxproj.filters b/w32/VS2013/libmicrohttpd.vcxproj.filters index 5c221f0b..50a9b4d3 100644 --- a/w32/VS2013/libmicrohttpd.vcxproj.filters +++ b/w32/VS2013/libmicrohttpd.vcxproj.filters @@ -105,10 +105,10 @@ Header Files - + Source Files - + Source Files -- cgit v1.2.3