[cairo] cairomm: Visual Studio WIN32 define clash with Surface::Type::WIN32

Michal Sudolsky sudolskym at gmail.com
Thu Mar 17 18:30:32 UTC 2022


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.


>
> --jkl
>
> --
> cairo mailing list
> cairo at cairographics.org
> https://lists.cairographics.org/mailman/listinfo/cairo
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://lists.cairographics.org/archives/cairo/attachments/20220317/504a5169/attachment.htm>


More information about the cairo mailing list