mirror of
https://github.com/keymanapp/keyman.git
synced 2026-08-05 16:35:33 +00:00
When we read .kmx files, they have no alignment guarantees, so we need to tell the compiler to generate unaligned-safe code for accesses to `COMP_` structure members, because typically we point into the buffer and read at any offset. A .kmx file will generally be 2-byte aligned, as there are no structures or data types with smaller than 2 byte widths. There is no requirement that this be the case per the .kmx spec, though. So we use a 1 byte alignment attribute for the compiler, so it will generate safe code when reading these structs. Note that we are assuming that `COMP_KEYBOARD` is aligned because it is always the start of the file, so will be at the start of any buffer which will automatically be aligned correctly. We should probably review some of our design decisions and structs for KMXPlus given this. |
||
|---|---|---|
| .. | ||
| .gitignore | ||
| build.sh | ||
| keymanversion_build.in | ||
| km_types.h | ||
| kmx_file.h | ||
| test_assert.h | ||
| test_color.h | ||