fix Issue 17829 - core.stdc.errno does not work with -betterC#1917
fix Issue 17829 - core.stdc.errno does not work with -betterC#1917WalterBright merged 1 commit intodlang:masterfrom
Conversation
908d486 to
cd3f687
Compare
|
Thanks for your pull request, @WalterBright! Bugzilla references
|
8fca210 to
323f8fb
Compare
|
On Linux, this is failing because of: i.e. it is picking up a reference to |
|
You're still compiling in the errno.c file which has these functions. So must be something else. |
f271a27 to
ca3b2f0
Compare
|
Also fixed the use of |
|
@ibuclaw got the mysterious linux errors fixed. |
| else | ||
| { | ||
| static assert(0, "add system errno function"); | ||
| } |
There was a problem hiding this comment.
You can avoid repeating all the platform details by wrapping it in a function (similar to pureReprintReal in core.demangle):
extern(C) private {
pure @trusted @nogc nothrow pragma(mangle, "fakePureErrno") ref int pureErrno();
ref int fakePureErrno() { return errno(); }
}
|
A question: I like the concept of changing the |
It's a bit hackish, and I'm a bit proud of myself for stumbling onto that as a solution to the I also do not see any more convenient solution to |
ca3b2f0 to
56c42a9
Compare
56c42a9 to
04795c6
Compare
|
The ci/circleci failure appears to be spurious and unrelated. |
Sadly that's a common problem for many CIs in the last months. The underlying cause is that the install script tries to fetch the dub binary from code.dlang.org, but fails due to its bad reliability/unavailability. However, since DUB is part of the official release since 2.072, this point of failure could easily be removed: |
This avoids needing druntime by connecting directly to the C implementation of
errno. The C function actually returns anint*, but we call itref intso it automagically dereferences when called.