mattiasgustavsson / dos-like

Engine for making things with a MS-DOS feel, but for modern platforms
Other
1k stars 49 forks source link

Rename shutdown() to dos_shutdown() (Fixes #2) #8

Closed thp closed 3 years ago

thp commented 3 years ago

On Linux (and Unix-like operating systems), shutdown is the name of a function to shut down part of a full-duplex connection (sockets). The public, unmangled C function shutdown in dos.h clashes with this, resulting in #2. A fix is to just rename it. With careful use of the static keyword (so the shutdown symbol isn't exported) this could be worked around, but this is just more foolproof IMHO.

Feel free to bikeshed on the name and/or rename it yourself :)

mattiasgustavsson commented 3 years ago

Very nice, thanks for finding it. I think I’ll go with the name shuttingdown instead of dos_shutdown - but I can do that myself, I should be able to do it as changes to this PR I think