summaryrefslogtreecommitdiff
path: root/glib/gmacros.h
diff options
context:
space:
mode:
authorAlvarito050506 <donfrutosgomez@gmail.com>2021-08-11 19:33:08 -0300
committerPhilip Withnall <pwithnall@endlessos.org>2021-11-16 15:13:07 +0000
commit03753cda7909983e3b45ba2dd5572835b6bd37d3 (patch)
treee2c8695343d22c64ece81ca84d0ff4f79416be08 /glib/gmacros.h
parent1f1bf730a2ebec35bfc67e944b5ac43855c8c71f (diff)
downloadglib-03753cda7909983e3b45ba2dd5572835b6bd37d3.tar.gz
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.
Diffstat (limited to 'glib/gmacros.h')
-rw-r--r--glib/gmacros.h3
1 files changed, 2 insertions, 1 deletions
diff --git a/glib/gmacros.h b/glib/gmacros.h
index 7fc34d59d..d528531f4 100644
--- a/glib/gmacros.h
+++ b/glib/gmacros.h
@@ -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