pg.ddx.io  pgsql-committers@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Daniel Gustafsson <dgustafsson@postgresql.org>
To: pgsql-committers@lists.postgresql.org
Subject: pgsql: oauth: Rename macro to avoid collisions on Windows
Date: Mon, 24 Feb 2025 21:35:37 +0000
Message-ID: <E1tmg6z-000Vwl-2F@gemulon.postgresql.org> (raw)

oauth: Rename macro to avoid collisions on Windows

Our json parsing defined the macros OPTIONAL and REQUIRED to decorate the
structs with for increased readability. This however collides with macros
in the <windef.h> header on Windows.

../src/interfaces/libpq/fe-auth-oauth-curl.c:398:9: warning: "OPTIONAL" redefined
  398 | #define OPTIONAL false
      |         ^~~~~~~~
In file included from D:/a/_temp/msys64/ucrt64/include/windef.h:9,
                 from D:/a/_temp/msys64/ucrt64/include/windows.h:69,
                 from D:/a/_temp/msys64/ucrt64/include/winsock2.h:23,
                 from ../src/include/port/win32_port.h:60,
                 from ../src/include/port.h:24,
                 from ../src/include/c.h:1331,
                 from ../src/include/postgres_fe.h:28,
                 from ../src/interfaces/libpq/fe-auth-oauth-curl.c:16:
include/minwindef.h:65:9: note: this is the location of the previous definition
   65 | #define OPTIONAL
      |         ^~~~~~~~

Rename to avoid compilation errors in anticipation of implementing
support for Windows.

Reported-by: Dave Cramer (on PostgreSQL Hacking Discord)

Branch
------
master

Details
-------
https://git.postgresql.org/pg/commitdiff/d1146dc2a72e96294045f7feb6d0f29082e1c71c

Modified Files
--------------
src/interfaces/libpq/fe-auth-oauth-curl.c | 34 +++++++++++++++----------------
1 file changed, 17 insertions(+), 17 deletions(-)



Message-ID: <E1tmg6z-000Vwl-2F@gemulon.postgresql.org>
Permalink:  ../E1tmg6z-000Vwl-2F@gemulon.postgresql.org/
Also on:    postgresql.org/message-id/E1tmg6z-000Vwl-2F@gemulon.postgresql.org

 · 

reply

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Reply to all the recipients using the --to and --cc options:
  reply via email

  To: pgsql-committers@postgresql.org
  Cc: dgustafsson@postgresql.org, pgsql-committers@lists.postgresql.org
  Subject: Re: pgsql: oauth: Rename macro to avoid collisions on Windows
  In-Reply-To: <E1tmg6z-000Vwl-2F@gemulon.postgresql.org>

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox