This is an automated email from the ASF dual-hosted git repository.

isapego pushed a commit to branch main
in repository https://gitbox.apache.org/repos/asf/ignite-3.git


The following commit(s) were added to refs/heads/main by this push:
     new 1e1a6abebb6 IGNITE-26426 Support C++ code compilation with the C++23 
(#6582)
1e1a6abebb6 is described below

commit 1e1a6abebb612c9a1579713e93d5f7a5fbfaaa6c
Author: Dmitriy Zabotlin <[email protected]>
AuthorDate: Fri Sep 12 18:31:35 2025 +0300

    IGNITE-26426 Support C++ code compilation with the C++23 (#6582)
    
    Co-authored-by: dzabotlin <[email protected]>
---
 modules/platforms/cpp/ignite/common/detail/bytes.h     | 18 ++++++++++++++----
 .../platforms/cpp/ignite/common/detail/string_utils.h  |  1 +
 .../cpp/tests/client-test/ignite_client_test.cpp       |  1 +
 .../cpp/tests/client-test/transactions_test.cpp        |  1 +
 4 files changed, 17 insertions(+), 4 deletions(-)

diff --git a/modules/platforms/cpp/ignite/common/detail/bytes.h 
b/modules/platforms/cpp/ignite/common/detail/bytes.h
index 0a479f09cc7..d35ef776ad9 100644
--- a/modules/platforms/cpp/ignite/common/detail/bytes.h
+++ b/modules/platforms/cpp/ignite/common/detail/bytes.h
@@ -66,6 +66,10 @@
 #  define IGNITE_BYTESWAP_32(x) ignite::bytes::swap32(x)
 #  define IGNITE_BYTESWAP_64(x) ignite::bytes::swap64(x)
 # endif
+#else
+# define IGNITE_BYTESWAP_16(x) std::byteswap<std::uint16_t>(x)
+# define IGNITE_BYTESWAP_32(x) std::byteswap<std::uint32_t>(x)
+# define IGNITE_BYTESWAP_64(x) std::byteswap<std::uint64_t>(x)
 #endif
 
 #ifndef IGNITE_BYTESWAP_SPECIFIER
@@ -74,14 +78,20 @@
 
 namespace ignite::detail {
 
+#if IGNITE_STD_ENDIAN
+using endian_underlying_t = std::underlying_type_t<std::endian>;
+#else
+using endian_underlying_t = int;
+#endif
+
 /**
  * Byte order enum.
  */
-enum class endian {
+enum class endian : endian_underlying_t {
 #if IGNITE_STD_ENDIAN
-    LITTLE = std::endian::little,
-    BIG = std::endian::big,
-    NATIVE = std::endian::native,
+    LITTLE = static_cast<endian_underlying_t>(std::endian::little),
+    BIG = static_cast<endian_underlying_t>(std::endian::big),
+    NATIVE = static_cast<endian_underlying_t>(std::endian::native),
 #else
     LITTLE,
     BIG,
diff --git a/modules/platforms/cpp/ignite/common/detail/string_utils.h 
b/modules/platforms/cpp/ignite/common/detail/string_utils.h
index b0a9394c7c6..06a87cd51aa 100644
--- a/modules/platforms/cpp/ignite/common/detail/string_utils.h
+++ b/modules/platforms/cpp/ignite/common/detail/string_utils.h
@@ -25,6 +25,7 @@
 #include <sstream>
 #include <string_view>
 #include <optional>
+#include <limits>
 
 #include <cctype>
 
diff --git a/modules/platforms/cpp/tests/client-test/ignite_client_test.cpp 
b/modules/platforms/cpp/tests/client-test/ignite_client_test.cpp
index c98e242ac44..209582736ce 100644
--- a/modules/platforms/cpp/tests/client-test/ignite_client_test.cpp
+++ b/modules/platforms/cpp/tests/client-test/ignite_client_test.cpp
@@ -25,6 +25,7 @@
 #include <gmock/gmock-matchers.h>
 
 #include <chrono>
+#include <thread>
 
 using namespace ignite;
 
diff --git a/modules/platforms/cpp/tests/client-test/transactions_test.cpp 
b/modules/platforms/cpp/tests/client-test/transactions_test.cpp
index c7fe62153bd..77b0e78ef11 100644
--- a/modules/platforms/cpp/tests/client-test/transactions_test.cpp
+++ b/modules/platforms/cpp/tests/client-test/transactions_test.cpp
@@ -24,6 +24,7 @@
 #include <gtest/gtest.h>
 
 #include <chrono>
+#include <thread>
 
 using namespace ignite;
 

Reply via email to