From 2ae81e680b8d6f8b9eb36fd1a2e223783526dbdd Mon Sep 17 00:00:00 2001 From: Jay Satiro Date: Mon, 29 Aug 2022 03:59:23 -0400 Subject: [PATCH] setup-win32: no longer define UNICODE/_UNICODE implicitly - If UNICODE or _UNICODE is defined but the other isn't then error instead of implicitly defining it. As Marcel pointed out it is too late at this point to make such a define because Windows headers may already be included, so likely it never worked. We never noticed because build systems that can make Windows Unicode builds always define both. If one is defined but not the other then something went wrong during the build configuration. Bug: https://github.com/curl/curl/pull/9375#discussion_r956545272 Reported-by: Marcel Raad Closes https://github.com/curl/curl/pull/9384 --- lib/setup-win32.h | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/lib/setup-win32.h b/lib/setup-win32.h index e54f9d7980..bc5f8efc3c 100644 --- a/lib/setup-win32.h +++ b/lib/setup-win32.h @@ -37,10 +37,10 @@ #ifdef HAVE_WINDOWS_H # if defined(UNICODE) && !defined(_UNICODE) -# define _UNICODE +# error "UNICODE is defined but _UNICODE is not defined" # endif # if defined(_UNICODE) && !defined(UNICODE) -# define UNICODE +# error "_UNICODE is defined but UNICODE is not defined" # endif /* * Don't include unneeded stuff in Windows headers to avoid compiler