1
1

Add Solaris 10 portable_endian.h (#711)

Add htonll/ntohll if not defined
Этот коммит содержится в:
Jenkins BBVA 2018-03-09 19:28:48 +01:00 коммит произвёл Bruce A. Mah
родитель 85bedf1b83
Коммит 4fe72e1979

Просмотреть файл

@ -71,6 +71,16 @@
# include <netinet/in.h> # include <netinet/in.h>
# include <inttypes.h> # include <inttypes.h>
# if !defined (ntohll) || !defined(htonll)
# ifdef _BIG_ENDIAN
# define htonll(x) (x)
# define ntohll(x) (x)
# else
# define htonll(x) ((((uint64_t)htonl(x)) << 32) + htonl((uint64_t)(x) >> 32))
# define ntohll(x) ((((uint64_t)ntohl(x)) << 32) + ntohl((uint64_t)(x) >> 32))
# endif
# endif
# define be64toh(x) ntohll(x) # define be64toh(x) ntohll(x)
# define htobe64(x) htonll(x) # define htobe64(x) htonll(x)