diff options
Diffstat (limited to 'ws_attributes.h')
-rw-r--r-- | ws_attributes.h | 8 |
1 files changed, 8 insertions, 0 deletions
diff --git a/ws_attributes.h b/ws_attributes.h index d07ae75324..488a9fabab 100644 --- a/ws_attributes.h +++ b/ws_attributes.h @@ -52,6 +52,14 @@ extern "C" { #define WS_NORETURN #endif +/* Hint to the compiler that the function returns a non-null value */ +#if defined(__GNUC__) + /* This includes clang */ + #define WS_RETNONNULL __attribute__((returns_nonnull)) +#else + #define WS_RETNONNULL +#endif + #ifdef __cplusplus } #endif /* __cplusplus */ |