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 =
reinterpret_cast<char *
>(&val);
64 inline uint64_t _htonll(uint64_t src) {
65 static int typ = TYP_INIT;
71 if (typ == TYP_INIT) {
73 typ = (x.c[7] == 0x01ULL) ? TYP_BIGE : TYP_SMLE;
78 c = x.c[0]; x.c[0] = x.c[7]; x.c[7] = c;
79 c = x.c[1]; x.c[1] = x.c[6]; x.c[6] = c;
80 c = x.c[2]; x.c[2] = x.c[5]; x.c[5] = c;
81 c = x.c[3]; x.c[3] = x.c[4]; x.c[4] = c;
96 inline uint64_t _ntohll(uint64_t src) {
104 #endif // WEBSOCKETPP_COMMON_NETWORK_HPP
Namespace for the WebSocket++ project.