diff options
Diffstat (limited to 'include')
-rw-r--r-- | include/platform.h | 2 |
1 files changed, 2 insertions, 0 deletions
diff --git a/include/platform.h b/include/platform.h index 7c88d1ba6..b3847f70d 100644 --- a/include/platform.h +++ b/include/platform.h | |||
@@ -174,12 +174,14 @@ char *strchrnul(const char *s, int c); | |||
174 | * a lvalue. This makes it more likely to not swap them by mistake | 174 | * a lvalue. This makes it more likely to not swap them by mistake |
175 | */ | 175 | */ |
176 | #if defined(i386) || defined(__x86_64__) | 176 | #if defined(i386) || defined(__x86_64__) |
177 | # define move_from_unaligned_int(v, intp) ((v) = *(int*)(intp)) | ||
177 | # define move_from_unaligned16(v, u16p) ((v) = *(uint16_t*)(u16p)) | 178 | # define move_from_unaligned16(v, u16p) ((v) = *(uint16_t*)(u16p)) |
178 | # define move_from_unaligned32(v, u32p) ((v) = *(uint32_t*)(u32p)) | 179 | # define move_from_unaligned32(v, u32p) ((v) = *(uint32_t*)(u32p)) |
179 | # define move_to_unaligned32(u32p, v) (*(uint32_t*)(u32p) = (v)) | 180 | # define move_to_unaligned32(u32p, v) (*(uint32_t*)(u32p) = (v)) |
180 | /* #elif ... - add your favorite arch today! */ | 181 | /* #elif ... - add your favorite arch today! */ |
181 | #else | 182 | #else |
182 | /* performs reasonably well (gcc usually inlines memcpy here) */ | 183 | /* performs reasonably well (gcc usually inlines memcpy here) */ |
184 | # define move_from_unaligned_int(v, intp) (memcpy(&(v), (intp), sizeof(int))) | ||
183 | # define move_from_unaligned16(v, u16p) (memcpy(&(v), (u16p), 2)) | 185 | # define move_from_unaligned16(v, u16p) (memcpy(&(v), (u16p), 2)) |
184 | # define move_from_unaligned32(v, u32p) (memcpy(&(v), (u32p), 4)) | 186 | # define move_from_unaligned32(v, u32p) (memcpy(&(v), (u32p), 4)) |
185 | # define move_to_unaligned32(u32p, v) do { \ | 187 | # define move_to_unaligned32(u32p, v) do { \ |