Thread overview
[Issue 18816] [betterC] Standard Streams Unlinkable
May 01, 2018
dd86k
Aug 15, 2018
Seb
Aug 16, 2018
dd86k
Feb 12, 2022
Dlang Bot
Feb 14, 2022
Dlang Bot
May 01, 2018
https://issues.dlang.org/show_bug.cgi?id=18816

dd86k <devddstuff@gmail.com> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |devddstuff@gmail.com

--
August 15, 2018
https://issues.dlang.org/show_bug.cgi?id=18816

Seb <greensunny12@gmail.com> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |greensunny12@gmail.com
                 OS|All                         |Windows

--- Comment #1 from Seb <greensunny12@gmail.com> ---
FYI: this works just fine under Linux/-betterC (see e.g.
https://run.dlang.io/is/ys1XcZ), so it looks like this is solely a Windows
problem (changing the labels accordingly)

--
August 16, 2018
https://issues.dlang.org/show_bug.cgi?id=18816

--- Comment #2 from dd86k <devddstuff@gmail.com> ---
Forgot about this ticket.

I made it work under Windows, see https://github.com/dd86k/dd-dos/blob/master/src/ddc/ddc.d#L63-L69 (and _NFILE). I almost pulled the repo and make a pull request, so feel free to base a pull request off of my ddc.d source.

For people refusing to click on the Github link:
enum _NFILE = 20;
...
private extern extern(C) shared FILE[_NFILE] _iob;

shared stdin  = &_iob[0];
shared stdout = &_iob[1];
shared stderr = &_iob[2];
shared stdaux = &_iob[3];
shared stdprn = &_iob[4];

I had to play with the source a lot, but I'm happy to say my (temporary?) source works for -m32mscoff and -m64 under DMD and LDC2. -m32 under DMD remains unaffected since it uses the DigitalMars C runtime.

Works on my Windows 10 1506 machine. Might be different runtime version, who knows.

--
February 12, 2022
https://issues.dlang.org/show_bug.cgi?id=18816

Dlang Bot <dlang-bot@dlang.rocks> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
           Keywords|                            |pull

--- Comment #3 from Dlang Bot <dlang-bot@dlang.rocks> ---
@rainers created dlang/druntime pull request #3740 "fix issue 19933 and 18816: MSVC: Undefined std{in,out,err} with -betterC" fixing this issue:

- fix issue 19933 and 18816: MSVC: Undefined std{in,out,err} with -betterC

  moved C runtime check into template function

https://github.com/dlang/druntime/pull/3740

--
February 14, 2022
https://issues.dlang.org/show_bug.cgi?id=18816

Dlang Bot <dlang-bot@dlang.rocks> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|NEW                         |RESOLVED
         Resolution|---                         |FIXED

--- Comment #4 from Dlang Bot <dlang-bot@dlang.rocks> ---
dlang/druntime pull request #3740 "fix issue 19933 and 18816: MSVC: Undefined std{in,out,err} with -betterC" was merged into master:

- e7e6800babed4ff51b6c3b57dfa7e54cb76247f7 by Rainer Schuetze:
  fix issue 19933 and 18816: MSVC: Undefined std{in,out,err} with -betterC

  made stdin/out/err template function return value

https://github.com/dlang/druntime/pull/3740

--