From 9b4169299523391db3da8250b426df8c745d74af Mon Sep 17 00:00:00 2001 From: flagarde Date: Thu, 16 May 2024 09:22:43 +0800 Subject: [PATCH] Fix --- include/Khaos/Version.h | 20 ++++++++++---------- src/CMakeLists.txt | 2 +- 2 files changed, 11 insertions(+), 11 deletions(-) diff --git a/include/Khaos/Version.h b/include/Khaos/Version.h index 172d573..7c2bbdb 100644 --- a/include/Khaos/Version.h +++ b/include/Khaos/Version.h @@ -25,11 +25,11 @@ */ #if defined(__clang__) - #define KHAOS_PUSH_WARNING_CXX98_COMPAT_PEDANTIC() _Pragma("clang diagnostic push") _Pragma("clang diagnostic ignored \"-Wc++98-compat-pedantic\"") /* //NOSONAR */ - #define KHAOS_POP_WARNING_CXX98_COMPAT_PEDANTIC() _Pragma("clang diagnostic pop") /* //NOSONAR */ + #define KHAOS_PUSH_CXX98_COMPAT_PEDANTIC() _Pragma("clang diagnostic push") _Pragma("clang diagnostic ignored \"-Wc++98-compat-pedantic\"") /* //NOSONAR */ + #define KHAOS_POP_CXX98_COMPAT_PEDANTIC() _Pragma("clang diagnostic pop") /* //NOSONAR */ #else - #define KHAOS_PUSH_WARNING_CXX98_COMPAT_PEDANTIC() /* //NOSONAR */ - #define KHAOS_POP_WARNING_CXX98_COMPAT_PEDANTIC() /* //NOSONAR */ + #define KHAOS_PUSH_CXX98_COMPAT_PEDANTIC() /* //NOSONAR */ + #define KHAOS_POP_CXX98_COMPAT_PEDANTIC() /* //NOSONAR */ #endif /*! @@ -51,8 +51,8 @@ * #define KHAOS_DEFINE_name_VERSION_PRIVATE() SET_VERSION(2,3,4,5) * \endcode */ -#define SET_VERSION(major, minor, patch, tweak) \ - (KHAOS_PUSH_WARNING_CXX98_COMPAT_PEDANTIC()(((major) * 1ULL % (1 << 16)) << 48) + (((minor) * 1ULL % (1 << 16)) << 32) + (((patch) * 1ULL % (1 << 16)) << 16) + ((tweak) * 1ULL % (1 << 16)) KHAOS_POP_WARNING_CXX98_COMPAT_PEDANTIC()) /* //NOSONAR */ +#define SET_VERSION(major, minor, patch, tweak) /* //NOSONAR */ \ + (KHAOS_PUSH_CXX98_COMPAT_PEDANTIC()(((major) * 1ULL % (1 << 16)) << 48) + (((minor) * 1ULL % (1 << 16)) << 32) + (((patch) * 1ULL % (1 << 16)) << 16) + ((tweak) * 1ULL % (1 << 16)) KHAOS_POP_CXX98_COMPAT_PEDANTIC()) /* //NOSONAR */ /*! * \hideinitializer @@ -61,7 +61,7 @@ * * \note Value can be directly used in both preprocessor and compiler expressions for comparison to other similarly defined values. */ -#define GET_VERSION_MAJOR(name) (KHAOS_PUSH_WARNING_CXX98_COMPAT_PEDANTIC()(((KHAOS_DEFINE_##name##_VERSION_PRIVATE()) * 1ULL) >> 48) % (1 << 16) KHAOS_POP_WARNING_CXX98_COMPAT_PEDANTIC()) /* //NOSONAR */ +#define GET_VERSION_MAJOR(name) (KHAOS_PUSH_CXX98_COMPAT_PEDANTIC()(((KHAOS_DEFINE_##name##_VERSION_PRIVATE()) * 1ULL) >> 48) % (1 << 16) KHAOS_POP_CXX98_COMPAT_PEDANTIC()) /* //NOSONAR */ /*! * \hideinitializer @@ -70,7 +70,7 @@ * * \note Value can be directly used in both preprocessor and compiler expressions for comparison to other similarly defined values. */ -#define GET_VERSION_MINOR(name) (KHAOS_PUSH_WARNING_CXX98_COMPAT_PEDANTIC()(((KHAOS_DEFINE_##name##_VERSION_PRIVATE()) * 1ULL) >> 32) % (1 << 16) KHAOS_POP_WARNING_CXX98_COMPAT_PEDANTIC()) /* //NOSONAR */ +#define GET_VERSION_MINOR(name) (KHAOS_PUSH_CXX98_COMPAT_PEDANTIC()(((KHAOS_DEFINE_##name##_VERSION_PRIVATE()) * 1ULL) >> 32) % (1 << 16) KHAOS_POP_CXX98_COMPAT_PEDANTIC()) /* //NOSONAR */ /*! * \hideinitializer @@ -79,7 +79,7 @@ * * \note Value can be directly used in both preprocessor and compiler expressions for comparison to other similarly defined values. */ -#define GET_VERSION_PATCH(name) (KHAOS_PUSH_WARNING_CXX98_COMPAT_PEDANTIC()(((KHAOS_DEFINE_##name##_VERSION_PRIVATE()) * 1ULL) >> 16) % (1 << 16) KHAOS_POP_WARNING_CXX98_COMPAT_PEDANTIC()) /* //NOSONAR */ +#define GET_VERSION_PATCH(name) (KHAOS_PUSH_CXX98_COMPAT_PEDANTIC()(((KHAOS_DEFINE_##name##_VERSION_PRIVATE()) * 1ULL) >> 16) % (1 << 16) KHAOS_POP_CXX98_COMPAT_PEDANTIC()) /* //NOSONAR */ /*! * \hideinitializer @@ -88,6 +88,6 @@ * * \note Value can be directly used in both preprocessor and compiler expressions for comparison to other similarly defined values. */ -#define GET_VERSION_TWEAK(name) (KHAOS_PUSH_WARNING_CXX98_COMPAT_PEDANTIC()((KHAOS_DEFINE_##name##_VERSION_PRIVATE()) * 1ULL) % (1 << 16) KHAOS_POP_WARNING_CXX98_COMPAT_PEDANTIC()) /* //NOSONAR */ +#define GET_VERSION_TWEAK(name) (KHAOS_PUSH_CXX98_COMPAT_PEDANTIC()((KHAOS_DEFINE_##name##_VERSION_PRIVATE()) * 1ULL) % (1 << 16) KHAOS_POP_CXX98_COMPAT_PEDANTIC()) /* //NOSONAR */ #endif /* KHAOS_VERSION_H_ */ diff --git a/src/CMakeLists.txt b/src/CMakeLists.txt index 91f3ba2..d1142c6 100644 --- a/src/CMakeLists.txt +++ b/src/CMakeLists.txt @@ -15,7 +15,7 @@ set(KHAOS_PUBLIC_HEADERS "${PROJECT_SOURCE_DIR}/include/Khaos/Preprocessor.h" "${PROJECT_SOURCE_DIR}/include/Khaos/Version.h") set_target_properties(Khaos PROPERTIES PUBLIC_HEADER "${KHAOS_PUBLIC_HEADERS}") -target_compile_options(Khaos INTERFACE $<$,$,$>:-Wall> $<$:/W4>) +target_compile_options(Khaos INTERFACE $<$,$,$>:-Wno-c++98-compat-pedantic>) target_include_directories(Khaos INTERFACE "$" "$" "$") install(TARGETS Khaos EXPORT KhaosTargets LIBRARY DESTINATION "${CMAKE_INSTALL_LIBDIR}"