Skip to content

Commit

Permalink
support newer compilers
Browse files Browse the repository at this point in the history
  • Loading branch information
bbrk24 committed Sep 25, 2024
1 parent 3131a27 commit fc2b5f6
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 5 deletions.
4 changes: 2 additions & 2 deletions .github/workflows/build-and-release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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:
Expand All @@ -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:
Expand Down
2 changes: 1 addition & 1 deletion clitest.sh
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
7 changes: 5 additions & 2 deletions src/compat.hh
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@

#if __has_include(<stdfloat>)
#include <stdfloat>
#define _INCLUDED_STDFLOAT
#endif

#if __has_include(<version>)
Expand Down Expand Up @@ -44,17 +45,19 @@ 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
// The smallest supported float type.
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.
Expand Down

0 comments on commit fc2b5f6

Please sign in to comment.