chnage compiler check for bit_cast so it compiles with older compilers

This commit is contained in:
Jonas Rahlf 2021-09-02 22:00:57 +02:00
parent d8ee88e7f6
commit b17eafd06f
3 changed files with 8 additions and 4 deletions

View File

@ -6,11 +6,13 @@
#include <cstdint>
#include <cstring>
#include <iterator>
#include <version>
#if defined(__has_include) && __has_include(<version>)
#include <version>
#if defined(__cpp_lib_bit_cast)
#include <bit>
#endif
#endif
#include "float_common.h"

View File

@ -3,13 +3,15 @@
#include <system_error>
#include <version>
#if !defined(CXX20_CONSTEXPR) && defined(__has_include) && __has_include(<version>)
#include <version>
#if defined(__cpp_lib_bit_cast)
#define CXX20_CONSTEXPR constexpr
#else
#define CXX20_CONSTEXPR
#endif
#endif
namespace fast_float {
enum chars_format {

View File

@ -4,7 +4,6 @@
#include <cfloat>
#include <cstdint>
#include <cassert>
#include <version>
#if (defined(__x86_64) || defined(__x86_64__) || defined(_M_X64) \
|| defined(__amd64) || defined(__aarch64__) || defined(_M_ARM64) \
@ -74,7 +73,8 @@
#define fastfloat_really_inline inline __attribute__((always_inline))
#endif
#if !defined(CXX20_CONSTEXPR)
#if !defined(CXX20_CONSTEXPR) && defined(__has_include) && __has_include(<version>)
#include <version>
#if defined(__cpp_lib_bit_cast)
#define CXX20_CONSTEXPR constexpr
#else