git@vger.kernel.org list mirror (unofficial, one of many)
 help / color / mirror / code / Atom feed
* [PATCH] Remove (_)UNICODE def on Windows in CMakeLists.txt
@ 2022-05-24 12:57 Yuyi Wang via GitGitGadget
  2022-05-24 18:54 ` Johannes Schindelin
  0 siblings, 1 reply; 4+ messages in thread
From: Yuyi Wang via GitGitGadget @ 2022-05-24 12:57 UTC (permalink / raw)
  To: git; +Cc: Sibi Siddharthan, Yuyi Wang, Yuyi Wang

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.

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

^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: [PATCH] Remove (_)UNICODE def on Windows in CMakeLists.txt
  2022-05-24 12:57 [PATCH] Remove (_)UNICODE def on Windows in CMakeLists.txt Yuyi Wang via GitGitGadget
@ 2022-05-24 18:54 ` Johannes Schindelin
  2022-05-24 19:09   ` Yuyi Wang
  0 siblings, 1 reply; 4+ messages in thread
From: Johannes Schindelin @ 2022-05-24 18:54 UTC (permalink / raw)
  To: Yuyi Wang via GitGitGadget; +Cc: git, Sibi Siddharthan, Yuyi Wang, Yuyi Wang

Hi,

On Tue, 24 May 2022, Yuyi Wang via GitGitGadget wrote:

> 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.

>
> 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
>
>

^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: [PATCH] Remove (_)UNICODE def on Windows in CMakeLists.txt
  2022-05-24 18:54 ` Johannes Schindelin
@ 2022-05-24 19:09   ` Yuyi Wang
  2022-05-25 10:17     ` Johannes Schindelin
  0 siblings, 1 reply; 4+ messages in thread
From: Yuyi Wang @ 2022-05-24 19:09 UTC (permalink / raw)
  To: johannes.schindelin
  Cc: Strawberry_Str, git, gitgitgadget, sibisiddharthan.github

Johannes Schindelin <Johannes.Schindelin@gmx.de> wrote:

> 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.

Thanks for your remind! However, it seems that my reply reaches the list
successfully with hotmail address.

^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: [PATCH] Remove (_)UNICODE def on Windows in CMakeLists.txt
  2022-05-24 19:09   ` Yuyi Wang
@ 2022-05-25 10:17     ` Johannes Schindelin
  0 siblings, 0 replies; 4+ messages in thread
From: Johannes Schindelin @ 2022-05-25 10:17 UTC (permalink / raw)
  To: Yuyi Wang; +Cc: git, gitgitgadget, sibisiddharthan.github

Hi,

On Wed, 25 May 2022, Yuyi Wang wrote:

> Johannes Schindelin <Johannes.Schindelin@gmx.de> wrote:
>
> > 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.
>
> Thanks for your remind! However, it seems that my reply reaches the list
> successfully with hotmail address.

Oh, that's good news! I am glad that this was fixed.

Thanks,
Dscho

^ permalink raw reply	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2022-05-25 10:17 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2022-05-24 12:57 [PATCH] Remove (_)UNICODE def on Windows in CMakeLists.txt Yuyi Wang via GitGitGadget
2022-05-24 18:54 ` Johannes Schindelin
2022-05-24 19:09   ` Yuyi Wang
2022-05-25 10:17     ` Johannes Schindelin

Code repositories for project(s) associated with this inbox:

	https://80x24.org/mirrors/git.git

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).