From 7611f085d54e137c9634d746f14ce4649776e798 Mon Sep 17 00:00:00 2001 From: Lukas Fittl Date: Mon, 1 Jan 2024 00:10:08 -0800 Subject: [PATCH] Handle clang on Windows --- scripts/pg_config_overrides.h | 7 ++++++- src/postgres/include/pg_config.h | 7 ++++++- 2 files changed, 12 insertions(+), 2 deletions(-) diff --git a/scripts/pg_config_overrides.h b/scripts/pg_config_overrides.h index be33bcba..f5d09ed5 100644 --- a/scripts/pg_config_overrides.h +++ b/scripts/pg_config_overrides.h @@ -96,9 +96,14 @@ #undef USE_SYSV_SHARED_MEMORY #define USE_WIN32_SEMAPHORES 1 #define USE_WIN32_SHARED_MEMORY 1 +#if defined(__clang__) +#define PG_PRINTF_ATTRIBUTE printf +#elif defined(__MINGW32__) || defined(__MINGW64__) || defined(__MSYS__) || defined(__CYGWIN__) +#define PG_PRINTF_ATTRIBUTE gnu_printf +#else #undef PG_PRINTF_ATTRIBUTE +#endif #if defined(__MINGW32__) || defined(__MINGW64__) || defined(__MSYS__) || defined(__CYGWIN__) -#define PG_PRINTF_ATTRIBUTE gnu_printf #undef HAVE_MBSTOWCS_L #undef HAVE_WCSTOMBS_L #define HAVE_CRTDEFS_H 1 diff --git a/src/postgres/include/pg_config.h b/src/postgres/include/pg_config.h index e44578b1..66e2d4a3 100644 --- a/src/postgres/include/pg_config.h +++ b/src/postgres/include/pg_config.h @@ -924,9 +924,14 @@ #undef USE_SYSV_SHARED_MEMORY #define USE_WIN32_SEMAPHORES 1 #define USE_WIN32_SHARED_MEMORY 1 +#if defined(__clang__) +#define PG_PRINTF_ATTRIBUTE printf +#elif defined(__MINGW32__) || defined(__MINGW64__) || defined(__MSYS__) || defined(__CYGWIN__) +#define PG_PRINTF_ATTRIBUTE gnu_printf +#else #undef PG_PRINTF_ATTRIBUTE +#endif #if defined(__MINGW32__) || defined(__MINGW64__) || defined(__MSYS__) || defined(__CYGWIN__) -#define PG_PRINTF_ATTRIBUTE gnu_printf #undef HAVE_MBSTOWCS_L #undef HAVE_WCSTOMBS_L #define HAVE_CRTDEFS_H 1