lib/core: Add static assertions for OstreeRepoMode enum values
authorColin Walters <walters@verbum.org>
Thu, 21 Sep 2017 19:44:24 +0000 (15:44 -0400)
committerAtomic Bot <atomic-devel@projectatomic.io>
Thu, 21 Sep 2017 22:17:55 +0000 (22:17 +0000)
Prep for adding an alias.

Closes: #1209
Approved by: jlebon

src/libostree/ostree-core.c

index 13dc61303eb4e9278af6390c5b01243b6dfdcb48..c81aa39cb7127a43008ee4efb1e39371d2140e03 100644 (file)
 #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)))