mirror of
https://github.com/isar/libmdbx.git
synced 2025-01-06 18:54:14 +08:00
mdbx: add/fix 'fallthrough' for GCC 7.x
Change-Id: I45c57ea910978aaa857086d7794ad92ba0ae7157
This commit is contained in:
parent
03db768830
commit
6f6b360aba
@ -139,6 +139,14 @@
|
|||||||
# endif
|
# endif
|
||||||
#endif /* __deprecated */
|
#endif /* __deprecated */
|
||||||
|
|
||||||
|
#ifndef __fallthrough
|
||||||
|
# if __GNUC_PREREQ(7, 0) || __has_attribute(fallthrough)
|
||||||
|
# define __fallthrough __attribute__((fallthrough))
|
||||||
|
# else
|
||||||
|
# define __fallthrough do {} while(0)
|
||||||
|
# endif
|
||||||
|
#endif /* __fallthrough */
|
||||||
|
|
||||||
#ifndef __packed
|
#ifndef __packed
|
||||||
# if defined(__GNUC__) || __has_attribute(packed)
|
# if defined(__GNUC__) || __has_attribute(packed)
|
||||||
# define __packed __attribute__((packed))
|
# define __packed __attribute__((packed))
|
||||||
|
@ -7067,7 +7067,8 @@ int mdbx_cursor_put(MDBX_cursor *mc, MDBX_val *key, MDBX_val *data,
|
|||||||
offset *= 4; /* space for 4 more */
|
offset *= 4; /* space for 4 more */
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
/* FALLTHRU: Big enough MDBX_DUPFIXED sub-page */
|
/* FALLTHRU: Big enough MDBX_DUPFIXaED sub-page */
|
||||||
|
__fallthrough;
|
||||||
case MDBX_CURRENT | MDBX_NODUPDATA:
|
case MDBX_CURRENT | MDBX_NODUPDATA:
|
||||||
case MDBX_CURRENT:
|
case MDBX_CURRENT:
|
||||||
fp->mp_flags |= P_DIRTY;
|
fp->mp_flags |= P_DIRTY;
|
||||||
|
@ -718,6 +718,7 @@ static int check_meta_head(bool steady) {
|
|||||||
assert(false);
|
assert(false);
|
||||||
error(" - unexpected internal error (%s)\n",
|
error(" - unexpected internal error (%s)\n",
|
||||||
steady ? "meta_steady_head" : "meta_weak_head");
|
steady ? "meta_steady_head" : "meta_weak_head");
|
||||||
|
__fallthrough;
|
||||||
case 0:
|
case 0:
|
||||||
if (envinfo.mi_meta0_txnid != envinfo.mi_recent_txnid) {
|
if (envinfo.mi_meta0_txnid != envinfo.mi_recent_txnid) {
|
||||||
print(" - meta-%d txn-id mismatch recent-txn-id (%" PRIi64 " != %" PRIi64
|
print(" - meta-%d txn-id mismatch recent-txn-id (%" PRIi64 " != %" PRIi64
|
||||||
|
@ -195,6 +195,7 @@ int main(int argc, char *argv[]) {
|
|||||||
case 'l':
|
case 'l':
|
||||||
list = 1;
|
list = 1;
|
||||||
/*FALLTHROUGH*/;
|
/*FALLTHROUGH*/;
|
||||||
|
__fallthrough;
|
||||||
case 'a':
|
case 'a':
|
||||||
if (subname)
|
if (subname)
|
||||||
usage(prog);
|
usage(prog);
|
||||||
|
@ -271,6 +271,7 @@ struct actor_config : public config::actor_config_pod {
|
|||||||
case ac_hill:
|
case ac_hill:
|
||||||
if (!params.test_nops || params.test_nops >= nops)
|
if (!params.test_nops || params.test_nops >= nops)
|
||||||
return true;
|
return true;
|
||||||
|
__fallthrough;
|
||||||
default:
|
default:
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user