From 72115a3034202a6db834427f9bf0a6434e17c083 Mon Sep 17 00:00:00 2001 From: Vadim Zeitlin Date: Sun, 3 Jun 2007 23:03:51 +0000 Subject: [PATCH] mingw32 doesn't define _tsystem so provide one ourselves (bug 1726904) [backport from HEAD] git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/branches/WX_2_8_BRANCH@46315 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775 --- include/wx/wxchar.h | 12 ++++++++++++ src/common/wxchar.cpp | 5 +++-- 2 files changed, 15 insertions(+), 2 deletions(-) diff --git a/include/wx/wxchar.h b/include/wx/wxchar.h index e237d86e59..b1da5ee56b 100644 --- a/include/wx/wxchar.h +++ b/include/wx/wxchar.h @@ -1218,10 +1218,22 @@ WXDLLIMPEXP_BASE wxWCharBuffer wxSetlocale(int category, const wxChar *locale); WXDLLIMPEXP_BASE double wxAtof(const wxChar *psz); #endif +/* + mingw32 doesn't provide _tsystem() even though it does provide all the other + stdlib.h functions wrappers so check for it separately: + */ +#if defined(__MINGW32__) && wxUSE_UNICODE && !defined(_tsystem) + #define wxNEED_WXSYSTEM +#endif + #ifdef wxNEED_WX_STDLIB_H WXDLLIMPEXP_BASE int wxAtoi(const wxChar *psz); WXDLLIMPEXP_BASE long wxAtol(const wxChar *psz); WXDLLIMPEXP_BASE wxChar * wxGetenv(const wxChar *name); +#define wxNEED_WXSYSTEM +#endif + +#ifdef wxNEED_WXSYSTEM WXDLLIMPEXP_BASE int wxSystem(const wxChar *psz); #endif diff --git a/src/common/wxchar.cpp b/src/common/wxchar.cpp index cf4e0a5be5..e8a0640487 100644 --- a/src/common/wxchar.cpp +++ b/src/common/wxchar.cpp @@ -2140,13 +2140,14 @@ wxChar * WXDLLEXPORT wxGetenv(const wxChar *name) return getenv(name); #endif } +#endif // wxNEED_WX_STDLIB_H +#ifdef wxNEED_WXSYSTEM int WXDLLEXPORT wxSystem(const wxChar *psz) { return system(wxConvLibc.cWX2MB(psz)); } - -#endif // wxNEED_WX_STDLIB_H +#endif // wxNEED_WXSYSTEM #ifdef wxNEED_WX_TIME_H WXDLLEXPORT size_t