Skip to content

Commit

Permalink
Fix errors setting of FMT_USE_FLOAT128 (#3259)
Browse files Browse the repository at this point in the history
  • Loading branch information
Roman-Koshelev authored Feb 8, 2023
1 parent 05e3a92 commit 9907089
Showing 1 changed file with 15 additions and 3 deletions.
18 changes: 15 additions & 3 deletions include/fmt/format.h
Original file line number Diff line number Diff line change
Expand Up @@ -798,12 +798,24 @@ using is_integer =
!std::is_same<T, wchar_t>::value>;

#ifndef FMT_USE_FLOAT128
# ifdef __SIZEOF_FLOAT128__
# define FMT_USE_FLOAT128 1
# else
# ifdef __clang__
// Clang C++ emulates GCC, so it has to appear early.
# if defined(__has_include)
# if __has_include(<quadmath.h>)
# define FMT_USE_FLOAT128 1
# endif
# endif
# elif defined(__GNUC__)
// GNU C++:
# if defined(_GLIBCXX_USE_FLOAT128) && !defined(__STRICT_ANSI__)
# define FMT_USE_FLOAT128 1
# endif
# endif
# ifndef FMT_USE_FLOAT128
# define FMT_USE_FLOAT128 0
# endif
#endif

#if FMT_USE_FLOAT128
using float128 = __float128;
#else
Expand Down

0 comments on commit 9907089

Please sign in to comment.