mirror of
https://github.com/EQEmu/Server.git
synced 2025-12-13 06:21:28 +00:00
Add 64-bit ntoh/hton functions for Linux
BSD macros aren't tested, but should work. These should already be defined on Windows.
This commit is contained in:
parent
fafbecb055
commit
a9b98ed057
@ -83,4 +83,20 @@ typedef const char Const_char; //for perl XS
|
||||
#define DLLFUNC extern "C"
|
||||
#endif
|
||||
|
||||
// htonll and ntohll already defined on windows
|
||||
#ifndef WIN32
|
||||
# if defined(__linux__)
|
||||
# include <endian.h>
|
||||
# elif defined(__FreeBSD__) || defined(__NetBSD__)
|
||||
# include <sys/endian.h>
|
||||
# elif defined (__OpenBSD__)
|
||||
# include <sys/types.h>
|
||||
# define be16toh(x) betoh16(x)
|
||||
# define be32toh(x) betoh32(x)
|
||||
# define be64toh(x) betoh64(x)
|
||||
# endif
|
||||
# define htonll(x) htobe64(x)
|
||||
# define ntohll(x) be64toh(x)
|
||||
#endif
|
||||
|
||||
#endif
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user