From 22579175678b3aa4e96b2e1a0082f4804b754299 Mon Sep 17 00:00:00 2001 From: "Luke T. Shumaker" Date: Sat, 7 Dec 2024 23:40:50 -0700 Subject: libcr: Move preprocessor macros up --- libcr/coroutine.c | 18 +++++++++--------- 1 file changed, 9 insertions(+), 9 deletions(-) (limited to 'libcr/coroutine.c') diff --git a/libcr/coroutine.c b/libcr/coroutine.c index 3435bbb..b4306d9 100644 --- a/libcr/coroutine.c +++ b/libcr/coroutine.c @@ -128,8 +128,15 @@ * no longer exists. */ -#define ALWAYS_INLINE [[gnu::always_inline]] inline -#define NEVER_INLINE [[gnu::noinline]] +/* preprocessor macros ********************************************************/ + +/** Return `n` rounded up to the nearest multiple of `d` */ +#define ROUND_UP(n, d) ( ( ((n)+(d)-1) / (d) ) * (d) ) +#define ARRAY_LEN(arr) (sizeof(arr)/sizeof((arr)[0])) +#define NEXT_POWER_OF_2(x) ((1ULL)<<((sizeof(unsigned long long)*8)-__builtin_clzll(x))) + +#define ALWAYS_INLINE [[gnu::always_inline]] inline +#define NEVER_INLINE [[gnu::noinline]] /* platform support ***********************************************************/ @@ -357,13 +364,6 @@ } #endif -/* preprocessor macros ********************************************************/ - -/** Return `n` rounded up to the nearest multiple of `d` */ -#define ROUND_UP(n, d) ( ( ((n)+(d)-1) / (d) ) * (d) ) -#define ARRAY_LEN(arr) (sizeof(arr)/sizeof((arr)[0])) -#define NEXT_POWER_OF_2(x) ((1ULL)<<((sizeof(unsigned long long)*8)-__builtin_clzll(x))) - /* types **********************************************************************/ enum coroutine_state { -- cgit v1.2.3-2-g168b