From 1797aff6a86770621d3ea9e0f725ad96754876b5 Mon Sep 17 00:00:00 2001 From: Colin Walters Date: Thu, 21 Sep 2017 15:44:24 -0400 Subject: [PATCH] lib/core: Add static assertions for OstreeRepoMode enum values Prep for adding an alias. Closes: #1209 Approved by: jlebon --- src/libostree/ostree-core.c | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/src/libostree/ostree-core.c b/src/libostree/ostree-core.c index 13dc6130..c81aa39c 100644 --- a/src/libostree/ostree-core.c +++ b/src/libostree/ostree-core.c @@ -32,6 +32,12 @@ #include "ostree-chain-input-stream.h" #include "otutil.h" +/* Generic ABI checks */ +G_STATIC_ASSERT(OSTREE_REPO_MODE_BARE == 0); +G_STATIC_ASSERT(OSTREE_REPO_MODE_ARCHIVE_Z2 == 1); +G_STATIC_ASSERT(OSTREE_REPO_MODE_BARE_USER == 2); +G_STATIC_ASSERT(OSTREE_REPO_MODE_BARE_USER_ONLY == 3); + #define ALIGN_VALUE(this, boundary) \ (( ((unsigned long)(this)) + (((unsigned long)(boundary)) -1)) & (~(((unsigned long)(boundary))-1)))