Error: function std.stdio.setmode is not accessible from module a
Kirill Kryukov via Digitalmars-d-learn
digitalmars-d-learn at puremagic.com
Fri Nov 4 00:28:02 PDT 2016
On Wednesday, 2 November 2016 at 11:17:49 UTC, Jonathan M Davis
wrote:
>
> version(DIGITAL_MARS_STDIO)
> extern(C) int setmode(int, int) nothrow @nogc;
> else version(MICROSOFT_STDIO)
> {
> extern(C) int _setmode(int, int) nothrow @nogc;
> alias setmode = _setmode;
> }
>
> It really should be put in druntime though.
>
> - Jonathan M Davis
In case someone else needs this, here is a possible binding:
version(CRuntime_DigitalMars)
{
extern(C) int setmode(int, int) nothrow @nogc;
}
else version(CRuntime_Microsoft)
{
extern(C) int _setmode(int, int) nothrow @nogc;
alias setmode = _setmode;
}
(DIGITAL_MARS_STDIO and MICROSOFT_STDIO seem to be internal to
std.stdio)
More information about the Digitalmars-d-learn
mailing list