git/list[1] front-page[2] threads[3] people[4] search[5] about
 

Re: [PATCH] Remove (_)UNICODE def on Windows in CMakeLists.txt

From
Johannes Schindelin <johannes.schindelin@gmx.de>
Date
May 24, 2022, 18:54 UTC
Message-ID
<nycvar.QRO.7.76.6.2205242046470.352@tvgsbejvaqbjf.bet>
In-Reply-To
<pull.1269.git.git.1653397021384.gitgitgadget@gmail.com>
Hi,
On Tue, 24 May 2022, Yuyi Wang via GitGitGadget wrote:
Show 15 quoted lines
> From: Yuyi Wang <Strawberry_Str@hotmail.com>
>
> `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.

It _is_ true that we make a point of using the `*W()` suffix explicitly to ensure that we use the Unicode variants of the Win32 API functions.

And it is also true that we do not explicitly define `UNICODE` in `config.mak.uname`.

Therefore this patch is:
Acked-by: Johannes Schindelin <johannes.schindelin@gmx.de>

Ciao, Dscho

P.S.: Please note that the Git mailing list silently drops all mails from @hotmail.com addresses, as far as I remember. Therefore, if you reply, it may never reach the list.

Show 31 quoted lines
>
> Signed-off-by: Yuyi Wang <Strawberry_Str@hotmail.com>
> ---
>     Remove (_)UNICODE def on Windows in CMakeLists.txt
>
> Published-As: https://github.com/gitgitgadget/git/releases/tag/pr-git-1269%2FBerrysoft%2Fcmake%2Fwincompat-v1
> Fetch-It-Via: git fetch https://github.com/gitgitgadget/git pr-git-1269/Berrysoft/cmake/wincompat-v1
> Pull-Request: https://github.com/git/git/pull/1269
>
>  contrib/buildsystems/CMakeLists.txt | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
>
> diff --git a/contrib/buildsystems/CMakeLists.txt b/contrib/buildsystems/CMakeLists.txt
> index 185f56f414f..d52d973ab0d 100644
> --- a/contrib/buildsystems/CMakeLists.txt
> +++ b/contrib/buildsystems/CMakeLists.txt
> @@ -260,7 +260,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
>
> base-commit: 7a3eb286977746bc09a5de7682df0e5a7085e17c
> --
> gitgitgadget
>
>
Previous: Yuyi Wang via GitGitGadgetNext: Yuyi Wang
Message 2 of 4 in “Remove (_)UNICODE def on Windows in CMakeLists.txt”
  1. Remove (_)UNICODE def on Windows in CMakeLists.txtYuyi Wang via GitGitGadget, May 24, 2022
  2. Johannes SchindelinMay 24, 2022
  3. Yuyi WangMay 24, 2022
  4. Johannes SchindelinMay 25, 2022

Read the whole thread, see it on lore, or plain text.

$ cat FOOTERMessages come from the public archive at lore.kernel.org/git, fetched every hour. The front page is chosen and written each morning by an AI editor and can be wrong; the threads themselves are the record. About and API. For agents: an MCP server at https://gitlist.dev/mcp, and any thread, story or person page as Markdown by adding .md to its URL (or sending Accept: text/markdown). Details in /llms.txt.