720104195ac958d28a0fc13aa51610d30315549a
[openwrt/svn-archive/archive.git] / toolchain / uClibc / patches-0.9.33.2 / 020-endian.h-add-some-handy-macros-to-be-used-in-syscall.patch
1 From: "Peter S. Mazinger" <ps.m@gmx.net>
2 Date: Thu, 21 Apr 2011 21:20:55 +0200
3 Subject: [PATCH] endian.h: add some handy macros to be used in syscalls
4
5 Signed-off-by: Peter S. Mazinger <ps.m@gmx.net>
6 Signed-off-by: Bernhard Reutner-Fischer <rep.dot.nop@gmail.com>
7 ---
8
9 --- a/include/endian.h
10 +++ b/include/endian.h
11 @@ -55,6 +55,17 @@
12 # define __LONG_LONG_PAIR(HI, LO) HI, LO
13 #endif
14
15 +#ifdef _LIBC
16 +# ifndef __ASSEMBLER__
17 +# include <stdint.h>
18 +# define OFF_HI(offset) (offset >> 31)
19 +# define OFF_LO(offset) (offset)
20 +# define OFF64_HI(offset) (uint32_t)(offset >> 32)
21 +# define OFF64_LO(offset) (uint32_t)(offset & 0xffffffff)
22 +# define OFF_HI_LO(offset) __LONG_LONG_PAIR(OFF_HI(offset), OFF_LO(offset))
23 +# define OFF64_HI_LO(offset) __LONG_LONG_PAIR(OFF64_HI(offset), OFF64_LO(offset))
24 +# endif
25 +#endif
26
27 #ifdef __USE_BSD
28 /* Conversion interfaces. */