tetl
0.1.0
Embedded Template Library
Loading...
Searching...
No Matches
defines.hpp
Go to the documentation of this file.
1
// SPDX-License-Identifier: BSL-1.0
2
// SPDX-FileCopyrightText: Copyright (C) 2019 Tobias Hienzsch
3
4
#
ifndef
TETL_CLIMITS_DEFINES_HPP
5
#
define
TETL_CLIMITS_DEFINES_HPP
6
7
#
if
__has_include
(
<
limits
.
h
>
)
8
#
include
<
limits
.
h
>
9
#
else
10
11
#
ifndef
MB_LEN_MAX
12
#
define
MB_LEN_MAX
1
13
#
endif
14
15
#
define
CHAR_BIT
__CHAR_BIT__
16
17
#
ifdef
__CHAR_UNSIGNED__
18
#
define
CHAR_MIN
0
19
#
define
CHAR_MAX
UCHAR_MAX
20
#
else
21
#
define
CHAR_MIN
SCHAR_MIN
22
#
define
CHAR_MAX
__SCHAR_MAX__
23
#
endif
24
25
#
define
SCHAR_MAX
__SCHAR_MAX__
26
#
define
SHRT_MAX
__SHRT_MAX__
27
#
define
INT_MAX
__INT_MAX__
28
#
define
LONG_MAX
__LONG_MAX__
29
30
#
define
SCHAR_MIN
(
-
__SCHAR_MAX__
-
1
)
31
#
define
SHRT_MIN
(
-
__SHRT_MAX__
-
1
)
32
#
define
INT_MIN
(
-
__INT_MAX__
-
1
)
33
#
define
LONG_MIN
(
-
__LONG_MAX__
-
1L
)
34
35
#
define
UCHAR_MAX
(
static_cast
<
unsigned
char
>
(
__SCHAR_MAX__
)
*
2
+
1
)
36
#
define
USHRT_MAX
(
static_cast
<
unsigned
short
>
(
__SHRT_MAX__
)
*
2
+
1
)
37
#
define
UINT_MAX
(
__INT_MAX__
*
2U
+
1U
)
38
#
define
ULONG_MAX
(
__LONG_MAX__
*
2UL
+
1UL
)
39
40
#
if
__STDC_VERSION__
>=
199901L
||
__cplusplus
>=
201103L
41
#
undef
LLONG_MIN
42
#
undef
LLONG_MAX
43
#
undef
ULLONG_MAX
44
#
define
LLONG_MAX
__LONG_LONG_MAX__
45
#
define
LLONG_MIN
(
-
__LONG_LONG_MAX__
-
1LL
)
46
#
define
ULLONG_MAX
(
__LONG_LONG_MAX__
*
2ULL
+
1ULL
)
47
#
endif
48
49
#
endif
// has_include <limits.h>
50
51
#
endif
// TETL_CLIMITS_DEFINES_HPP
include
etl
_climits
defines.hpp
Generated on Sun Sep 7 2025 19:14:49 for tetl by
1.9.8