summaryrefslogtreecommitdiffstats
path: root/src/bfs.h
diff options
context:
space:
mode:
authorTavian Barnes <tavianator@tavianator.com>2025-05-26 10:26:12 -0400
committerTavian Barnes <tavianator@tavianator.com>2025-05-26 10:45:45 -0400
commit89969b4b0bea3bd4cddf97c989ca63f3a1aaa07c (patch)
tree58a244a7121a0000313b2044c139df2340e72ee1 /src/bfs.h
parent6fa72ff42d95dfd883d59ce7cf6bdc74abebf015 (diff)
downloadbfs-89969b4b0bea3bd4cddf97c989ca63f3a1aaa07c.tar.xz
Add support for __attribute__((counted_by(...)))
Diffstat (limited to 'src/bfs.h')
-rw-r--r--src/bfs.h9
1 files changed, 9 insertions, 0 deletions
diff --git a/src/bfs.h b/src/bfs.h
index 32dbbae..3cee727 100644
--- a/src/bfs.h
+++ b/src/bfs.h
@@ -219,6 +219,15 @@ extern const char bfs_ldlibs[];
#endif
/**
+ * Mark the size of a flexible array member.
+ */
+#if __has_attribute(counted_by)
+# define _counted_by(...) __attribute__((counted_by(__VA_ARGS__)))
+#else
+# define _counted_by(...)
+#endif
+
+/**
* Optimization hint to not unroll a loop.
*/
#if BFS_HAS_PRAGMA_NOUNROLL