1
0
mirror of https://github.com/postgres/postgres.git synced 2026-01-05 23:38:41 +03:00

Enable MSVC conforming preprocessor

Switch MSVC to use the conforming preprocessor, using the
/Zc:preprocessor option.

This allows us to drop the alternative implementation of
VA_ARGS_NARGS() for the previous "traditional" preprocessor.

This also prepares the way for enabling C11 mode in the future, which
enables the conforming preprocessor by default.

This now requires Visual Studio 2019.  The installation documentation
is adjusted accordingly.

Discussion: https://www.postgresql.org/message-id/flat/01a69441-af54-4822-891b-ca28e05b215a%40eisentraut.org
This commit is contained in:
Peter Eisentraut
2025-07-01 09:36:33 +02:00
parent 732061150b
commit 8fd9bb1d96
3 changed files with 6 additions and 25 deletions

View File

@@ -279,6 +279,10 @@ elif host_system == 'windows'
# define before including <time.h> for getting localtime_r() etc. on MinGW
cppflags += '-D_POSIX_C_SOURCE'
endif
if cc.get_id() == 'msvc'
# required for VA_ARGS_NARGS() in c.h; requires VS 2019
cppflags += '/Zc:preprocessor'
endif
export_file_format = 'win'
export_file_suffix = 'def'