From 2b5b4d1259d38c3a9c402b0fe3c0aca9c6c0b758 Mon Sep 17 00:00:00 2001 From: kkawachi Date: Sat, 11 Apr 2026 12:38:55 +0900 Subject: [PATCH] fix: add fallback for environments missing bit operations support Ensured RTM_NO_BIT_CAST is defined when header is unavailable. This prevents build failures in C++20 environments that do not support standard bit operations. --- includes/rtm/impl/bit_cast.impl.h | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/includes/rtm/impl/bit_cast.impl.h b/includes/rtm/impl/bit_cast.impl.h index 35b28eb..9572a95 100644 --- a/includes/rtm/impl/bit_cast.impl.h +++ b/includes/rtm/impl/bit_cast.impl.h @@ -29,6 +29,16 @@ #include "rtm/impl/compiler_utils.h" #include "rtm/impl/detect_cpp_version.h" +////////////////////////////////////////////////////////////////////////// +// Detect if the current compilation environment supports bit operations. +////////////////////////////////////////////////////////////////////////// + +#if !defined(RTM_NO_BIT_CAST) + #if !defined(__cpp_lib_bitops) + #define RTM_NO_BIT_CAST + #endif +#endif + // See config.h for details on how to configure std::bit_cast for your project // Use RTM_NO_BIT_CAST to disable std::bit_cast