aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorEvgeny Grin (Karlson2k) <k2k@narod.ru>2015-07-07 18:32:33 +0000
committerEvgeny Grin (Karlson2k) <k2k@narod.ru>2015-07-07 18:32:33 +0000
commit2c842e6b95498e1dc56584b7e0c1570b9cd0792c (patch)
treec635986412eb76f04bcf317a99b0540192a803fb /src
parent4a251757ab5c98c9d747e73f310d0c28cf991b05 (diff)
downloadlibmicrohttpd-2c842e6b95498e1dc56584b7e0c1570b9cd0792c.tar.gz
libmicrohttpd-2c842e6b95498e1dc56584b7e0c1570b9cd0792c.zip
Move all internal limits definitions to MHD_limits.h
Diffstat (limited to 'src')
-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
4 files changed, 51 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.