summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--lib9p/internal.h1
-rw-r--r--libcr/coroutine.c2
2 files changed, 2 insertions, 1 deletions
diff --git a/lib9p/internal.h b/lib9p/internal.h
index d1c36cf..40cfcee 100644
--- a/lib9p/internal.h
+++ b/lib9p/internal.h
@@ -26,6 +26,7 @@ static_assert(CONFIG_9P_MAX_ERR_SIZE + CONFIG_9P_MAX_MSG_SIZE + 2*CONFIG_9P_MAX_
#define UNUSED(name) /* name __attribute__((unused)) */
#define ALWAYS_INLINE inline __attribute__((always_inline))
#define FLATTEN __attribute__((flatten))
+#define ARRAY_LEN(arr) (sizeof(arr)/sizeof((arr)[0]))
/* types **********************************************************************/
diff --git a/libcr/coroutine.c b/libcr/coroutine.c
index bc67cbb..fac0cd7 100644
--- a/libcr/coroutine.c
+++ b/libcr/coroutine.c
@@ -340,7 +340,7 @@ static cid_t coroutine_running = 0;
/** 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 array_len(arr) (sizeof(arr)/sizeof((arr)[0]))
static inline const char* coroutine_state_str(enum coroutine_state state) {
assert(state < array_len(coroutine_state_strs));