Commit 0e3d08d4 authored by Simon McVittie's avatar Simon McVittie

Add _DBUS_GNUC_UNUSED, and use it in _DBUS_STATIC_ASSERT

This means we can use _DBUS_STATIC_ASSERT at non-global scope without
tripping -Wunused-local-typedefs.

Bug: https://bugs.freedesktop.org/show_bug.cgi?id=83767Reviewed-by: default avatarAlban Crequy <alban.crequy@collabora.co.uk>
parent 79c35a7d
......@@ -371,7 +371,7 @@ dbus_bool_t _dbus_get_local_machine_uuid_encoded (DBusString *uuid_str);
#define _DBUS_PASTE(a, b) _DBUS_PASTE2 (a, b)
#define _DBUS_STATIC_ASSERT(expr) \
typedef struct { char _assertion[(expr) ? 1 : -1]; } \
_DBUS_PASTE (_DBUS_STATIC_ASSERT_, __LINE__)
_DBUS_PASTE (_DBUS_STATIC_ASSERT_, __LINE__) _DBUS_GNUC_UNUSED
DBUS_END_DECLS
......
......@@ -69,9 +69,12 @@
__attribute__((__format__ (__printf__, format_idx, arg_idx)))
#define _DBUS_GNUC_NORETURN \
__attribute__((__noreturn__))
#define _DBUS_GNUC_UNUSED \
__attribute__((__unused__))
#else /* !__GNUC__ */
#define _DBUS_GNUC_PRINTF( format_idx, arg_idx )
#define _DBUS_GNUC_NORETURN
#define _DBUS_GNUC_UNUSED
#endif /* !__GNUC__ */
#if __GNUC__ > 2 || (__GNUC__ == 2 && __GNUC_MINOR__ >= 96)
......
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