From e30b2b7c2cf820e6f4c4578a3797d6a02329c214 Mon Sep 17 00:00:00 2001 From: Simon Sobisch Date: Thu, 19 Sep 2024 07:44:51 +0200 Subject: [PATCH] WinCon: define all of PDC_WIDE, UNICODE, _UNICODE if one of those are defined Per MSDN one should always define both macros, as they are used in different contexts, but must match. The definition of `UNICODE` can also be provided by the build environment, especially with MSVC, in which case PDC_WIDE must be defined as well. --- wincon/pdcwin.h | 12 ++++++++++-- 1 file changed, 10 insertions(+), 2 deletions(-) diff --git a/wincon/pdcwin.h b/wincon/pdcwin.h index 06460bd5..aee59e67 100644 --- a/wincon/pdcwin.h +++ b/wincon/pdcwin.h @@ -12,8 +12,16 @@ #define PDC_WIDE #endif -#if defined(PDC_WIDE) && !defined(UNICODE) -# define UNICODE +#if defined( PDC_WIDE) || defined( UNICODE) || defined( _UNICODE) + #if !defined( PDC_WIDE) + # define PDC_WIDE + #endif + #if !defined( UNICODE) + # define UNICODE + #endif + #if !defined( _UNICODE) + # define _UNICODE + #endif #endif #define WIN32_LEAN_AND_MEAN