commit 2c842e6b95498e1dc56584b7e0c1570b9cd0792c
parent 4a251757ab5c98c9d747e73f310d0c28cf991b05
Author: Evgeny Grin (Karlson2k) <k2k@narod.ru>
Date: Tue, 7 Jul 2015 18:32:33 +0000
Move all internal limits definitions to MHD_limits.h
Diffstat:
6 files changed, 55 insertions(+), 18 deletions(-)
diff --git a/src/include/platform.h b/src/include/platform.h
@@ -206,12 +206,4 @@ typedef MHD_socket MHD_pipe;
#define IPPROTO_IPV6 IPPROTO_IPV6
#endif
-#ifndef OFF_T_MAX
-#define OFF_T_MAX ((off_t) ~(((uint64_t) 1) << (8 * sizeof(off_t) - 1)))
-#endif
-
-#if defined(_LARGEFILE64_SOURCE) && !defined(OFF64_T_MAX)
-#define OFF64_T_MAX ((off64_t) ~(((uint64_t) 1) << (8 * sizeof(off64_t) - 1)))
-#endif
-
#endif
diff --git a/src/microhttpd/MHD_limits.h b/src/microhttpd/MHD_limits.h
@@ -0,0 +1,49 @@
+/*
+ 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 <limits.h>
+#endif /* HAVE_LIMITS_H */
+
+
+#ifndef INT32_MAX
+#define INT32_MAX ((int32_t)0x7FFFFFFF)
+#endif /* !INT32_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 */
+
+
+#endif /* MHD_LIMITS_H */
diff --git a/src/microhttpd/daemon.c b/src/microhttpd/daemon.c
@@ -36,7 +36,7 @@
#include "response.h"
#include "connection.h"
#include "memorypool.h"
-#include <limits.h>
+#include "MHD_limits.h"
#include "autoinit_funcs.h"
#if HAVE_SEARCH_H
@@ -117,10 +117,6 @@
#define EPOLL_CLOEXEC 0
#endif
-#ifndef INT32_MAX
-#define INT32_MAX ((int32_t)0x7FFFFFFF)
-#endif /* !INT32_MAX */
-
/**
* Default implementation of the panic function,
diff --git a/src/microhttpd/response.c b/src/microhttpd/response.c
@@ -28,7 +28,7 @@
#include "internal.h"
#include "response.h"
-#include <limits.h>
+#include "MHD_limits.h"
#if defined(_WIN32) && defined(MHD_W32_MUTEX_)
#ifndef WIN32_LEAN_AND_MEAN
@@ -305,10 +305,6 @@ MHD_set_response_options (struct MHD_Response *response,
}
-#ifndef INT32_MAX
-#define INT32_MAX ((int32_t)0x7FFFFFFF)
-#endif /* !INT32_MAX */
-
/**
* Given a file descriptor, read data from the file
* to generate the response.
diff --git a/w32/VS2013/libmicrohttpd.vcxproj b/w32/VS2013/libmicrohttpd.vcxproj
@@ -92,6 +92,7 @@
<ClInclude Include="..\..\src\microhttpd\internal.h" />
<ClInclude Include="..\..\src\microhttpd\md5.h" />
<ClInclude Include="..\..\src\microhttpd\memorypool.h" />
+ <ClInclude Include="..\..\src\microhttpd\MHD_limits.h" />
<ClInclude Include="..\..\src\microhttpd\reason_phrase.h" />
<ClInclude Include="..\..\src\microhttpd\response.h" />
<ClInclude Include="..\..\src\microhttpd\tsearch.h" />
diff --git a/w32/VS2013/libmicrohttpd.vcxproj.filters b/w32/VS2013/libmicrohttpd.vcxproj.filters
@@ -105,6 +105,9 @@
<ClInclude Include="..\..\src\include\autoinit_funcs.h">
<Filter>Header Files</Filter>
</ClInclude>
+ <ClInclude Include="..\..\src\microhttpd\MHD_limits.h">
+ <Filter>Source Files</Filter>
+ </ClInclude>
</ItemGroup>
<ItemGroup>
<ResourceCompile Include="microhttpd_dll_res_vc.rc">