]> git.ipfire.org Git - thirdparty/git.git/commitdiff
cmake: remove (_)UNICODE def on Windows in CMakeLists.txt
authorYuyi Wang <Strawberry_Str@hotmail.com>
Tue, 24 May 2022 12:57:01 +0000 (12:57 +0000)
committerJunio C Hamano <gitster@pobox.com>
Tue, 24 May 2022 23:06:02 +0000 (16:06 -0700)
`UNICODE` and `_UNICODE` are not required when building git on Windows.
Actually, they should not be predefined at all.

There're 2 evidences that `(_)UNICODE` is supposed to be nonexist:

compat/win32/trace2_win32_process_info.c:83: It uses jw_array_string
which accepts pe32.szExeFile as const char*.

t/helper/test-drop-caches.c:16: Calling to GetCurrentDirectory with
Buffer as char*.

The autotools build system never defines `UNICODE` and `_UNICODE` and
builds on Windows well.

Signed-off-by: Yuyi Wang <Strawberry_Str@hotmail.com>
Acked-by: Johannes Schindelin <johannes.schindelin@gmx.de>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
contrib/buildsystems/CMakeLists.txt

index 2844dd6c88d248080e8b741995ea5402a3c3e1a0..29acc4f0e15e29c274550ff164fa9cd9f1050649 100644 (file)
@@ -270,7 +270,7 @@ if(CMAKE_SYSTEM_NAME STREQUAL "Windows")
                                _CONSOLE DETECT_MSYS_TTY STRIP_EXTENSION=".exe"  NO_SYMLINK_HEAD UNRELIABLE_FSTAT
                                NOGDI OBJECT_CREATION_MODE=1 __USE_MINGW_ANSI_STDIO=0
                                USE_NED_ALLOCATOR OVERRIDE_STRDUP MMAP_PREVENTS_DELETE USE_WIN32_MMAP
-                               UNICODE _UNICODE HAVE_WPGMPTR ENSURE_MSYSTEM_IS_SET HAVE_RTLGENRANDOM)
+                               HAVE_WPGMPTR ENSURE_MSYSTEM_IS_SET HAVE_RTLGENRANDOM)
        list(APPEND compat_SOURCES
                compat/mingw.c
                compat/winansi.c