3 ms·
Just for a small example how both are not the same, in your C library if you move the positions of a field in a struct it can actually break ABI compatibility (
by DanielHB 2y ago
Just for a small example how both are not the same, in your C library if you move the positions of a field in a struct it can actually break ABI compatibility (meaning you need to recompile your software), but not API compatibility (meaning you don't need to update your code).
- thrtythreeforty 2y agoAnd the opposite is true too: you can break API (by renaming a field) while preserving the ABI (since it didn't move/change type).
- NekkoDroid 2y agoYou can also with certain type of APIs increase the size of structs and still be ABI compatible. This is usually done by encoding the size of the type as a member of the struct that is usually assigned via `x.size = sizeof(x)` and passed around as pointers. Takes real care to maintain that though. IIRC this appears somewhat frequently in Win32.