I have a struct
similar to:
typedef struct _pair_t{
uint16_t keylen; // 2
uint32_t vallen; // 4
} __attribute__((__packed__)) pair_t;
I will be using mmap
to read from a file, so I want to store the numbers as big endian.
Do I need to do htobe16
/ betoh16
or there is some __attribute__
that can do this for me?