[prev in list] [next in list] [prev in thread] [next in thread] 

List:       cairo
Subject:    Re: [cairo] cairomm: Visual Studio WIN32 define clash with Surface::Type::WIN32
From:       Kjell Ahlstedt <kjellahlstedt () gmail ! com>
Date:       2022-03-18 18:22:02
Message-ID: 86ca8324-f445-0015-22e2-9b6c3f9b1769 () gmail ! com
[Download RAW message or body]

Den 2022-03-17 kl. 19:30, skrev Michal Sudolsky:
>
> On Thu, Jan 7, 2021 at 4:21 PM James K. Lowden 
> <jklowden@schemamania.org> wrote:
>
>     On Thu, 7 Jan 2021 01:25:43 +0100
>     Heiko Lewin <hlewin@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

[Attachment #3 (text/html)]

<html>
  <head>
    <meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
  </head>
  <body>
    <div class="moz-cite-prefix">Den 2022-03-17 kl. 19:30, skrev Michal
      Sudolsky:<br>
    </div>
    <blockquote type="cite"
cite="mid:CABoc_47UuEuCyMdd5dLGCRt7=kwUuq1q0Q_vT4=NsRZYCzyA8A@mail.gmail.com">
      <meta http-equiv="content-type" content="text/html; charset=UTF-8">
      <div dir="ltr">
        <div dir="ltr"><br>
        </div>
        <div class="gmail_quote">
          <div dir="ltr" class="gmail_attr">On Thu, Jan 7, 2021 at 4:21
            PM James K. Lowden &lt;<a
              href="mailto:jklowden@schemamania.org"
              moz-do-not-send="true" class="moz-txt-link-freetext">jklowden@schemamania.org</a>&gt;
            wrote:<br>
          </div>
          <blockquote class="gmail_quote" style="margin:0px 0px 0px
            0.8ex;border-left:1px solid
            rgb(204,204,204);padding-left:1ex">On Thu, 7 Jan 2021
            01:25:43 +0100<br>
            Heiko Lewin &lt;<a href="mailto:hlewin@gmx.de"
              target="_blank" moz-do-not-send="true"
              class="moz-txt-link-freetext">hlewin@gmx.de</a>&gt; wrote:<br>
            <br>
            &gt; Can't you just "#define WIN32 WIN32"?<br>
            <br>
            +1<br>
            <br>
            Why didn't I think of that? </blockquote>
          <div><br>
          </div>
          <div>error: 'WIN32' was not declared in this scope<br>
               13 | #define WIN32 WIN32<br>
                  |                             ^~~~~<br>
          </div>
          <div><br>
          </div>
          <blockquote class="gmail_quote" style="margin:0px 0px 0px
            0.8ex;border-left:1px solid
            rgb(204,204,204);padding-left:1ex">I think this is
            equivalent and portable:</blockquote>
          <div><br>
            <blockquote class="gmail_quote" style="margin:0px 0px 0px
              0.8ex;border-left:1px solid
              rgb(204,204,204);padding-left:1ex">        #ifdef WIN32<br>
                      #define WIN32_WAS_SET  WIN32<br>
                      #undef WIN32<br>
                      #endif<br>
                      ....<br>
                      #ifdef WIN32_WAS_SET<br>
                      #define WIN32  WIN32_WAS_SET<br>
                      #undef WIN32_WAS_SET<br>
                      #endif</blockquote>
          </div>
          <div><br>
          </div>
          <div>C preprocessor does not work like that. None of these
            "tricks" would work.<br>
          </div>
          <br>
        </div>
      </div>
    </blockquote>
    <p>The WIN32 define clash was fixed in cairomm 1.16.1. Use
      Cairo::Surface::Type::WIN32_SURFACE instead of
      Cairo::Surface::Type::WIN32.</p>
    <p>/Kjell <br>
    </p>
  </body>
</html>


[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic