summaryrefslogtreecommitdiffstats
path: root/src/prelude.h
diff options
context:
space:
mode:
Diffstat (limited to 'src/prelude.h')
-rw-r--r--src/prelude.h6
1 files changed, 5 insertions, 1 deletions
diff --git a/src/prelude.h b/src/prelude.h
index 3521fe8..0944df1 100644
--- a/src/prelude.h
+++ b/src/prelude.h
@@ -50,6 +50,9 @@ extern const char bfs_version[];
#if __has_include(<paths.h>)
# define BFS_HAS_PATHS_H true
#endif
+#if __has_include(<stdbit.h>)
+# define BFS_HAS_STDBIT_H true
+#endif
#if __has_include(<sys/extattr.h>)
# define BFS_HAS_SYS_EXTATTR_H true
#endif
@@ -76,6 +79,7 @@ extern const char bfs_version[];
#define BFS_HAS_MNTENT_H __GLIBC__
#define BFS_HAS_PATHS_H true
+#define BFS_HAS_STDBIT_H (__STDC_VERSION__ >= C23)
#define BFS_HAS_SYS_EXTATTR_H __FreeBSD__
#define BFS_HAS_SYS_MKDEV_H false
#define BFS_HAS_SYS_PARAM_H true
@@ -133,7 +137,7 @@ extern const char bfs_version[];
/**
* Get the length of an array.
*/
-#define countof(array) (sizeof(array) / sizeof(0[array]))
+#define countof(...) (sizeof(__VA_ARGS__) / sizeof(0[__VA_ARGS__]))
/**
* False sharing/destructive interference/largest cache line size.