aboutsummaryrefslogtreecommitdiff
path: root/include/platform.h
diff options
context:
space:
mode:
authorRon Yorston <rmy@pobox.com>2013-02-07 14:25:54 +0000
committerRon Yorston <rmy@pobox.com>2013-02-07 14:25:54 +0000
commitb604585914e032b28bef3e337a978e56a9069cda (patch)
treeb2ee0a3fb38d10397c602d0fe215ea3bbbf334c0 /include/platform.h
parent0eda07c7ff8cf1fc11bc1bda5383f884d7adf031 (diff)
parentba76b7a40b929878833731f76306b1c977cc8650 (diff)
downloadbusybox-w32-b604585914e032b28bef3e337a978e56a9069cda.tar.gz
busybox-w32-b604585914e032b28bef3e337a978e56a9069cda.tar.bz2
busybox-w32-b604585914e032b28bef3e337a978e56a9069cda.zip
Merge branch 'busybox' into merge
Diffstat (limited to 'include/platform.h')
-rw-r--r--include/platform.h5
1 files changed, 4 insertions, 1 deletions
diff --git a/include/platform.h b/include/platform.h
index 78d42fed9..b3eee55ee 100644
--- a/include/platform.h
+++ b/include/platform.h
@@ -222,6 +222,7 @@
222 222
223#include <stdint.h> 223#include <stdint.h>
224typedef int bb__aliased_int FIX_ALIASING; 224typedef int bb__aliased_int FIX_ALIASING;
225typedef long bb__aliased_long FIX_ALIASING;
225typedef uint16_t bb__aliased_uint16_t FIX_ALIASING; 226typedef uint16_t bb__aliased_uint16_t FIX_ALIASING;
226typedef uint32_t bb__aliased_uint32_t FIX_ALIASING; 227typedef uint32_t bb__aliased_uint32_t FIX_ALIASING;
227 228
@@ -229,7 +230,8 @@ typedef uint32_t bb__aliased_uint32_t FIX_ALIASING;
229 * a lvalue. This makes it more likely to not swap them by mistake 230 * a lvalue. This makes it more likely to not swap them by mistake
230 */ 231 */
231#if defined(i386) || defined(__x86_64__) || defined(__powerpc__) 232#if defined(i386) || defined(__x86_64__) || defined(__powerpc__)
232# define move_from_unaligned_int(v, intp) ((v) = *(bb__aliased_int*)(intp)) 233# define move_from_unaligned_int(v, intp) ((v) = *(bb__aliased_int*)(intp))
234# define move_from_unaligned_long(v, longp) ((v) = *(bb__aliased_long*)(longp))
233# define move_from_unaligned16(v, u16p) ((v) = *(bb__aliased_uint16_t*)(u16p)) 235# define move_from_unaligned16(v, u16p) ((v) = *(bb__aliased_uint16_t*)(u16p))
234# define move_from_unaligned32(v, u32p) ((v) = *(bb__aliased_uint32_t*)(u32p)) 236# define move_from_unaligned32(v, u32p) ((v) = *(bb__aliased_uint32_t*)(u32p))
235# define move_to_unaligned16(u16p, v) (*(bb__aliased_uint16_t*)(u16p) = (v)) 237# define move_to_unaligned16(u16p, v) (*(bb__aliased_uint16_t*)(u16p) = (v))
@@ -238,6 +240,7 @@ typedef uint32_t bb__aliased_uint32_t FIX_ALIASING;
238#else 240#else
239/* performs reasonably well (gcc usually inlines memcpy here) */ 241/* performs reasonably well (gcc usually inlines memcpy here) */
240# define move_from_unaligned_int(v, intp) (memcpy(&(v), (intp), sizeof(int))) 242# define move_from_unaligned_int(v, intp) (memcpy(&(v), (intp), sizeof(int)))
243# define move_from_unaligned_long(v, longp) (memcpy(&(v), (longp), sizeof(long)))
241# define move_from_unaligned16(v, u16p) (memcpy(&(v), (u16p), 2)) 244# define move_from_unaligned16(v, u16p) (memcpy(&(v), (u16p), 2))
242# define move_from_unaligned32(v, u32p) (memcpy(&(v), (u32p), 4)) 245# define move_from_unaligned32(v, u32p) (memcpy(&(v), (u32p), 4))
243# define move_to_unaligned16(u16p, v) do { \ 246# define move_to_unaligned16(u16p, v) do { \