[git commit future] endian.h: add some handy macros to be used in syscalls

Peter S. Mazinger ps.m at gmx.net
Wed Apr 20 10:50:38 UTC 2011


commit: http://git.uclibc.org/uClibc/commit/?id=341208e9023427a2510f5eed34f9acd87729e79e
branch: http://git.uclibc.org/uClibc/commit/?id=refs/heads/future

Signed-off-by: Peter S. Mazinger <ps.m at gmx.net>
---
 include/endian.h |   11 +++++++++++
 1 files changed, 11 insertions(+), 0 deletions(-)

diff --git a/include/endian.h b/include/endian.h
index 0ba7384..1e2fc93 100644
--- a/include/endian.h
+++ b/include/endian.h
@@ -55,6 +55,17 @@
 # define __LONG_LONG_PAIR(HI, LO) HI, LO
 #endif
 
+#ifdef _LIBC
+# ifndef __ASSEMBLER__
+#  include <stdint.h>
+#  define OFF_HI(offset) (offset >> 31)
+#  define OFF_LO(offset) (offset)
+#  define OFF64_HI(offset) (uint32_t)(offset >> 32)
+#  define OFF64_LO(offset) (uint32_t)(offset & 0xffffffff)
+#  define OFF_HI_LO(offset) __LONG_LONG_PAIR(OFF_HI(offset), OFF_LO(offset))
+#  define OFF64_HI_LO(offset) __LONG_LONG_PAIR(OFF64_HI(offset), OFF64_LO(offset))
+# endif
+#endif
 
 #ifdef __USE_BSD
 /* Conversion interfaces.  */
-- 
1.7.3.4



More information about the uClibc-cvs mailing list