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.
This commit is contained in:
Chun-wei Fan 2019-07-09 18:17:02 +08:00
parent 2e39f4148e
commit 2bc73d7281

View File

@ -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