diff --git a/.github/workflows/build-and-release.yml b/.github/workflows/build-and-release.yml index d66a42a..2f14c47 100644 --- a/.github/workflows/build-and-release.yml +++ b/.github/workflows/build-and-release.yml @@ -16,7 +16,7 @@ jobs: tag=${{ github.ref_name }} - g++ -O3 -DNDEBUG -DVERSION=$tag -flto -fno-rtti -std=gnu++17 -o "Release/trilangle-${tag}-ubuntu" + g++ -O3 -DNDEBUG -DVERSION=$tag -flto -fno-rtti -std=gnu++23 -o "Release/trilangle-${tag}-ubuntu" src/*.cpp - uses: actions/upload-artifact@v4 with: @@ -39,7 +39,7 @@ jobs: tag=${{ github.ref_name }} - clang++ -O3 -DNDEBUG -DVERSION=$tag -flto -fno-rtti -std=gnu++20 -target "$(clang -dumpmachine | sed -E + clang++ -O3 -DNDEBUG -DVERSION=$tag -flto -fno-rtti -std=gnu++23 -target "$(clang -dumpmachine | sed -E 's/^\w+-/${{ matrix.arch }}-/')" -o "Release/trilangle-${tag}-macos-${{ matrix.arch }}" src/*.cpp - uses: actions/upload-artifact@v4 with: diff --git a/clitest.sh b/clitest.sh index c048f29..5815af3 100755 --- a/clitest.sh +++ b/clitest.sh @@ -4,7 +4,7 @@ set -ex # Some of the examples (particularly the Qdeql truth machine) run very slowly # if I/O buffering is enabled. -g++ -Og -DNO_BUFFER -std=gnu++17 src/*.cpp -o trilangle +g++ -Og -DNO_BUFFER -std=gnu++23 src/*.cpp -o trilangle for script in tests/cli/*/index.sh do diff --git a/src/compat.hh b/src/compat.hh index 8e86c52..73ae302 100644 --- a/src/compat.hh +++ b/src/compat.hh @@ -15,6 +15,7 @@ #if __has_include() #include +#define _INCLUDED_STDFLOAT #endif #if __has_include() @@ -44,10 +45,10 @@ constexpr int EX_NOINPUT = 66; #endif -#ifdef __STDCPP_FLOAT16_T__ +#if defined(_INCLUDED_STDFLOAT) && defined(__STDCPP_FLOAT16_T__) // The smallest supported float type. typedef std::float16_t small_float; -#elif defined(__STDCPP_BFLOAT16_T__) +#elif defined(_INCLUDED_STDFLOAT) && defined(__STDCPP_BFLOAT16_T__) // The smallest supported float type. typedef std::bfloat16_t small_float; #else @@ -55,6 +56,8 @@ typedef std::bfloat16_t small_float; typedef float small_float; #endif +#undef _INCLUDED_STDFLOAT + #if !defined(__GNUC__) && defined(_MSC_VER) // 1 if the compiler is really MSVC, and not clang pretending to be MSVC. 0 for clang and GCC.