diff options
author | Chun-wei Fan <fanc999@yahoo.com.tw> | 2019-07-09 18:17:02 +0800 |
---|---|---|
committer | Chun-wei Fan <fanc999@yahoo.com.tw> | 2019-07-10 10:32:49 +0800 |
commit | 2bc73d7281383c42fa32009eed639a4f4cc274c5 (patch) | |
tree | f518fdf6d95a89e1b2c7b9c7a118fd73e9954a62 | |
parent | 2e39f4148e787fddd7cd8ae76a39e915786ed572 (diff) | |
download | glib-2bc73d7281383c42fa32009eed639a4f4cc274c5.tar.gz |
glib/gmacros.h: Check for __clang__ for g_autoptr
clang-cl does support __attribute__((cleanup)), which is what is used
for the g_auto* macros, but neither it, nor clang.exe defines __GNUC__
when they are used in a MSVC cmd.exe environment. It does, however,
define __clang__.
So, check for the presence of the __clang__ macro to enable g_autoptr as
well, so that we can build things with MSVC builds that make use
of g_autoptr via pretending to be MSVC by using clang-cl.
-rw-r--r-- | glib/gmacros.h | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/glib/gmacros.h b/glib/gmacros.h index 2764d9552..5ca7beb38 100644 --- a/glib/gmacros.h +++ b/glib/gmacros.h @@ -1021,7 +1021,7 @@ #ifndef __GI_SCANNER__ -#ifdef __GNUC__ +#if defined (__GNUC__) || defined (__clang__) /* these macros are private */ #define _GLIB_AUTOPTR_FUNC_NAME(TypeName) glib_autoptr_cleanup_##TypeName |