mirror of
https://github.com/fastfloat/fast_float.git
synced 2025-12-07 17:26:51 +08:00
tidy float_common.h: put feature test macros at the top
This commit is contained in:
parent
d617b97c7c
commit
9afc814fb6
@ -5,12 +5,25 @@
|
||||
#include <cstdint>
|
||||
#include <cassert>
|
||||
|
||||
#if (defined(__i386) || defined(__i386__) || defined(_M_IX86) \
|
||||
|| defined(__arm__) || defined(__MINGW32__))
|
||||
#define FASTFLOAT_32BIT
|
||||
#elif (defined(__x86_64) || defined(__x86_64__) || defined(_M_X64) \
|
||||
|| defined(__amd64) || defined(__aarch64__) || defined(_M_ARM64) \
|
||||
|| defined(__MINGW64__))
|
||||
#define FASTFLOAT_64BIT
|
||||
#else
|
||||
#error Unknown platform
|
||||
#endif
|
||||
|
||||
#if ((defined(_WIN32) || defined(_WIN64)) && !defined(__clang__))
|
||||
#include <intrin.h>
|
||||
#endif
|
||||
|
||||
#if defined(_MSC_VER) && !defined(__clang__)
|
||||
#define FASTFLOAT_VISUAL_STUDIO 1
|
||||
#endif
|
||||
|
||||
|
||||
|
||||
#ifdef _WIN32
|
||||
#define FASTFLOAT_IS_BIG_ENDIAN 0
|
||||
#else
|
||||
@ -113,22 +126,6 @@ fastfloat_really_inline int leading_zeroes(uint64_t input_num) {
|
||||
#endif
|
||||
}
|
||||
|
||||
|
||||
#if (defined(__i386) || defined(__i386__) || defined(_M_IX86) \
|
||||
|| defined(__arm__) || defined(__MINGW32__))
|
||||
#define FASTFLOAT_32BIT
|
||||
#elif (defined(__x86_64) || defined(__x86_64__) || defined(_M_X64) \
|
||||
|| defined(__amd64) || defined(__aarch64__) || defined(_M_ARM64))
|
||||
#define FASTFLOAT_64BIT
|
||||
#else
|
||||
#error Unknown platform
|
||||
#endif
|
||||
|
||||
|
||||
#if ((defined(_WIN32) || defined(_WIN64)) && !defined(__clang__))
|
||||
#include <intrin.h>
|
||||
#endif
|
||||
|
||||
#ifdef FASTFLOAT_32BIT
|
||||
|
||||
#if (!defined(_WIN32)) || defined(__MINGW32__)
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user