aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--src/include/platform.h8
-rw-r--r--src/microhttpd/MHD_limits.h49
-rw-r--r--src/microhttpd/daemon.c6
-rw-r--r--src/microhttpd/response.c6
-rw-r--r--w32/VS2013/libmicrohttpd.vcxproj1
-rw-r--r--w32/VS2013/libmicrohttpd.vcxproj.filters3
6 files changed, 55 insertions, 18 deletions
diff --git a/src/include/platform.h b/src/include/platform.h
index 472696b6..9e33ee70 100644
--- a/src/include/platform.h
+++ b/src/include/platform.h
@@ -206,12 +206,4 @@ typedef MHD_socket MHD_pipe;
206#define IPPROTO_IPV6 IPPROTO_IPV6 206#define IPPROTO_IPV6 IPPROTO_IPV6
207#endif 207#endif
208 208
209#ifndef OFF_T_MAX
210#define OFF_T_MAX ((off_t) ~(((uint64_t) 1) << (8 * sizeof(off_t) - 1)))
211#endif
212
213#if defined(_LARGEFILE64_SOURCE) && !defined(OFF64_T_MAX)
214#define OFF64_T_MAX ((off64_t) ~(((uint64_t) 1) << (8 * sizeof(off64_t) - 1)))
215#endif
216
217#endif 209#endif
diff --git a/src/microhttpd/MHD_limits.h b/src/microhttpd/MHD_limits.h
new file mode 100644
index 00000000..e809feff
--- /dev/null
+++ b/src/microhttpd/MHD_limits.h
@@ -0,0 +1,49 @@
1/*
2 This file is part of libmicrohttpd
3 Copyright (C) 2015 Karlson2k (Evgeny Grin)
4
5 This library is free software; you can redistribute it and/or
6 modify it under the terms of the GNU Lesser General Public
7 License as published by the Free Software Foundation; either
8 version 2.1 of the License, or (at your option) any later version.
9
10 This library is distributed in the hope that it will be useful,
11 but WITHOUT ANY WARRANTY; without even the implied warranty of
12 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
13 Lesser General Public License for more details.
14
15 You should have received a copy of the GNU Lesser General Public
16 License along with this library; if not, write to the Free Software
17 Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
18*/
19
20/**
21 * @file microhttpd/MHD_limits.h
22 * @brief limits values definitions
23 * @author Karlson2k (Evgeny Grin)
24 */
25
26#ifndef MHD_LIMITS_H
27#define MHD_LIMITS_H
28
29#include "platform.h"
30
31#ifdef HAVE_LIMITS_H
32#include <limits.h>
33#endif /* HAVE_LIMITS_H */
34
35
36#ifndef INT32_MAX
37#define INT32_MAX ((int32_t)0x7FFFFFFF)
38#endif /* !INT32_MAX */
39
40#ifndef OFF_T_MAX
41#define OFF_T_MAX ((off_t) ~(((uint64_t) 1) << (8 * sizeof(off_t) - 1)))
42#endif /* !OFF_T_MAX */
43
44#if defined(_LARGEFILE64_SOURCE) && !defined(OFF64_T_MAX)
45#define OFF64_T_MAX ((off64_t) ~(((uint64_t) 1) << (8 * sizeof(off64_t) - 1)))
46#endif /* _LARGEFILE64_SOURCE && !OFF64_T_MAX */
47
48
49#endif /* MHD_LIMITS_H */
diff --git a/src/microhttpd/daemon.c b/src/microhttpd/daemon.c
index 3fb8d753..da8477e4 100644
--- a/src/microhttpd/daemon.c
+++ b/src/microhttpd/daemon.c
@@ -36,7 +36,7 @@
36#include "response.h" 36#include "response.h"
37#include "connection.h" 37#include "connection.h"
38#include "memorypool.h" 38#include "memorypool.h"
39#include <limits.h> 39#include "MHD_limits.h"
40#include "autoinit_funcs.h" 40#include "autoinit_funcs.h"
41 41
42#if HAVE_SEARCH_H 42#if HAVE_SEARCH_H
@@ -117,10 +117,6 @@
117#define EPOLL_CLOEXEC 0 117#define EPOLL_CLOEXEC 0
118#endif 118#endif
119 119
120#ifndef INT32_MAX
121#define INT32_MAX ((int32_t)0x7FFFFFFF)
122#endif /* !INT32_MAX */
123
124 120
125/** 121/**
126 * Default implementation of the panic function, 122 * Default implementation of the panic function,
diff --git a/src/microhttpd/response.c b/src/microhttpd/response.c
index cff5e5dc..a5ea15e0 100644
--- a/src/microhttpd/response.c
+++ b/src/microhttpd/response.c
@@ -28,7 +28,7 @@
28 28
29#include "internal.h" 29#include "internal.h"
30#include "response.h" 30#include "response.h"
31#include <limits.h> 31#include "MHD_limits.h"
32 32
33#if defined(_WIN32) && defined(MHD_W32_MUTEX_) 33#if defined(_WIN32) && defined(MHD_W32_MUTEX_)
34#ifndef WIN32_LEAN_AND_MEAN 34#ifndef WIN32_LEAN_AND_MEAN
@@ -305,10 +305,6 @@ MHD_set_response_options (struct MHD_Response *response,
305} 305}
306 306
307 307
308#ifndef INT32_MAX
309#define INT32_MAX ((int32_t)0x7FFFFFFF)
310#endif /* !INT32_MAX */
311
312/** 308/**
313 * Given a file descriptor, read data from the file 309 * Given a file descriptor, read data from the file
314 * to generate the response. 310 * to generate the response.
diff --git a/w32/VS2013/libmicrohttpd.vcxproj b/w32/VS2013/libmicrohttpd.vcxproj
index 827f9b35..08e1c7e1 100644
--- a/w32/VS2013/libmicrohttpd.vcxproj
+++ b/w32/VS2013/libmicrohttpd.vcxproj
@@ -92,6 +92,7 @@
92 <ClInclude Include="..\..\src\microhttpd\internal.h" /> 92 <ClInclude Include="..\..\src\microhttpd\internal.h" />
93 <ClInclude Include="..\..\src\microhttpd\md5.h" /> 93 <ClInclude Include="..\..\src\microhttpd\md5.h" />
94 <ClInclude Include="..\..\src\microhttpd\memorypool.h" /> 94 <ClInclude Include="..\..\src\microhttpd\memorypool.h" />
95 <ClInclude Include="..\..\src\microhttpd\MHD_limits.h" />
95 <ClInclude Include="..\..\src\microhttpd\reason_phrase.h" /> 96 <ClInclude Include="..\..\src\microhttpd\reason_phrase.h" />
96 <ClInclude Include="..\..\src\microhttpd\response.h" /> 97 <ClInclude Include="..\..\src\microhttpd\response.h" />
97 <ClInclude Include="..\..\src\microhttpd\tsearch.h" /> 98 <ClInclude Include="..\..\src\microhttpd\tsearch.h" />
diff --git a/w32/VS2013/libmicrohttpd.vcxproj.filters b/w32/VS2013/libmicrohttpd.vcxproj.filters
index cbe63801..4785328f 100644
--- a/w32/VS2013/libmicrohttpd.vcxproj.filters
+++ b/w32/VS2013/libmicrohttpd.vcxproj.filters
@@ -105,6 +105,9 @@
105 <ClInclude Include="..\..\src\include\autoinit_funcs.h"> 105 <ClInclude Include="..\..\src\include\autoinit_funcs.h">
106 <Filter>Header Files</Filter> 106 <Filter>Header Files</Filter>
107 </ClInclude> 107 </ClInclude>
108 <ClInclude Include="..\..\src\microhttpd\MHD_limits.h">
109 <Filter>Source Files</Filter>
110 </ClInclude>
108 </ItemGroup> 111 </ItemGroup>
109 <ItemGroup> 112 <ItemGroup>
110 <ResourceCompile Include="microhttpd_dll_res_vc.rc"> 113 <ResourceCompile Include="microhttpd_dll_res_vc.rc">