endian.h doesn't define htonl/ntohl
For context: I'm giving the CrystaX NDK a try on our cross-platform C++ code at Dropbox, previously built with NDK r11c, GCC 4.9, with GNU STL. I'm not sure if all of the issues I ran into will be considered bugs, but since your stated goal is to be a drop-in replacement I thought it worth sharing them as differences which an adopter has to deal with. We run with -Werror so any warnings will block our build.
The CrystaX version of endian.h doesn't define
htonl() and friends, which we'd been making use of on Android. Using
endian.h for this is non-standard, so may not be something you want to support, but it has worked on both Android and iOS in the past. The reason we make use of this rather than using
arpa/inet.h is that other contents of that header trigger warnings if compiled with strict warnings. Specifically,
socket.h triggers -Wcast-align. We've worked around this for files which only need
htonl() by usingendian.h`.
I've worked around this by providing my own definitions using
bswap32(), since the Android architectures we care about all have the same endianness anyway.