mirror of
https://github.com/dlang/phobos.git
synced 2025-04-28 14:10:30 +03:00
std.stdio: untangle fdopen references
This commit is contained in:
parent
9e1e8e7d51
commit
6fd66c5455
1 changed files with 11 additions and 8 deletions
19
std/stdio.d
19
std/stdio.d
|
@ -909,17 +909,20 @@ Params:
|
||||||
iob._flag &= ~_IOTRAN;
|
iob._flag &= ~_IOTRAN;
|
||||||
_FUNLOCK(fp);
|
_FUNLOCK(fp);
|
||||||
}
|
}
|
||||||
else
|
else version (CRuntime_Microsoft)
|
||||||
{
|
{
|
||||||
version (Windows) // MSVCRT
|
auto fp = _fdopen(fd, modez);
|
||||||
auto fp = _fdopen(fd, modez);
|
|
||||||
else version (Posix)
|
|
||||||
{
|
|
||||||
import core.sys.posix.stdio : fdopen;
|
|
||||||
auto fp = fdopen(fd, modez);
|
|
||||||
}
|
|
||||||
errnoEnforce(fp);
|
errnoEnforce(fp);
|
||||||
}
|
}
|
||||||
|
else version (Posix)
|
||||||
|
{
|
||||||
|
import core.sys.posix.stdio : fdopen;
|
||||||
|
auto fp = fdopen(fd, modez);
|
||||||
|
errnoEnforce(fp);
|
||||||
|
}
|
||||||
|
else
|
||||||
|
static assert(0, "no fdopen() available");
|
||||||
|
|
||||||
this = File(fp, name);
|
this = File(fp, name);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue