Welcome to mirror list, hosted at ThFree Co, Russian Federation.

git.blender.org/blender.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorCampbell Barton <ideasman42@gmail.com>2014-02-17 16:29:57 +0400
committerCampbell Barton <ideasman42@gmail.com>2014-02-17 16:32:00 +0400
commit4c512fb6427e7fda766ed179df2d3429cdae5117 (patch)
treed26a8715d8254bdc0068e780aa690b7c433fa97f /source/blender/blenlib/BLI_compiler_attrs.h
parent50b2c78ad8b6f994ceba77f548c39b2e510a98be (diff)
Compile Attrs: add ATTR_RETURNS_NONNULL
Diffstat (limited to 'source/blender/blenlib/BLI_compiler_attrs.h')
-rw-r--r--source/blender/blenlib/BLI_compiler_attrs.h7
1 files changed, 7 insertions, 0 deletions
diff --git a/source/blender/blenlib/BLI_compiler_attrs.h b/source/blender/blenlib/BLI_compiler_attrs.h
index fc16e7dbba6..0a93ae2566b 100644
--- a/source/blender/blenlib/BLI_compiler_attrs.h
+++ b/source/blender/blenlib/BLI_compiler_attrs.h
@@ -50,6 +50,13 @@
# define ATTR_NONNULL(...)
#endif
+/* never returns NULL */
+# if (__GNUC__ * 100 + __GNUC_MINOR__) >= 409 /* gcc4.9+ only */
+# define ATTR_RETURNS_NONNULL __attribute__((returns_nonnull))
+#else
+# define ATTR_RETURNS_NONNULL
+#endif
+
/* hint to mark function as it wouldn't return */
#if defined(__GNUC__) || defined(__clang__)
# define ATTR_NORETURN __attribute__((noreturn))