Why? ((unsigned long)(__u32)(x)) is the _correct_ answer on a big-endian
machine. How could that break libc?
If libc internally tries to do the htonl() functions and the above breaks
the function declaration, then libc is _wrong_.
As mentioned earlier, htonl() has traditionally always been just the
identity macro on big-endian systems, so if libc can't handle it then libc
is broken pretty much by definition. But this should be easy to fix: when
libc wants to actually implement the functions internally, just add a
#undef htonl
#undef ntohl
...
to that particular file before doing the function defines.
I know libc does the above for other things like this (again, this is
"standard practice" for implementing functions that are hidden by defines:
it's commonly used for stdio etc where some things can be #defines but
also require to be available as functions), so I'm surprised if it is
indeed missing the #undef's for this particular case.
Linus