minor preprocessor cleanup
This commit is contained in:
parent
ee9b30c774
commit
f1664fa068
@ -17,7 +17,7 @@
|
|||||||
#define TOML_ALL_INLINE 1
|
#define TOML_ALL_INLINE 1
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#if defined(TOML_IMPLEMENTATION) || TOML_ALL_INLINE
|
#if defined(TOML_IMPLEMENTATION) || TOML_ALL_INLINE || defined(__INTELLISENSE__)
|
||||||
#undef TOML_IMPLEMENTATION
|
#undef TOML_IMPLEMENTATION
|
||||||
#define TOML_IMPLEMENTATION 1
|
#define TOML_IMPLEMENTATION 1
|
||||||
#else
|
#else
|
||||||
@ -57,13 +57,6 @@
|
|||||||
#ifndef __cplusplus
|
#ifndef __cplusplus
|
||||||
#error toml++ is a C++ library.
|
#error toml++ is a C++ library.
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#if defined(__clang__) || defined(__GNUC__)
|
|
||||||
#define TOML_GCC_ATTR(attr) __attribute__((attr))
|
|
||||||
#else
|
|
||||||
#define TOML_GCC_ATTR(attr)
|
|
||||||
#endif
|
|
||||||
|
|
||||||
#ifdef __clang__
|
#ifdef __clang__
|
||||||
|
|
||||||
#define TOML_PUSH_WARNINGS _Pragma("clang diagnostic push")
|
#define TOML_PUSH_WARNINGS _Pragma("clang diagnostic push")
|
||||||
@ -71,14 +64,17 @@
|
|||||||
#define TOML_DISABLE_INIT_WARNINGS _Pragma("clang diagnostic ignored \"-Wmissing-field-initializers\"")
|
#define TOML_DISABLE_INIT_WARNINGS _Pragma("clang diagnostic ignored \"-Wmissing-field-initializers\"")
|
||||||
#define TOML_DISABLE_ALL_WARNINGS _Pragma("clang diagnostic ignored \"-Weverything\"")
|
#define TOML_DISABLE_ALL_WARNINGS _Pragma("clang diagnostic ignored \"-Weverything\"")
|
||||||
#define TOML_POP_WARNINGS _Pragma("clang diagnostic pop")
|
#define TOML_POP_WARNINGS _Pragma("clang diagnostic pop")
|
||||||
|
#define TOML_GCC_ATTR(attr) __attribute__((attr))
|
||||||
#define TOML_ALWAYS_INLINE TOML_GCC_ATTR(__always_inline__) inline
|
#define TOML_ALWAYS_INLINE TOML_GCC_ATTR(__always_inline__) inline
|
||||||
#define TOML_ASSUME(cond) __builtin_assume(cond)
|
#define TOML_ASSUME(cond) __builtin_assume(cond)
|
||||||
#define TOML_UNREACHABLE __builtin_unreachable()
|
#define TOML_UNREACHABLE __builtin_unreachable()
|
||||||
#if __has_declspec_attribute(novtable)
|
#if defined(_MSC_VER) && defined(__has_declspec_attribute)
|
||||||
#define TOML_INTERFACE __declspec(novtable)
|
#if __has_declspec_attribute(novtable)
|
||||||
#endif
|
#define TOML_INTERFACE __declspec(novtable)
|
||||||
#if __has_declspec_attribute(empty_bases)
|
#endif
|
||||||
#define TOML_EMPTY_BASES __declspec(empty_bases)
|
#if __has_declspec_attribute(empty_bases)
|
||||||
|
#define TOML_EMPTY_BASES __declspec(empty_bases)
|
||||||
|
#endif
|
||||||
#endif
|
#endif
|
||||||
#ifdef __EXCEPTIONS
|
#ifdef __EXCEPTIONS
|
||||||
#define TOML_COMPILER_EXCEPTIONS 1
|
#define TOML_COMPILER_EXCEPTIONS 1
|
||||||
@ -121,6 +117,7 @@
|
|||||||
_Pragma("GCC diagnostic ignored \"-Wchar-subscripts\"") \
|
_Pragma("GCC diagnostic ignored \"-Wchar-subscripts\"") \
|
||||||
_Pragma("GCC diagnostic ignored \"-Wtype-limits\"")
|
_Pragma("GCC diagnostic ignored \"-Wtype-limits\"")
|
||||||
#define TOML_POP_WARNINGS _Pragma("GCC diagnostic pop")
|
#define TOML_POP_WARNINGS _Pragma("GCC diagnostic pop")
|
||||||
|
#define TOML_GCC_ATTR(attr) __attribute__((attr))
|
||||||
#define TOML_ALWAYS_INLINE TOML_GCC_ATTR(__always_inline__) inline
|
#define TOML_ALWAYS_INLINE TOML_GCC_ATTR(__always_inline__) inline
|
||||||
#define TOML_UNREACHABLE __builtin_unreachable()
|
#define TOML_UNREACHABLE __builtin_unreachable()
|
||||||
#if !defined(TOML_RELOPS_REORDERING) && defined(__cpp_impl_three_way_comparison)
|
#if !defined(TOML_RELOPS_REORDERING) && defined(__cpp_impl_three_way_comparison)
|
||||||
@ -152,7 +149,7 @@
|
|||||||
#define TOML_CPP 26
|
#define TOML_CPP 26
|
||||||
#elif TOML_CPP_VERSION >= 202300L
|
#elif TOML_CPP_VERSION >= 202300L
|
||||||
#define TOML_CPP 23
|
#define TOML_CPP 23
|
||||||
#elif TOML_CPP_VERSION >= 202000L
|
#elif TOML_CPP_VERSION >= 202002L
|
||||||
#define TOML_CPP 20
|
#define TOML_CPP 20
|
||||||
#elif TOML_CPP_VERSION >= 201703L
|
#elif TOML_CPP_VERSION >= 201703L
|
||||||
#define TOML_CPP 17
|
#define TOML_CPP 17
|
||||||
@ -198,6 +195,9 @@
|
|||||||
#ifndef TOML_POP_WARNINGS
|
#ifndef TOML_POP_WARNINGS
|
||||||
#define TOML_POP_WARNINGS
|
#define TOML_POP_WARNINGS
|
||||||
#endif
|
#endif
|
||||||
|
#ifndef TOML_GCC_ATTR
|
||||||
|
#define TOML_GCC_ATTR(attr)
|
||||||
|
#endif
|
||||||
#ifndef TOML_INTERFACE
|
#ifndef TOML_INTERFACE
|
||||||
#define TOML_INTERFACE
|
#define TOML_INTERFACE
|
||||||
#endif
|
#endif
|
||||||
|
@ -6,7 +6,7 @@
|
|||||||
|
|
||||||
#define TOML_LIB_MAJOR 0
|
#define TOML_LIB_MAJOR 0
|
||||||
#define TOML_LIB_MINOR 5
|
#define TOML_LIB_MINOR 5
|
||||||
#define TOML_LIB_PATCH 0
|
#define TOML_LIB_PATCH 1
|
||||||
|
|
||||||
#define TOML_LANG_MAJOR 0
|
#define TOML_LANG_MAJOR 0
|
||||||
#define TOML_LANG_MINOR 5
|
#define TOML_LANG_MINOR 5
|
||||||
|
@ -1,7 +1,7 @@
|
|||||||
project(
|
project(
|
||||||
'tomlplusplus',
|
'tomlplusplus',
|
||||||
'cpp',
|
'cpp',
|
||||||
version : '0.5.0',
|
version : '0.5.1',
|
||||||
license : 'MIT',
|
license : 'MIT',
|
||||||
default_options : [
|
default_options : [
|
||||||
'cpp_std=c++17',
|
'cpp_std=c++17',
|
||||||
|
32
toml.hpp
32
toml.hpp
@ -1,6 +1,6 @@
|
|||||||
//----------------------------------------------------------------------------------------------------------------------
|
//----------------------------------------------------------------------------------------------------------------------
|
||||||
//
|
//
|
||||||
// toml++ v0.5.0
|
// toml++ v0.5.1
|
||||||
// https://github.com/marzer/tomlplusplus
|
// https://github.com/marzer/tomlplusplus
|
||||||
// SPDX-License-Identifier: MIT
|
// SPDX-License-Identifier: MIT
|
||||||
//
|
//
|
||||||
@ -60,7 +60,7 @@
|
|||||||
#define TOML_ALL_INLINE 1
|
#define TOML_ALL_INLINE 1
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#if defined(TOML_IMPLEMENTATION) || TOML_ALL_INLINE
|
#if defined(TOML_IMPLEMENTATION) || TOML_ALL_INLINE || defined(__INTELLISENSE__)
|
||||||
#undef TOML_IMPLEMENTATION
|
#undef TOML_IMPLEMENTATION
|
||||||
#define TOML_IMPLEMENTATION 1
|
#define TOML_IMPLEMENTATION 1
|
||||||
#else
|
#else
|
||||||
@ -98,13 +98,6 @@
|
|||||||
#ifndef __cplusplus
|
#ifndef __cplusplus
|
||||||
#error toml++ is a C++ library.
|
#error toml++ is a C++ library.
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#if defined(__clang__) || defined(__GNUC__)
|
|
||||||
#define TOML_GCC_ATTR(attr) __attribute__((attr))
|
|
||||||
#else
|
|
||||||
#define TOML_GCC_ATTR(attr)
|
|
||||||
#endif
|
|
||||||
|
|
||||||
#ifdef __clang__
|
#ifdef __clang__
|
||||||
|
|
||||||
#define TOML_PUSH_WARNINGS _Pragma("clang diagnostic push")
|
#define TOML_PUSH_WARNINGS _Pragma("clang diagnostic push")
|
||||||
@ -112,14 +105,17 @@
|
|||||||
#define TOML_DISABLE_INIT_WARNINGS _Pragma("clang diagnostic ignored \"-Wmissing-field-initializers\"")
|
#define TOML_DISABLE_INIT_WARNINGS _Pragma("clang diagnostic ignored \"-Wmissing-field-initializers\"")
|
||||||
#define TOML_DISABLE_ALL_WARNINGS _Pragma("clang diagnostic ignored \"-Weverything\"")
|
#define TOML_DISABLE_ALL_WARNINGS _Pragma("clang diagnostic ignored \"-Weverything\"")
|
||||||
#define TOML_POP_WARNINGS _Pragma("clang diagnostic pop")
|
#define TOML_POP_WARNINGS _Pragma("clang diagnostic pop")
|
||||||
|
#define TOML_GCC_ATTR(attr) __attribute__((attr))
|
||||||
#define TOML_ALWAYS_INLINE TOML_GCC_ATTR(__always_inline__) inline
|
#define TOML_ALWAYS_INLINE TOML_GCC_ATTR(__always_inline__) inline
|
||||||
#define TOML_ASSUME(cond) __builtin_assume(cond)
|
#define TOML_ASSUME(cond) __builtin_assume(cond)
|
||||||
#define TOML_UNREACHABLE __builtin_unreachable()
|
#define TOML_UNREACHABLE __builtin_unreachable()
|
||||||
#if __has_declspec_attribute(novtable)
|
#if defined(_MSC_VER) && defined(__has_declspec_attribute)
|
||||||
#define TOML_INTERFACE __declspec(novtable)
|
#if __has_declspec_attribute(novtable)
|
||||||
#endif
|
#define TOML_INTERFACE __declspec(novtable)
|
||||||
#if __has_declspec_attribute(empty_bases)
|
#endif
|
||||||
#define TOML_EMPTY_BASES __declspec(empty_bases)
|
#if __has_declspec_attribute(empty_bases)
|
||||||
|
#define TOML_EMPTY_BASES __declspec(empty_bases)
|
||||||
|
#endif
|
||||||
#endif
|
#endif
|
||||||
#ifdef __EXCEPTIONS
|
#ifdef __EXCEPTIONS
|
||||||
#define TOML_COMPILER_EXCEPTIONS 1
|
#define TOML_COMPILER_EXCEPTIONS 1
|
||||||
@ -162,6 +158,7 @@
|
|||||||
_Pragma("GCC diagnostic ignored \"-Wchar-subscripts\"") \
|
_Pragma("GCC diagnostic ignored \"-Wchar-subscripts\"") \
|
||||||
_Pragma("GCC diagnostic ignored \"-Wtype-limits\"")
|
_Pragma("GCC diagnostic ignored \"-Wtype-limits\"")
|
||||||
#define TOML_POP_WARNINGS _Pragma("GCC diagnostic pop")
|
#define TOML_POP_WARNINGS _Pragma("GCC diagnostic pop")
|
||||||
|
#define TOML_GCC_ATTR(attr) __attribute__((attr))
|
||||||
#define TOML_ALWAYS_INLINE TOML_GCC_ATTR(__always_inline__) inline
|
#define TOML_ALWAYS_INLINE TOML_GCC_ATTR(__always_inline__) inline
|
||||||
#define TOML_UNREACHABLE __builtin_unreachable()
|
#define TOML_UNREACHABLE __builtin_unreachable()
|
||||||
#if !defined(TOML_RELOPS_REORDERING) && defined(__cpp_impl_three_way_comparison)
|
#if !defined(TOML_RELOPS_REORDERING) && defined(__cpp_impl_three_way_comparison)
|
||||||
@ -193,7 +190,7 @@
|
|||||||
#define TOML_CPP 26
|
#define TOML_CPP 26
|
||||||
#elif TOML_CPP_VERSION >= 202300L
|
#elif TOML_CPP_VERSION >= 202300L
|
||||||
#define TOML_CPP 23
|
#define TOML_CPP 23
|
||||||
#elif TOML_CPP_VERSION >= 202000L
|
#elif TOML_CPP_VERSION >= 202002L
|
||||||
#define TOML_CPP 20
|
#define TOML_CPP 20
|
||||||
#elif TOML_CPP_VERSION >= 201703L
|
#elif TOML_CPP_VERSION >= 201703L
|
||||||
#define TOML_CPP 17
|
#define TOML_CPP 17
|
||||||
@ -239,6 +236,9 @@
|
|||||||
#ifndef TOML_POP_WARNINGS
|
#ifndef TOML_POP_WARNINGS
|
||||||
#define TOML_POP_WARNINGS
|
#define TOML_POP_WARNINGS
|
||||||
#endif
|
#endif
|
||||||
|
#ifndef TOML_GCC_ATTR
|
||||||
|
#define TOML_GCC_ATTR(attr)
|
||||||
|
#endif
|
||||||
#ifndef TOML_INTERFACE
|
#ifndef TOML_INTERFACE
|
||||||
#define TOML_INTERFACE
|
#define TOML_INTERFACE
|
||||||
#endif
|
#endif
|
||||||
@ -299,7 +299,7 @@
|
|||||||
|
|
||||||
#define TOML_LIB_MAJOR 0
|
#define TOML_LIB_MAJOR 0
|
||||||
#define TOML_LIB_MINOR 5
|
#define TOML_LIB_MINOR 5
|
||||||
#define TOML_LIB_PATCH 0
|
#define TOML_LIB_PATCH 1
|
||||||
|
|
||||||
#define TOML_LANG_MAJOR 0
|
#define TOML_LANG_MAJOR 0
|
||||||
#define TOML_LANG_MINOR 5
|
#define TOML_LANG_MINOR 5
|
||||||
|
Loading…
Reference in New Issue
Block a user