-
-
Notifications
You must be signed in to change notification settings - Fork 701
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Eliminate shared this from std/socket.d #5472
Conversation
I think we can now get rid of |
BTW, I'm skeptical about replacing
|
OK, I'll look into that. I think we're good with atexit only as long as we only mess with other C libraries. |
@CyberShadow just to make sure: on Posix getnameinfo, getaddrinfo, and freeaddrinfo can never be null weak symbols. Correct? |
Needs updates to documentation (e.g. lots of references to |
5fedb1b
to
50d1048
Compare
@CyberShadow done. All - I notice that |
Nice work. Would be good to see the project tester's results for this one (so no auto-merge so far).
Yeah, that's a bit of a Java-ism.
It would mean making the function a template. Currently it's virtual due to virtual-by-default, and because of that Socket methods are all pretty sensitive to breakage (see issue 16514). I guess there's also the small risk that there is code out there that already has |
Cool, so I guess this PR is good to go. @CyberShadow ? |
std/socket.d
Outdated
} | ||
|
||
// Now that we called WSAStartup, make sure we clean up, too. | ||
import core.stdc.stdlib; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
import core.stdc.stdlib : atexit;
as per CircleCI
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Urgh. Not a fan of this rule. I recall we introduced it to compensate for hijacking, which we since fixed.
Still lots of errors in the autotester. |
50d1048
to
07bd22c
Compare
Thanks for your pull request, @andralex! 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. |
OK, pushed fixes to the autotester problems. Flying blindly here... |
07bd22c
to
73b0f6e
Compare
moar fixes |
73b0f6e
to
82b92dd
Compare
Hmmm, so now we have a different problem:
It seems this is caused by switching from dynamic loading to statically linking. What library do we need to link with, and what's the cmdline syntax? Thx! |
You'll need to update the import libraries... :/ There are some definition files in druntime/def, but none for winsock. The best way may be to have the DMC import libraries updated. @WalterBright? |
Use
Unfortunately, no hits. Trying:
No hits there, either. I don't know where it is supposed to be; it isn't in the DMC distribution. |
You need to add getnameinfo and getaddrinfo (possibly others?) to ws2_32.lib. |
The dm\bin\coffimplib.exe program can be used to convert 32 bit MS-Coff files to OMF. |
82b92dd
to
485f015
Compare
Reverted the pull that causes problems on Windows. |
This should be good to go subject to the autotester passing. |
I'm throwing away this entire pile of dung and start anew. |
Redone in #5813 |
This ends up simplifying Posix a lot. It could be simplified even further.