mirror of
https://gitlab.gnome.org/GNOME/glib.git
synced 2025-01-27 06:26:15 +01:00
gmacros: mark functions generated by autoptr macros as unused
clang will warn with -Wunused-function if the g_autoptr macros are ever used inside a .c file. This would break a lot of -Werror builds with clang. Mark such functions as explicitly unsed so clang will not warn about them.
This commit is contained in:
parent
90f93a64f2
commit
6971528f65
@ -1061,11 +1061,11 @@
|
||||
_GLIB_DEFINE_AUTOPTR_CLEANUP_FUNCS(TypeName, TypeName, func)
|
||||
#define G_DEFINE_AUTO_CLEANUP_CLEAR_FUNC(TypeName, func) \
|
||||
G_GNUC_BEGIN_IGNORE_DEPRECATIONS \
|
||||
static inline void _GLIB_AUTO_FUNC_NAME(TypeName) (TypeName *_ptr) { (func) (_ptr); } \
|
||||
static G_GNUC_UNUSED inline void _GLIB_AUTO_FUNC_NAME(TypeName) (TypeName *_ptr) { (func) (_ptr); } \
|
||||
G_GNUC_END_IGNORE_DEPRECATIONS
|
||||
#define G_DEFINE_AUTO_CLEANUP_FREE_FUNC(TypeName, func, none) \
|
||||
G_GNUC_BEGIN_IGNORE_DEPRECATIONS \
|
||||
static inline void _GLIB_AUTO_FUNC_NAME(TypeName) (TypeName *_ptr) { if (*_ptr != none) (func) (*_ptr); } \
|
||||
static G_GNUC_UNUSED inline void _GLIB_AUTO_FUNC_NAME(TypeName) (TypeName *_ptr) { if (*_ptr != none) (func) (*_ptr); } \
|
||||
G_GNUC_END_IGNORE_DEPRECATIONS
|
||||
#define g_autoptr(TypeName) _GLIB_CLEANUP(_GLIB_AUTOPTR_FUNC_NAME(TypeName)) _GLIB_AUTOPTR_TYPENAME(TypeName)
|
||||
#define g_autolist(TypeName) _GLIB_CLEANUP(_GLIB_AUTOPTR_LIST_FUNC_NAME(TypeName)) _GLIB_AUTOPTR_LIST_TYPENAME(TypeName)
|
||||
|
Loading…
Reference in New Issue
Block a user