aboutsummaryrefslogtreecommitdiff
path: root/src/lib/mhd_limits.h
diff options
context:
space:
mode:
Diffstat (limited to 'src/lib/mhd_limits.h')
-rw-r--r--src/lib/mhd_limits.h38
1 files changed, 19 insertions, 19 deletions
diff --git a/src/lib/mhd_limits.h b/src/lib/mhd_limits.h
index 41d33a8f..87b41447 100644
--- a/src/lib/mhd_limits.h
+++ b/src/lib/mhd_limits.h
@@ -32,17 +32,17 @@
32#include <limits.h> 32#include <limits.h>
33#endif /* HAVE_LIMITS_H */ 33#endif /* HAVE_LIMITS_H */
34 34
35#define MHD_UNSIGNED_TYPE_MAX_(type) ((type)-1) 35#define MHD_UNSIGNED_TYPE_MAX_(type) ((type) - 1)
36/* Assume 8 bits per byte, no padding bits. */ 36/* Assume 8 bits per byte, no padding bits. */
37#define MHD_SIGNED_TYPE_MAX_(type) \ 37#define MHD_SIGNED_TYPE_MAX_(type) \
38 ( (type)((( ((type)1) << (sizeof(type)*8 - 2)) - 1)*2 + 1) ) 38 ( (type) ((( ((type) 1) << (sizeof(type) * 8 - 2)) - 1) * 2 + 1) )
39#define MHD_TYPE_IS_SIGNED_(type) (((type)0)>((type)-1)) 39#define MHD_TYPE_IS_SIGNED_(type) (((type) 0)>((type) - 1))
40 40
41#ifndef UINT_MAX 41#ifndef UINT_MAX
42#ifdef __UINT_MAX__ 42#ifdef __UINT_MAX__
43#define UINT_MAX __UINT_MAX__ 43#define UINT_MAX __UINT_MAX__
44#else /* ! __UINT_MAX__ */ 44#else /* ! __UINT_MAX__ */
45#define UINT_MAX MHD_UNSIGNED_TYPE_MAX_(unsigned int) 45#define UINT_MAX MHD_UNSIGNED_TYPE_MAX_ (unsigned int)
46#endif /* ! __UINT_MAX__ */ 46#endif /* ! __UINT_MAX__ */
47#endif /* !UINT_MAX */ 47#endif /* !UINT_MAX */
48 48
@@ -50,19 +50,19 @@
50#ifdef __LONG_MAX__ 50#ifdef __LONG_MAX__
51#define LONG_MAX __LONG_MAX__ 51#define LONG_MAX __LONG_MAX__
52#else /* ! __LONG_MAX__ */ 52#else /* ! __LONG_MAX__ */
53#define LONG_MAX MHD_SIGNED_TYPE_MAX(long) 53#define LONG_MAX MHD_SIGNED_TYPE_MAX (long)
54#endif /* ! __LONG_MAX__ */ 54#endif /* ! __LONG_MAX__ */
55#endif /* !OFF_T_MAX */ 55#endif /* !OFF_T_MAX */
56 56
57#ifndef ULLONG_MAX 57#ifndef ULLONG_MAX
58#define ULLONG_MAX MHD_UNSIGNED_TYPE_MAX_(MHD_UNSIGNED_LONG_LONG) 58#define ULLONG_MAX MHD_UNSIGNED_TYPE_MAX_ (MHD_UNSIGNED_LONG_LONG)
59#endif /* !ULLONG_MAX */ 59#endif /* !ULLONG_MAX */
60 60
61#ifndef INT32_MAX 61#ifndef INT32_MAX
62#ifdef __INT32_MAX__ 62#ifdef __INT32_MAX__
63#define INT32_MAX __INT32_MAX__ 63#define INT32_MAX __INT32_MAX__
64#else /* ! __INT32_MAX__ */ 64#else /* ! __INT32_MAX__ */
65#define INT32_MAX ((int32_t)0x7FFFFFFF) 65#define INT32_MAX ((int32_t) 0x7FFFFFFF)
66#endif /* ! __INT32_MAX__ */ 66#endif /* ! __INT32_MAX__ */
67#endif /* !INT32_MAX */ 67#endif /* !INT32_MAX */
68 68
@@ -70,7 +70,7 @@
70#ifdef __UINT32_MAX__ 70#ifdef __UINT32_MAX__
71#define UINT32_MAX __UINT32_MAX__ 71#define UINT32_MAX __UINT32_MAX__
72#else /* ! __UINT32_MAX__ */ 72#else /* ! __UINT32_MAX__ */
73#define UINT32_MAX ((int32_t)0xFFFFFFFF) 73#define UINT32_MAX ((int32_t) 0xFFFFFFFF)
74#endif /* ! __UINT32_MAX__ */ 74#endif /* ! __UINT32_MAX__ */
75#endif /* !UINT32_MAX */ 75#endif /* !UINT32_MAX */
76 76
@@ -78,7 +78,7 @@
78#ifdef __UINT64_MAX__ 78#ifdef __UINT64_MAX__
79#define UINT64_MAX __UINT64_MAX__ 79#define UINT64_MAX __UINT64_MAX__
80#else /* ! __UINT64_MAX__ */ 80#else /* ! __UINT64_MAX__ */
81#define UINT64_MAX ((uint64_t)0xFFFFFFFFFFFFFFFF) 81#define UINT64_MAX ((uint64_t) 0xFFFFFFFFFFFFFFFF)
82#endif /* ! __UINT64_MAX__ */ 82#endif /* ! __UINT64_MAX__ */
83#endif /* !UINT64_MAX */ 83#endif /* !UINT64_MAX */
84 84
@@ -86,7 +86,7 @@
86#ifdef __INT64_MAX__ 86#ifdef __INT64_MAX__
87#define INT64_MAX __INT64_MAX__ 87#define INT64_MAX __INT64_MAX__
88#else /* ! __INT64_MAX__ */ 88#else /* ! __INT64_MAX__ */
89#define INT64_MAX ((int64_t)0x7FFFFFFFFFFFFFFF) 89#define INT64_MAX ((int64_t) 0x7FFFFFFFFFFFFFFF)
90#endif /* ! __UINT64_MAX__ */ 90#endif /* ! __UINT64_MAX__ */
91#endif /* !INT64_MAX */ 91#endif /* !INT64_MAX */
92 92
@@ -96,8 +96,8 @@
96#elif defined(UINTPTR_MAX) 96#elif defined(UINTPTR_MAX)
97#define SIZE_MAX UINTPTR_MAX 97#define SIZE_MAX UINTPTR_MAX
98#else /* ! __SIZE_MAX__ */ 98#else /* ! __SIZE_MAX__ */
99#define SIZE_MAX MHD_UNSIGNED_TYPE_MAX_(size_t) 99#define SIZE_MAX MHD_UNSIGNED_TYPE_MAX_ (size_t)
100#endif /* ! __SIZE_MAX__ */ 100#endif /* ! __SIZE_MAX__ */
101#endif /* !SIZE_MAX */ 101#endif /* !SIZE_MAX */
102 102
103#ifndef SSIZE_MAX 103#ifndef SSIZE_MAX
@@ -108,7 +108,7 @@
108#elif defined(INTPTR_MAX) 108#elif defined(INTPTR_MAX)
109#define SSIZE_MAX INTPTR_MAX 109#define SSIZE_MAX INTPTR_MAX
110#else 110#else
111#define SSIZE_MAN MHD_SIGNED_TYPE_MAX_(ssize_t) 111#define SSIZE_MAN MHD_SIGNED_TYPE_MAX_ (ssize_t)
112#endif 112#endif
113#endif /* ! SSIZE_MAX */ 113#endif /* ! SSIZE_MAX */
114 114
@@ -120,19 +120,19 @@
120#elif defined(__APPLE__) && defined(__MACH__) 120#elif defined(__APPLE__) && defined(__MACH__)
121#define OFF_T_MAX INT64_MAX 121#define OFF_T_MAX INT64_MAX
122#else 122#else
123#define OFF_T_MAX MHD_SIGNED_TYPE_MAX_(off_t) 123#define OFF_T_MAX MHD_SIGNED_TYPE_MAX_ (off_t)
124#endif 124#endif
125#endif /* !OFF_T_MAX */ 125#endif /* !OFF_T_MAX */
126 126
127#if defined(_LARGEFILE64_SOURCE) && !defined(OFF64_T_MAX) 127#if defined(_LARGEFILE64_SOURCE) && ! defined(OFF64_T_MAX)
128#define OFF64_T_MAX MHD_SIGNED_TYPE_MAX_(uint64_t) 128#define OFF64_T_MAX MHD_SIGNED_TYPE_MAX_ (uint64_t)
129#endif /* _LARGEFILE64_SOURCE && !OFF64_T_MAX */ 129#endif /* _LARGEFILE64_SOURCE && !OFF64_T_MAX */
130 130
131#ifndef TIME_T_MAX 131#ifndef TIME_T_MAX
132#define TIME_T_MAX ((time_t) \ 132#define TIME_T_MAX ((time_t) \
133 ( MHD_TYPE_IS_SIGNED_(time_t) ? \ 133 (MHD_TYPE_IS_SIGNED_ (time_t) ? \
134 MHD_SIGNED_TYPE_MAX_(time_t) : \ 134 MHD_SIGNED_TYPE_MAX_ (time_t) : \
135 MHD_UNSIGNED_TYPE_MAX_(time_t))) 135 MHD_UNSIGNED_TYPE_MAX_ (time_t)))
136#endif /* !TIME_T_MAX */ 136#endif /* !TIME_T_MAX */
137 137
138#ifndef TIMEVAL_TV_SEC_MAX 138#ifndef TIMEVAL_TV_SEC_MAX