1 #ifndef UNALIGNED_H
2 #define UNALIGNED_H
3 
4 // Anything using these types is not alignment and endian clean.
5 
6 #if EMSCRIPTEN
7 #include <emscripten.h>
8 
9 typedef emscripten_align1_short unaligned_s16;
10 typedef emscripten_align1_int unaligned_s32;
11 typedef emscripten_align1_short unaligned_u16;
12 typedef emscripten_align1_int unaligned_u32;
13 typedef emscripten_align1_float unaligned_f32;
14 typedef emscripten_align1_double unaligned_f64;
15 
16 #else
17 
18 #include <stdint.h>
19 
20 typedef int16_t unaligned_s16;
21 typedef int32_t unaligned_s32;
22 typedef uint16_t unaligned_u16;
23 typedef uint32_t unaligned_u32;
24 typedef float  unaligned_f32;
25 typedef double unaligned_f64;
26 
27 #endif
28 
29 #endif
30