28 #ifndef WEBSOCKETPP_COMMON_NETWORK_HPP
29 #define WEBSOCKETPP_COMMON_NETWORK_HPP
36 #include <netinet/in.h>
39 #include <websocketpp/common/stdint.hpp>
45 inline bool is_little_endian() {
47 char *ptr =
reinterpret_cast<
char *>(&val);
66 inline uint64_t _htonll(uint64_t src) {
80 c = x.c[0]; x.c[0] = x.c[7]; x.c[7] = c;
81 c = x.c[1]; x.c[1] = x.c[6]; x.c[6] = c;
82 c = x.c[2]; x.c[2] = x.c[5]; x.c[5] = c;
83 c = x.c[3]; x.c[3] = x.c[4]; x.c[4] = c;
98 inline uint64_t _ntohll(uint64_t src) {