Only disable use of non-ANSI functions in strict ANSI mode under Windows.
authorVadim Zeitlin <vadim@wxwidgets.org>
Mon, 18 Jan 2010 00:27:59 +0000 (00:27 +0000)
committerVadim Zeitlin <vadim@wxwidgets.org>
Mon, 18 Jan 2010 00:27:59 +0000 (00:27 +0000)
commitf030eeed1e1d31dd5568b07e5a3aa56e8514fb14
tree3ef44bb00fefffed7c34a0fdf8d71a3a0974e311
parent62fc18efc1d12507e79ef77ca6bd5cc7e1924abd
Only disable use of non-ANSI functions in strict ANSI mode under Windows.

The changes of r62518 fixed compilation of wx headers in g++ strict ANSI mode
(enabled by th use of -ansi or -std=c++{98,0x} options) with mingw32 but
broke it when using g++ in ANSI mode under Unix. The problems arose at least
due to redeclaration of isascii() with different exception specifier and due
to the lack of wxCRT_StrdupA() definition in the library.

Fix this by simply not disabling the use of non-ANSI functions such as
isascii() and strdup() under Unix as they are still available in the headers
by default because of _GNU_SOURCE predefined by g++.

Notice that if _GNU_SOURCE is explicitly undefined, compilation would probably
still be broken. To fix this we might check whether __USE_SVID is defined
under Linux. Unfortunately doing tests in configure is not an answer as
wxWidgets might not be compiled with the same -std option as the programs
using it, so there is no obviously correct way to fix this.

See #11374.

git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@63164 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
include/wx/filefn.h
include/wx/wxcrtbase.h