mirror of
https://github.com/c64scene-ar/llvm-6502.git
synced 2025-02-10 20:33:15 +00:00
raw_stream formatter: [Win32] Use std::signbit() if available, instead of _fpclass().
FIXME: It should be generic to C++11. For now, it is dedicated to mingw-w64. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@199052 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
parent
6d289b83ad
commit
486fdaae66
@ -227,11 +227,17 @@ raw_ostream &raw_ostream::operator<<(double N) {
|
|||||||
// On MSVCRT and compatible, output of %e is incompatible to Posix
|
// On MSVCRT and compatible, output of %e is incompatible to Posix
|
||||||
// by default. Number of exponent digits should be at least 2. "%+03d"
|
// by default. Number of exponent digits should be at least 2. "%+03d"
|
||||||
// FIXME: Implement our formatter to here or Support/Format.h!
|
// FIXME: Implement our formatter to here or Support/Format.h!
|
||||||
|
#if __cplusplus >= 201103L && defined(__MINGW32__)
|
||||||
|
// FIXME: It should be generic to C++11.
|
||||||
|
if (N == 0.0 && std::signbit(N))
|
||||||
|
return *this << "-0.000000e+00";
|
||||||
|
#else
|
||||||
int fpcl = _fpclass(N);
|
int fpcl = _fpclass(N);
|
||||||
|
|
||||||
// negative zero
|
// negative zero
|
||||||
if (fpcl == _FPCLASS_NZ)
|
if (fpcl == _FPCLASS_NZ)
|
||||||
return *this << "-0.000000e+00";
|
return *this << "-0.000000e+00";
|
||||||
|
#endif
|
||||||
|
|
||||||
char buf[16];
|
char buf[16];
|
||||||
unsigned len;
|
unsigned len;
|
||||||
|
Loading…
x
Reference in New Issue
Block a user