Fix compilation with MinGW -std=c++11 option.
With this option _strdup() is not available, so update the code defining wxCRT_StrdupA() to check for __WX_STRICT_ANSI_GCC__. Also try to simplify it a bit and make it more clear. Closes #15011. git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@73627 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
This commit is contained in:
parent
87b621a5b7
commit
63e1921d0b
@ -164,14 +164,15 @@ WXDLLIMPEXP_BASE void *calloc( size_t num, size_t size );
|
||||
#define wxCRT_StrxfrmW wcsxfrm
|
||||
#endif /* __WXWINCE__ */
|
||||
|
||||
/* Almost all compiler have strdup(), but VC++ for CE doesn't provide it.
|
||||
Another special case is gcc in strict ANSI mode: normally it doesn't provide
|
||||
strdup() but MinGW does provide it under MSVC-compatible name so test for it
|
||||
before checking __WX_STRICT_ANSI_GCC__. */
|
||||
#if (defined(__VISUALC__) && __VISUALC__ >= 1400) || \
|
||||
defined(__MINGW32__)
|
||||
/* Almost all compilers have strdup(), but VC++ and MinGW call it _strdup().
|
||||
And it's not available in MinGW strict ANSI mode nor under Windows CE. */
|
||||
#if (defined(__VISUALC__) && __VISUALC__ >= 1400)
|
||||
#define wxCRT_StrdupA _strdup
|
||||
#elif !(defined(__WXWINCE__) || defined(__WX_STRICT_ANSI_GCC__))
|
||||
#elif defined(__MINGW32__)
|
||||
#ifndef __WX_STRICT_ANSI_GCC__
|
||||
#define wxCRT_StrdupA _strdup
|
||||
#endif
|
||||
#elif !defined(__WXWINCE__)
|
||||
#define wxCRT_StrdupA strdup
|
||||
#endif
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user