Re: [PATCH 13/17] msvc: support building Git using MS Visual C++
- From
Johannes Schindelin <johannes.schindelin@gmx.de>
- Date
- Jun 19, 2019, 12:50 UTC
- Message-ID
- <nycvar.QRO.7.76.6.1906191442240.44@tvgsbejvaqbjf.bet>
- In-Reply-To
- <CAPUEsphHXxa6xbckKym7Nbx_E6aOzJYL+5j=xXa0oe3BLMrtbQ@mail.gmail.com>
Hi Carlo,
On Tue, 18 Jun 2019, Carlo Arenas wrote:
Show 15 quoted lines
> On Tue, Jun 18, 2019 at 5:26 AM Jeff Hostetler via GitGitGadget > <gitgitgadget@gmail.com> wrote: > > diff --git a/compat/mingw.c b/compat/mingw.c > > index d14d33308d..667285887a 100644 > > --- a/compat/mingw.c > > +++ b/compat/mingw.c > > @@ -2388,6 +2388,12 @@ static void maybe_redirect_std_handles(void) > > GENERIC_WRITE, FILE_FLAG_NO_BUFFERING); > > } > > > > +#ifdef _MSC_VER > > +#ifdef _DEBUG > > why not use DEBUG instead (without the leading underscore), then you > could also drop the -D_DEBUG below
As per https://docs.microsoft.com/en-us/cpp/build/reference/md-mt-ld-use-run-time-library?view=vs-2019, the convention is actually to define `_DEBUG` in debug mode and `NDEBUG` in release mode (yes, it's a bit redundant and possibly contradictory). My reading is that `DEBUG` is only a historical wart.
> ... > > + # BASIC_CLFAGS += -DUSE_MSVC_CRTDBG > > typo
Yep, and a copy-edited of the tyop I introduced in df5218b4c30b (config.mak.uname: support MSys2, 2016-01-13)!
Thanks! Johannes