Added lw_get_* macros for dword, byte and word.

FossilOrigin-Name: c09e6ec03e77ac3fd835171fb90b1ed78c7bb887f522b9c2f737c663df4c7804
This commit is contained in:
7u83@mail.ru 2015-03-28 07:59:50 +00:00
parent e3a13b24f7
commit 0b5c03e923
1 changed files with 10 additions and 0 deletions

View File

@ -143,6 +143,16 @@
(*((uint32_t*)(dst)) = htonl(dw),4)
#define lw_get_byte(src)\
(*(uint8_t*)(src))
#define lw_get_word(src) \
(ntohs( *(uint16_t*(src))))
#define lw_get_dword(src) \
(ntohl( *(uint32_t*(src))))
/* the following functions are defined as static inline and not as
macro to avoid any side effects */