Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
19 changes: 6 additions & 13 deletions src/dmd/root/ctfloat.d
Original file line number Diff line number Diff line change
Expand Up @@ -29,12 +29,8 @@ private

version(CRuntime_Microsoft) extern (C++)
{
static if (is(real_t == real))
struct longdouble { real_t r; }
else
import dmd.root.longdouble : longdouble;
size_t ld_sprint(char* str, int fmt, longdouble x);
longdouble strtold_dm(const(char)* p, char** endp);
public import dmd.root.longdouble : longdouble_soft, ld_sprint;
longdouble_soft strtold_dm(const(char)* p, char** endp);
}
}

Expand Down Expand Up @@ -148,9 +144,9 @@ extern (C++) struct CTFloat
// doesn't match with the C++ header.
// add a wrapper just for isSNaN as this is the only function called from C++
version(CRuntime_Microsoft) static if (is(real_t == real))
static bool isSNaN(longdouble ld)
static bool isSNaN(longdouble_soft ld)
{
return isSNaN(ld.r);
return isSNaN(cast(real)ld);
}

static bool isInfinity(real_t r)
Expand All @@ -168,10 +164,7 @@ extern (C++) struct CTFloat
}
version(CRuntime_Microsoft)
{
version(LDC)
auto r = strtold_dm(literal, null);
else
auto r = strtold_dm(literal, null).r;
auto r = cast(real_t) strtold_dm(literal, null);
}
else
auto r = strtold(literal, null);
Expand All @@ -185,7 +178,7 @@ extern (C++) struct CTFloat
{
version(CRuntime_Microsoft)
{
return cast(int)ld_sprint(str, fmt, longdouble(x));
return cast(int)ld_sprint(str, fmt, longdouble_soft(x));
}
else
{
Expand Down
Loading