Commit 08e29126 authored by Marek Vavruša's avatar Marek Vavruša

ccan/compiler: attribute nonnull support

parent 65e8658c
......@@ -228,4 +228,16 @@
#define WARN_UNUSED_RESULT
#endif
#endif
#ifndef NON_NULL
#if HAVE_ATTRIBUTE_NONNULL
/**
* NON_NULL - nonnull attribute specifies that some function parameters should be non-null pointers.
*/
#define NON_NULL(...) __attribute__((nonnull(__VA_ARGS__)))
#else
#define NON_NULL(...)
#endif
#endif
#endif /* CCAN_COMPILER_H */
......@@ -2,4 +2,5 @@
#define HAVE_ATTRIBUTE_COLD 1
#define HAVE_ATTRIBUTE_NORETURN 1
#define HAVE_ATTRIBUTE_PURE 1
#define HAVE_ATTRIBUTE_UNUSED 1
\ No newline at end of file
#define HAVE_ATTRIBUTE_UNUSED 1
#define HAVE_ATTRIBUTE_NONNULL 1
\ No newline at end of file
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment