diff options
author | Luke T. Shumaker <lukeshu@lukeshu.com> | 2024-12-07 23:40:50 -0700 |
---|---|---|
committer | Luke T. Shumaker <lukeshu@lukeshu.com> | 2024-12-08 08:27:23 -0700 |
commit | 22579175678b3aa4e96b2e1a0082f4804b754299 (patch) | |
tree | ff2a92962c42018cfb8f8c007bdd53092e7eb842 /libcr/coroutine.c | |
parent | 275afbe4f2fb37c431dece96ab1152e213d9624a (diff) |
libcr: Move preprocessor macros up
Diffstat (limited to 'libcr/coroutine.c')
-rw-r--r-- | libcr/coroutine.c | 18 |
1 files changed, 9 insertions, 9 deletions
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 { |