core.sys.posix.dirent: Add dirfd#22750
Conversation
|
Thanks for your pull request and interest in making D better, @dd86k! We are looking forward to reviewing it, and you should be hearing from a maintainer soon.
Please see CONTRIBUTING.md for more information. If you have addressed all reviews or aren't sure how to proceed, don't hesitate to ping us with a simple comment. Bugzilla referencesYour PR doesn't reference any Bugzilla issue. If your PR contains non-trivial changes, please reference a Bugzilla issue or create a manual changelog. Testing this PR locallyIf you don't have a local development environment setup, you can use Digger to test this PR: dub run digger -- build "master + dmd#22750" |
druntime/src/core/sys/posix/dirent.d
Outdated
| } | ||
| else | ||
| { | ||
| pragma(mangle, "dirfd") |
There was a problem hiding this comment.
Doesn't extern(C) already mangle it as dirfd?
There was a problem hiding this comment.
Yep, at least on most platforms (at least POSIX), but I left this as-is because the C extern definition in Phobos (std.process) had it, and I'd hate to break anything here.
Related: dlang/phobos#10976
There was a problem hiding this comment.
The reason Phobos had it is because it was defined in a function scope, where extern(C) would only affect the ABI and not the mangle. Here it would be more risky to have a special mangle override for this one function rather than make it consistent with the rest.
|
Did you mean to put the declaration in the middle of a section declaring other functions? Perhaps add the declaration immediately before |
Co-authored-by: Iain Buclaw <ibuclaw@gdcproject.org>
Co-authored-by: Iain Buclaw <ibuclaw@gdcproject.org>
Oh, yeah, I see that I accidentally put that in-between readdir/closedir. dirfd is neither TSF or XSI, so I'll move it higher, since it's typically defined rather high up. It is still POSIX-1.2008, though. |
|
On second thought.. I did define it after Up to anyone if it's preferred to have the binding on every version scope. |
D doesn't care about order of declarations / forward references. Move it higher up if that makes more sense. |
This commit adds the definition of dirfd, a POSIX function.
The pragma is left as-is, as it was (erroneously) defined in Phobos.
extern (D) added because the entire module is otherwise affected by extern (C).
(Take 2, switching branches everywhere gets a little messy, my bad.)