1 /* 2 * Copyright (c) 2025 Robert Clausecker <fuz@FreeBSD.org> 3 * 4 * SPDX-License-Identifier: BSD-2-Clause 5 */ 6 7 #define FUNCSTEM stdc_bit_ceil 8 #define MKREFFUNC(name, type) \ 9 static type \ 10 name(type value) \ 11 { \ 12 type ceil = 1; \ 13 \ 14 while (ceil < value && ceil != 0) \ 15 ceil <<= 1; \ 16 \ 17 return (ceil); \ 18 } 19 20 #include "stdbit-test-framework.c" 21