[cairo] cairomm: Visual Studio WIN32 define clash with Surface::Type::WIN32
Kjell Ahlstedt
kjellahlstedt at gmail.com
Fri Mar 18 18:22:02 UTC 2022
Den 2022-03-17 kl. 19:30, skrev Michal Sudolsky:
>
> On Thu, Jan 7, 2021 at 4:21 PM James K. Lowden
> <jklowden at schemamania.org> wrote:
>
> On Thu, 7 Jan 2021 01:25:43 +0100
> Heiko Lewin <hlewin at gmx.de> wrote:
>
> > Can't you just "#define WIN32 WIN32"?
>
> +1
>
> Why didn't I think of that?
>
>
> error: 'WIN32' was not declared in this scope
> 13 | #define WIN32 WIN32
> | ^~~~~
>
> I think this is equivalent and portable:
>
>
> #ifdef WIN32
> #define WIN32_WAS_SET WIN32
> #undef WIN32
> #endif
> ....
> #ifdef WIN32_WAS_SET
> #define WIN32 WIN32_WAS_SET
> #undef WIN32_WAS_SET
> #endif
>
>
> C preprocessor does not work like that. None of these "tricks" would work.
>
The WIN32 define clash was fixed in cairomm 1.16.1. Use
Cairo::Surface::Type::WIN32_SURFACE instead of Cairo::Surface::Type::WIN32.
/Kjell
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://lists.cairographics.org/archives/cairo/attachments/20220318/cadee308/attachment.htm>
More information about the cairo
mailing list