aboutsummaryrefslogtreecommitdiff
path: root/src/microhttpd/mhd_limits.h
diff options
context:
space:
mode:
authorEvgeny Grin (Karlson2k) <k2k@narod.ru>2015-08-22 15:45:36 +0000
committerEvgeny Grin (Karlson2k) <k2k@narod.ru>2015-08-22 15:45:36 +0000
commit0d2688a98bfc4f32b393fc581ec04e97d9b11449 (patch)
tree51509e78f003722145a051f86b10368bc7ede2cd /src/microhttpd/mhd_limits.h
parent4680ad00f7441d6b40e2310700a4bab18048bcad (diff)
downloadlibmicrohttpd-0d2688a98bfc4f32b393fc581ec04e97d9b11449.tar.gz
libmicrohttpd-0d2688a98bfc4f32b393fc581ec04e97d9b11449.zip
fix file names, include missing files to Makefile
Diffstat (limited to 'src/microhttpd/mhd_limits.h')
-rw-r--r--src/microhttpd/mhd_limits.h73
1 files changed, 73 insertions, 0 deletions
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 @@
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#ifndef LONG_MAX
36#define LONG_MAX ((long) ~(((uint64_t) 1) << (8 * sizeof(long) - 1)))
37#endif /* !OFF_T_MAX */
38
39#ifndef ULLONG_MAX
40#define ((MHD_UNSIGNED_LONG_LONG) ~((MHD_UNSIGNED_LONG_LONG)0))
41#endif /* !ULLONG_MAX */
42
43#ifndef INT32_MAX
44#define INT32_MAX ((int32_t)0x7FFFFFFF)
45#endif /* !INT32_MAX */
46
47#ifndef SIZE_MAX
48#define SIZE_MAX ((size_t) ~((size_t)0))
49#endif /* !SIZE_MAX */
50
51#ifndef OFF_T_MAX
52#define OFF_T_MAX ((off_t) ~(((uint64_t) 1) << (8 * sizeof(off_t) - 1)))
53#endif /* !OFF_T_MAX */
54
55#if defined(_LARGEFILE64_SOURCE) && !defined(OFF64_T_MAX)
56#define OFF64_T_MAX ((off64_t) ~(((uint64_t) 1) << (8 * sizeof(off64_t) - 1)))
57#endif /* _LARGEFILE64_SOURCE && !OFF64_T_MAX */
58
59#ifndef TIME_T_MAX
60/* Assume that time_t is signed type. */
61/* Even if time_t is unsigned, TIME_T_MAX will be safe limit */
62#define TIME_T_MAX ( (time_t) ~(((uint64_t) 1) << (8 * sizeof(time_t) - 1)) )
63#endif /* !TIME_T_MAX */
64
65#ifndef TIMEVAL_TV_SEC_MAX
66#ifndef _WIN32
67#define TIMEVAL_TV_SEC_MAX TIME_T_MAX
68#else /* _WIN32 */
69#define TIMEVAL_TV_SEC_MAX LONG_MAX
70#endif /* _WIN32 */
71#endif /* !TIMEVAL_TV_SEC_MAX */
72
73#endif /* MHD_LIMITS_H */