]> git.ipfire.org Git - thirdparty/systemd.git/commitdiff
macro-fundamental: add _nonnull_if_nonzero_
authorMike Yuan <me@yhndnzj.com>
Sat, 15 Feb 2025 22:02:52 +0000 (23:02 +0100)
committerYu Watanabe <watanabe.yu+github@gmail.com>
Sun, 16 Feb 2025 03:37:10 +0000 (12:37 +0900)
Introduced in gcc 15:
https://github.com/gcc-mirror/gcc/commit/19fe55c4801de50deee03b333e94d007aae222e3

src/fundamental/macro-fundamental.h

index 5eb31cd74283d623ac971721dd652906a66e1028..78a87d150b5c33f3eaa2d6027af05e692cf2f6bc 100644 (file)
 #  define _fallthrough_ __attribute__((__fallthrough__))
 #endif
 
+#if __GNUC__ >= 15
+#  define _nonnull_if_nonzero_(p, n) __attribute__((nonnull_if_nonzero(p, n)))
+#else
+#  define _nonnull_if_nonzero_(p, n)
+#endif
+
 #define XSTRINGIFY(x) #x
 #define STRINGIFY(x) XSTRINGIFY(x)