CNL  2.0.2 (development)
Compositional Numeric Library
macros.h
Go to the documentation of this file.
1 
2 // Copyright John McFarlane 2021.
3 // Distributed under the Boost Software License, Version 1.0.
4 // (See accompanying file ../LICENSE_1_0.txt or copy at
5 // http://www.boost.org/LICENSE_1_0.txt)
6 
9 
10 #if !defined(CNL_IMPL_CSTDINT_MACROS_H)
11 #define CNL_IMPL_CSTDINT_MACROS_H
12 
13 #include "../config.h"
14 #include "../parse.h"
15 #include "types.h"
16 
17 #include <cstdint>
18 
20 // CNL_INTMAX_C and CNL_UINTMAX_C
21 
22 #if defined(CNL_INT128_ENABLED)
23 
24 // NOLINTNEXTLINE(cppcoreguidelines-macro-usage)
25 #define CNL_INTMAX_C(N) (::cnl::_impl::parse<::cnl::intmax_t>(CNL_STR(N)))
26 
27 // NOLINTNEXTLINE(cppcoreguidelines-macro-usage)
28 #define CNL_UINTMAX_C(N) (::cnl::_impl::parse<::cnl::uintmax_t>(CNL_STR(N)))
29 
30 #else
31 
32 // NOLINTNEXTLINE(cppcoreguidelines-macro-usage)
33 #define CNL_INTMAX_C INTMAX_C
34 
35 // NOLINTNEXTLINE(cppcoreguidelines-macro-usage)
36 #define CNL_UINTMAX_C UINTMAX_C
37 
38 #endif
39 
40 #endif // CNL_IMPL_CSTDINT_MACROS_H
types.h
fixed-width integer types equivalent to those in