summaryrefslogtreecommitdiffstats
path: root/include/zix/attributes.h
diff options
context:
space:
mode:
Diffstat (limited to 'include/zix/attributes.h')
-rw-r--r--include/zix/attributes.h11
1 files changed, 11 insertions, 0 deletions
diff --git a/include/zix/attributes.h b/include/zix/attributes.h
index c8f77c4..255b315 100644
--- a/include/zix/attributes.h
+++ b/include/zix/attributes.h
@@ -74,6 +74,17 @@
# define ZIX_UNUSED(name) name
#endif
+// Clang nullability annotations
+#if defined(__clang__) && __clang_major__ >= 7
+# define ZIX_NONNULL _Nonnull
+# define ZIX_NULLABLE _Nullable
+# define ZIX_ALLOCATED _Null_unspecified
+#else
+# define ZIX_NONNULL
+# define ZIX_NULLABLE
+# define ZIX_ALLOCATED
+#endif
+
/**
@}
*/