32 #define LOG(kind, ...) GNUNET_log_from (kind, "util-common-endian", __VA_ARGS__)
39 #if __BYTE_ORDER == __BIG_ENDIAN
41 #elif __BYTE_ORDER == __LITTLE_ENDIAN
42 return (((uint64_t) htonl (n)) << 32) + htonl (n >> 32);
44 #error byteorder undefined
56 #if __BYTE_ORDER == __BIG_ENDIAN
58 #elif __BYTE_ORDER == __LITTLE_ENDIAN
59 return (((uint64_t) ntohl (n)) << 32) + ntohl (n >> 32);
61 #error byteorder undefined
73 uint64_t *in = (uint64_t *) &d;
74 uint64_t *out = (uint64_t *) &
res;
86 uint64_t *in = (uint64_t *) &d;
87 uint64_t *out = (uint64_t *) &
res;
double GNUNET_ntoh_double(double d)
Convert double to host byte order.
uint64_t GNUNET_ntohll(uint64_t n)
Convert unsigned 64-bit integer to host byte order.
double GNUNET_hton_double(double d)
Convert double to network byte order.
uint64_t GNUNET_htonll(uint64_t n)
Convert unsigned 64-bit integer to network byte order.