Download raw body.
Cruft: drop htonl() etc. from libc
> Date: Sat, 13 Apr 2024 02:15:33 +0200 > From: Christian Weisgerber <naddy@mips.inka.de> > > Philip Guenther: > > > > I believe that macros like htonl don't need functions, but this > > > diff is correct to keep a function which already exists. > > > > Unless explicitly specified as a macro, POSIX requires all functional > > interfaces to have a function prototype and external symbol. > > We only have htonl() etc. as macros and that is permitted by POSIX: > "On some implementations, these functions are defined as macros." > > We don't have any prototype for htonl() in our headers. > > If you want to get at the functions in libc, you need to #undef > htonl (or avoid including any headers that pull in the macro), and > provide your own prototype. > > Importantly, my proposed diff doesn't change any of that. And that is the right approach I think.
Cruft: drop htonl() etc. from libc