Files
git/compat
Johannes Schindelin c53c5450f5 mingw: replace mingw_startup() hack
Git for Windows has special code to retrieve the command-line parameters
(and even the environment) in UTF-16 encoding, so that they can be
converted to UTF-8. This is necessary because Git for Windows wants to
use UTF-8 encoded strings throughout its code, and the main() function
does not get the parameters in that encoding.

To do that, we used the __wgetmainargs() function, which is not even a
Win32 API function, but provided by the MINGW "runtime" instead.

Obviously, this method would not work with any other compiler than GCC,
and in preparation for compiling with Visual C++, we would like to avoid
that.

Lucky us, there is a much more elegant way: we simply implement wmain()
and link with -municode. The command-line parameters are passed to
wmain() encoded in UTF-16, as desired, and this method also works with
Visual C++ after adjusting the MSVC linker flags to force it to use
wmain().

Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de>
2019-02-20 12:43:34 +01:00
..
2019-02-20 12:43:23 +01:00
2019-02-20 12:43:34 +01:00
2019-02-20 12:43:34 +01:00
2019-02-20 12:43:34 +01:00
2017-01-23 11:02:34 -08:00
2018-10-31 12:48:59 +09:00