Merge branch 'main' of github.com:fastfloat/fast_float

This commit is contained in:
Daniel Lemire 2025-03-09 14:27:38 -04:00
commit 1504792a9f
5 changed files with 21 additions and 14 deletions

View File

@ -13,7 +13,7 @@ jobs:
runs-on: ubuntu-latest runs-on: ubuntu-latest
steps: steps:
- uses: actions/checkout@v4 - uses: actions/checkout@v4
- uses: uraimo/run-on-arch-action@v2 - uses: uraimo/run-on-arch-action@v3
name: Test name: Test
id: runcmd id: runcmd
with: with:

View File

@ -9,15 +9,21 @@ jobs:
- uses: actions/checkout@v4 - uses: actions/checkout@v4
- name: Use cmake - name: Use cmake
run: | run: |
mkdir build && set -xe
cd build && cmake -B build \
CXXFLAGS=-Werror cmake -DFASTFLOAT_TEST=ON -D FASTFLOAT_BENCHMARKS=ON .. && -DFASTFLOAT_TEST=ON \
cmake --build . && -DFASTFLOAT_BENCHMARKS=ON \
ctest --output-on-failure -DCMAKE_CXX_FLAGS=' -Werror -Wundef '
cmake --build build --parallel
( cd build ; ctest --output-on-failure )
- name: Use cmake CXX23 - name: Use cmake CXX23
run: | run: |
mkdir build20 && set -xe
cd build20 && cmake -B build20 \
CXXFLAGS=-Werror cmake -DFASTFLOAT_CONSTEXPR_TESTS=ON -DFASTFLOAT_FIXEDWIDTH_TESTS=ON -DFASTFLOAT_CXX_STANDARD=23 -DFASTFLOAT_TEST=ON .. && -DFASTFLOAT_TEST=ON \
cmake --build . && -DFASTFLOAT_CONSTEXPR_TESTS=ON \
ctest --output-on-failure -DFASTFLOAT_FIXEDWIDTH_TESTS=ON \
-DFASTFLOAT_CXX_STANDARD=23 \
-DCMAKE_CXX_FLAGS=' -Werror -Wundef '
cmake --build build20 --parallel
( cd build20 ; ctest --output-on-failure )

View File

@ -17,7 +17,7 @@
#include <libgen.h> #include <libgen.h>
#endif #endif
#if __APPLE__ && __aarch64__ #if (defined(__APPLE__) && __APPLE__) && (defined(__aarch64__) && __aarch64__)
#include "apple_arm_events.h" #include "apple_arm_events.h"
#endif #endif

View File

@ -8,7 +8,7 @@
#endif #endif
// Testing for https://wg21.link/N3652, adopted in C++14 // Testing for https://wg21.link/N3652, adopted in C++14
#if __cpp_constexpr >= 201304 #if defined(__cpp_constexpr) && __cpp_constexpr >= 201304
#define FASTFLOAT_CONSTEXPR14 constexpr #define FASTFLOAT_CONSTEXPR14 constexpr
#else #else
#define FASTFLOAT_CONSTEXPR14 #define FASTFLOAT_CONSTEXPR14
@ -29,6 +29,7 @@
// Testing for relevant C++20 constexpr library features // Testing for relevant C++20 constexpr library features
#if FASTFLOAT_HAS_IS_CONSTANT_EVALUATED && FASTFLOAT_HAS_BIT_CAST && \ #if FASTFLOAT_HAS_IS_CONSTANT_EVALUATED && FASTFLOAT_HAS_BIT_CAST && \
defined(__cpp_lib_constexpr_algorithms) && \
__cpp_lib_constexpr_algorithms >= 201806L /*For std::copy and std::fill*/ __cpp_lib_constexpr_algorithms >= 201806L /*For std::copy and std::fill*/
#define FASTFLOAT_CONSTEXPR20 constexpr #define FASTFLOAT_CONSTEXPR20 constexpr
#define FASTFLOAT_IS_CONSTEXPR 1 #define FASTFLOAT_IS_CONSTEXPR 1

View File

@ -9,7 +9,7 @@
#include <type_traits> #include <type_traits>
#include <system_error> #include <system_error>
#ifdef __has_include #ifdef __has_include
#if __has_include(<stdfloat>) && (__cplusplus > 202002L || _MSVC_LANG > 202002L) #if __has_include(<stdfloat>) && (__cplusplus > 202002L || (defined(_MSVC_LANG) && (_MSVC_LANG > 202002L)))
#include <stdfloat> #include <stdfloat>
#endif #endif
#endif #endif