diff options
author | João Valverde <joao.valverde@tecnico.ulisboa.pt> | 2017-10-26 08:51:55 +0100 |
---|---|---|
committer | João Valverde <j@v6e.pt> | 2017-10-26 14:39:00 +0000 |
commit | ac804b59e242c57e225c390eb8d6bec359a7003f (patch) | |
tree | 914f047f0e08d253c284380b6a4960cabd2e2c69 /ws_attributes.h | |
parent | 296a36698b9ff2ab1beb3c21dc8409c3a276001c (diff) |
Improve our inet_ntop() wrapper
Also fix buffer length define, as it is not guaranteed to be 46 on
Windows (it never was guaranteed anyway for the libc implementation,
but the likelyhood of being greater was small).
Change-Id: I2db705d86f825765ed32ec70b8d22058b5d629e8
Reviewed-on: https://code.wireshark.org/review/24074
Reviewed-by: João Valverde <j@v6e.pt>
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 */ |