mirror of
https://github.com/isar/libmdbx.git
synced 2025-03-06 17:58:13 +08:00
mdbx-test: portability - undefine BSD's roundup2() macro.
Change-Id: Ib7aa43645cabba648ed6a43bfb26a7cc365d7feb
This commit is contained in:
parent
fac0c4c5c0
commit
814f8fe7ab
@ -235,6 +235,7 @@ static __inline uint64_t mul_64x64_high(uint64_t a, uint64_t b) {
|
|||||||
|
|
||||||
static __inline bool is_power2(size_t x) { return (x & (x - 1)) == 0; }
|
static __inline bool is_power2(size_t x) { return (x & (x - 1)) == 0; }
|
||||||
|
|
||||||
|
#undef roundup2
|
||||||
static __inline size_t roundup2(size_t value, size_t granularity) {
|
static __inline size_t roundup2(size_t value, size_t granularity) {
|
||||||
assert(is_power2(granularity));
|
assert(is_power2(granularity));
|
||||||
return (value + granularity - 1) & ~(granularity - 1);
|
return (value + granularity - 1) & ~(granularity - 1);
|
||||||
|
Loading…
x
Reference in New Issue
Block a user