From 5673c1665a2c6d7fdaf1a20d554bb135a20c7bc8 Mon Sep 17 00:00:00 2001 From: Steven Fuller Date: Fri, 5 May 2017 12:00:00 +0200 Subject: Import icculus.org release (2017-05-05) --- src/unaligned.h | 29 +++++++++++++++++++++++++++++ 1 file changed, 29 insertions(+) create mode 100644 src/unaligned.h (limited to 'src/unaligned.h') diff --git a/src/unaligned.h b/src/unaligned.h new file mode 100644 index 0000000..a0a8594 --- /dev/null +++ b/src/unaligned.h @@ -0,0 +1,29 @@ +#ifndef UNALIGNED_H +#define UNALIGNED_H + +// Anything using these types is not alignment and endian clean. + +#if EMSCRIPTEN +#include + +typedef emscripten_align1_short unaligned_s16; +typedef emscripten_align1_int unaligned_s32; +typedef emscripten_align1_short unaligned_u16; +typedef emscripten_align1_int unaligned_u32; +typedef emscripten_align1_float unaligned_f32; +typedef emscripten_align1_double unaligned_f64; + +#else + +#include + +typedef int16_t unaligned_s16; +typedef int32_t unaligned_s32; +typedef uint16_t unaligned_u16; +typedef uint32_t unaligned_u32; +typedef float unaligned_f32; +typedef double unaligned_f64; + +#endif + +#endif -- cgit v1.3