GMP 0.4.0
Generative Metaprogramming library for C++
Loading...
Searching...
No Matches
config.hpp
Go to the documentation of this file.
1// ___ __ __ ___
2// / __| \/ | _ \ GMP(Generative Metaprogramming)
3// | (_ | |\/| | _/ version 0.4.0
4// \___|_| |_|_| https://github.com/lkimuk/gmp
5//
6// SPDX-FileCopyrightText: 2023-2026 Miles Li <https://www.cppmore.com/>
7// SPDX-License-Identifier: MIT
8//
9// This file is part of the GMP (Generative Metaprogramming) library.
10// Full project source: https://github.com/lkimuk/gmp
11
12#ifndef GMP_META_CONFIG_HPP_
13#define GMP_META_CONFIG_HPP_
14
16
17#if GMP_STANDARD_PREPROCESSOR
18 // Standard preprocessor supports 256 arguments
19 #define GMP_DETAIL_PLATFORM_MAX_FIELDS 255
20#else
21 // MSVC traditional preprocessor: MAX 199 due to nesting depth limit (fatal error C1009)
22 #define GMP_DETAIL_PLATFORM_MAX_FIELDS 118
23#endif
24
25#ifndef GMP_MAX_SUPPORTED_FIELDS
26 #define GMP_MAX_SUPPORTED_FIELDS GMP_DETAIL_PLATFORM_MAX_FIELDS
27#endif
28
29#if GMP_MAX_SUPPORTED_FIELDS < 1
30 #error "GMP_MAX_SUPPORTED_FIELDS must be at least 1."
31#endif
32
33#if GMP_MAX_SUPPORTED_FIELDS > GMP_DETAIL_PLATFORM_MAX_FIELDS
34 #error "GMP_MAX_SUPPORTED_FIELDS exceeds the maximum supported by the platform."
35#endif
36
37#endif // GMP_META_CONFIG_HPP_