Maipa's Standard Library Extension 1.5.6
mstd
Loading...
Searching...
No Matches
config.hpp
1/*
2 * mstd - Maipa's Standard Library
3 *
4 * Licensed under the BSD 3-Clause License with Attribution Requirement.
5 * See the LICENSE file for details: https://github.com/MAIPA01/mstd/blob/main/LICENSE
6 *
7 * Copyright (c) 2025, Patryk Antosik (MAIPA01)
8 */
9
10#pragma once
11#ifndef _MSTD_CONFIG_HPP
12 #define _MSTD_CONFIG_HPP
13
14 #pragma region VERSION
15 #define MSTD_VERSION_MAJOR 1
16 #define MSTD_VERSION_MINOR 5
17 #define MSTD_VERSION_PATCH 6
18
19 #define _MSTD_STRINGIFY_HELPER(x) #x
20
21 #define _MSTD_VERSION_TO_STRING(major, minor, patch)
23 #define _MSTD_VERSION_TO_INT(major, minor, patch) (major * 100 + minor * 10 + patch)
24
27 #define MSTD_VERSION MSTD_VERSION_STRING
28 #pragma endregion
29
30 #pragma region LAST_UPDATE
31 #define MSTD_LAST_UPDATE_DAY 19
32 #define MSTD_LAST_UPDATE_MONTH 05
33 #define MSTD_LAST_UPDATE_YEAR 2026
34
35 #define _MSTD_LAST_UPDATE_DATE_HELPER(day, month, year)
37
38 #define MSTD_LAST_UPDATE_DATE
40 #pragma endregion
41
42 #pragma region VERSION_CHECKS
43 #ifndef _HAS_CXX17
44 // clang-format off
45 #define _MSTD_HAS_CXX17 __cplusplus >= 201703l
46 // clang-format on
47 #else
48 #define _MSTD_HAS_CXX17 _HAS_CXX17
49 #endif
50
51 #ifndef MSTD_ENABLE_CXX20
52 #define _MSTD_HAS_CXX20 0
53 #elif !defined(_HAS_CXX20)
54 // clang-format off
55 #define _MSTD_HAS_CXX20 (__cplusplus >= 202002l)
56 // clang-format on
57 #else
58 #define _MSTD_HAS_CXX20 _HAS_CXX20
59 #endif
60 #pragma endregion
61
62 #pragma region PRAGMA_MESSAGES
63 #define _MSTD_STRINGIZE_(S) #S
64 #define _MSTD_STRINGIZE(S) _MSTD_STRINGIZE_(S)
65
66 #define _MSTD_PRAGMA(PRAGMA) _Pragma(#PRAGMA)
67 #define _MSTD_PRAGMA_MESSAGE(MESSAGE) _MSTD_PRAGMA(message(MESSAGE))
68 #define _MSTD_MESSAGE(MESSAGE) _MSTD_PRAGMA_MESSAGE(__FILE__ "(" _MSTD_STRINGIZE(__LINE__) "): " MESSAGE)
69
70 #define _MSTD_WARNING(MESSAGE) _MSTD_MESSAGE("warning: " MESSAGE)
71 #define _MSTD_ERROR(MESSAGE) static_assert(false, "error: " MESSAGE)
72 #pragma endregion
73
74 #pragma region VERSION_DEPENDENT
76 #define _MSTD_CONSTEXPR17 constexpr
77 #else
78 #define _MSTD_CONSTEXPR17
79 #endif
80
82 #define _MSTD_TYPENAME17
83 #define _MSTD_INLINE17
84 #define _MSTD_CONSTEXPR20 constexpr
85 #define _MSTD_RETURN_VALUE_IF(condition, ...) __VA_ARGS__
86 #define _MSTD_REQUIRES(condition) requires (condition)
87 #define _MSTD_ENABLE_IF_TEMPLATE(class_name, condition)
88 #else
89 #define _MSTD_TYPENAME17 typename
90 #define _MSTD_INLINE17 inline
91 #define _MSTD_CONSTEXPR20
92 #define _MSTD_RETURN_VALUE_IF(condition, ...) typename std::enable_if_t<(condition), __VA_ARGS__>
93 #define _MSTD_REQUIRES(condition)
94 #define _MSTD_ENABLE_IF_TEMPLATE(class_name, condition)
95 template<class class_name, std::enable_if_t<(condition), bool> = true>
96 #endif
97 #pragma endregion
98
99#endif
#define _MSTD_STRINGIZE_(S)
Definition config.hpp:63
#define _MSTD_VERSION_TO_STRING(major, minor, patch)
Definition config.hpp:21
#define _MSTD_MESSAGE(MESSAGE)
Definition config.hpp:68
#define MSTD_LAST_UPDATE_MONTH
Definition config.hpp:32
#define _MSTD_HAS_CXX17
Definition config.hpp:45
#define _MSTD_VERSION_TO_INT(major, minor, patch)
Definition config.hpp:23
#define MSTD_LAST_UPDATE_YEAR
Definition config.hpp:33
#define _MSTD_STRINGIFY_HELPER(x)
Definition config.hpp:19
#define MSTD_VERSION_PATCH
Definition config.hpp:17
#define _MSTD_STRINGIZE(S)
Definition config.hpp:64
#define MSTD_VERSION_MINOR
Definition config.hpp:16
#define _MSTD_HAS_CXX20
Definition config.hpp:52
#define MSTD_VERSION_MAJOR
Definition config.hpp:15
#define _MSTD_PRAGMA(PRAGMA)
Definition config.hpp:66
#define _MSTD_LAST_UPDATE_DATE_HELPER(day, month, year)
Definition config.hpp:35
#define _MSTD_PRAGMA_MESSAGE(MESSAGE)
Definition config.hpp:67
#define MSTD_LAST_UPDATE_DAY
Definition config.hpp:31
#define MSTD_VERSION_STRING
Definition config.hpp:25