Skip to content

gmacros.h: Add better support for clang-cl

Chun-wei Fan requested to merge gmacros-h-support-clang-cl into master

Hi,

This is split out from MR !979 (merged) as it looks like this can land first without needing the build support, which will actually need to depend on a fix in Meson, as per @nirbheek's suggestions there. The updates here will make things more usable for clang-cl builds against (real) MSVC builds of the GTK stack using the GLib headers, notably to improve deprecation warning support and to enable g_autoptr support.

The rationale behind this is that

  • clang-cl will (understandably) define _MSC_VER

  • clang-cl will (understandably) not define __GNUC__

This, as a result, will also make MR !979 (merged) depend on this MR.

With blessings, thank you!

Edited by Philip Withnall

Merge request reports