mirror of
https://gitlab.gnome.org/GNOME/glib.git
synced 2024-11-10 03:16:17 +01:00
Better detection of the cleanup attribute.
Use g_macro__has_attribute to detect it instead of hardcoding __GNUC__ || __clang__. This adds support for a few compiler and is consistent with the rest of the gmacros.h file.
This commit is contained in:
parent
1f1bf730a2
commit
03753cda79
@ -783,6 +783,7 @@ g_macro__has_attribute_fallthrough
|
||||
g_macro__has_attribute_may_alias
|
||||
g_macro__has_attribute___noinline__
|
||||
g_macro__has_attribute_warn_unused_result
|
||||
g_macro__has_attribute_cleanup
|
||||
</SECTION>
|
||||
|
||||
<SECTION>
|
||||
|
@ -142,6 +142,7 @@
|
||||
#define g_macro__has_attribute___deprecated__ G_GNUC_CHECK_VERSION (3, 1)
|
||||
#define g_macro__has_attribute_may_alias G_GNUC_CHECK_VERSION (3, 3)
|
||||
#define g_macro__has_attribute_warn_unused_result G_GNUC_CHECK_VERSION (3, 4)
|
||||
#define g_macro__has_attribute_cleanup G_GNUC_CHECK_VERSION (3, 3)
|
||||
|
||||
#endif
|
||||
|
||||
@ -1187,7 +1188,7 @@
|
||||
|
||||
#ifndef __GI_SCANNER__
|
||||
|
||||
#if defined (__GNUC__) || defined (__clang__)
|
||||
#if g_macro__has_attribute(cleanup)
|
||||
|
||||
/* these macros are private */
|
||||
#define _GLIB_AUTOPTR_FUNC_NAME(TypeName) glib_autoptr_cleanup_##TypeName
|
||||
|
Loading…
Reference in New Issue
Block a user