Skip to content

Commit 91dfbbd

Browse files
authored
Always define the is_power_of_two function (#36)
It was only used in `assert` macros, so it only needs to be defined in debug mode. But since `rbs_assert` is a function, `is_power_of_two` always needs to be defined. Without this change, Sorbet fails to build with `c-api`.
1 parent e6e7900 commit 91dfbbd

1 file changed

Lines changed: 1 addition & 4 deletions

File tree

src/util/rbs_constant_pool.c

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -37,12 +37,9 @@ next_power_of_two(uint32_t v) {
3737
return v;
3838
}
3939

40-
#ifndef NDEBUG
41-
static bool
42-
is_power_of_two(uint32_t size) {
40+
static bool is_power_of_two(uint32_t size) {
4341
return (size & (size - 1)) == 0;
4442
}
45-
#endif
4643

4744
/**
4845
* Resize a constant pool to a given capacity.

0 commit comments

Comments
 (0)