Commit bdb5f1e8 authored by Adam Wujek's avatar Adam Wujek

proto-standard: check endianess at compile time not in runtine

There is no htobe64 nor be64toh defined for wrpc.
Signed-off-by: 's avatarAdam Wujek <adam.wujek@creotech.pl>
parent 74b724d4
......@@ -7,15 +7,13 @@
#ifndef __MSG_H
#define __MSG_H
#define htonll(x) ((*(char *)&endianess == 1) ? \
htobe64(x) /* Little endian */ \
: \
(x)) /* Big endian */
#define ntohll(x) ((*(char *)&endianess == 1) ? \
be64toh(x) /* Little endian */ \
: \
(x)) /* Big endian */
#if __BYTE_ORDER == __BIG_ENDIAN
# define htonll(x) (x)
# define ntohll(x) (x)
#else
# define htonll(x) htobe64(x)
# define ntohll(x) be64toh(x)
#endif
extern const int endianess; /* use to check endianess */
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment