Hello, On Windows the htons/htonl/ntohs/ntohl functions are much older and slower than the same functions found on other Operating Systems since the Windows versions of these functions do not make use of the native bswap processor instruction.
Intrinsic functions are available in both stdlib.h and intrin.h on multiple platforms for solving this issue, you can simply define the following in win32.h or enet.h for slightly better enet library performance: #define ntohl(x) _byteswap_ulong(x) #define ntohs(x) _byteswap_ushort(x) #define htonl(x) _byteswap_ulong(x) #define htons(x) _byteswap_ushort(x) #define ENET_HOST_TO_NET_16(value) (htons(value)) #define ENET_HOST_TO_NET_32(value) (htonl(value)) #define ENET_NET_TO_HOST_16(value) (ntohs(value)) #define ENET_NET_TO_HOST_32(value) (ntohl(value)) Would it be possible to include these in the enet library by default? -dmex _______________________________________________ ENet-discuss mailing list [email protected] http://lists.cubik.org/mailman/listinfo/enet-discuss
