lib/diff: Add compile-time ABI check on 64 bit arches

Like what was done for most of the `ostree-repo.h` values.  Prep
for adding a new option.

Closes: #1223
Approved by: jlebon
This commit is contained in:
Colin Walters authored and Atomic Bot committed 2017-09-27 18:20:10 +00:00
1 parent b71a913e21
commit d319e75982
3 files changed
+15

No files matched your search

+4
View File
@@ -48,6 +48,10 @@
/* ABI Size checks for ostree-repo.h, only for LP64 systems;
* https://en.wikipedia.org/wiki/64-bit_computing#64-bit_data_models
*
* To generate this data, I used `pahole` from gdb. More concretely, `gdb --args
* /usr/bin/ostree`, then `start`, (to ensure debuginfo was loaded), then e.g.
* `$ pahole OstreeRepoTransactionStats`.
*/
#if __SIZEOF_POINTER__ == 8 && __SIZEOF_LONG__ == 8 && __SIZEOF_INT__ == 4
G_STATIC_ASSERT(sizeof(OstreeRepoTransactionStats) == sizeof(int) * 4 + 8 * 5);