summaryrefslogtreecommitdiffstats
path: root/src/prelude.h
diff options
context:
space:
mode:
authorTavian Barnes <tavianator@tavianator.com>2024-05-29 11:51:10 -0400
committerTavian Barnes <tavianator@tavianator.com>2024-05-29 11:53:18 -0400
commit377b427491bcbf00e97fe02f69ef253e5ea3a53b (patch)
tree80e2514977694451ae6fe629c875053691ab5d1e /src/prelude.h
parent26ac7e36c0710284d18d95eb0e58e21178396ffd (diff)
downloadbfs-377b427491bcbf00e97fe02f69ef253e5ea3a53b.tar.xz
bit: Use <stdbit.h> if it exists, even without -std=c23
glibc added an implementation in 2.39.
Diffstat (limited to 'src/prelude.h')
-rw-r--r--src/prelude.h4
1 files changed, 4 insertions, 0 deletions
diff --git a/src/prelude.h b/src/prelude.h
index 3521fe8..c4edcb2 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