28 #ifndef WEBSOCKETPP_COMMON_NETWORK_HPP
29 #define WEBSOCKETPP_COMMON_NETWORK_HPP
36 #include <netinet/in.h>
43 inline bool is_little_endian() {
45 char *ptr = (
char*)&val;
53 inline uint64_t htonll(uint64_t src) {
54 static int typ = TYP_INIT;
60 if (typ == TYP_INIT) {
62 typ = (x.c[7] == 0x01ULL) ? TYP_BIGE : TYP_SMLE;
67 c = x.c[0]; x.c[0] = x.c[7]; x.c[7] = c;
68 c = x.c[1]; x.c[1] = x.c[6]; x.c[6] = c;
69 c = x.c[2]; x.c[2] = x.c[5]; x.c[5] = c;
70 c = x.c[3]; x.c[3] = x.c[4]; x.c[4] = c;
74 inline uint64_t ntohll(uint64_t src) {
82 #endif // WEBSOCKETPP_COMMON_NETWORK_HPP
Namespace for the WebSocket++ project.