diff --git a/CMakeLists.txt b/CMakeLists.txt index 5ce689ea8d..adeedb9ff6 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -112,7 +112,7 @@ add_definitions(-D_USE_MATH_DEFINES) # Let CMake handle setting C++11 (since 3.1) if(NOT CMAKE_CXX_STANDARD) - set(CMAKE_CXX_STANDARD 17) + set(CMAKE_CXX_STANDARD 20) endif() set(CMAKE_C_STANDARD 11) diff --git a/src/celcompat/string.h b/src/celcompat/string.h new file mode 100644 index 0000000000..d4bdf3b483 --- /dev/null +++ b/src/celcompat/string.h @@ -0,0 +1,14 @@ +#pragma once + +#include + +namespace compat +{ +#if __has_cpp_attribute(__cpp_char8_t) + using char8_t = std::char8_t; + using u8string = std::u8string; +#else + using char8_t = unsigned char; + using u8string = std::basic_string; +#endif +}