From d7ef641d4e6d0e2157beb920bdd7d72fc6aecfd7 Mon Sep 17 00:00:00 2001 From: Vadim Zeitlin Date: Mon, 24 Mar 2008 23:13:12 +0000 Subject: [PATCH] fix wxExecute() compilation in ANSI build git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@52773 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775 --- include/wx/utils.h | 6 ++++-- src/msw/utilsexc.cpp | 4 ++++ src/unix/utilsunx.cpp | 6 ++++++ 3 files changed, 14 insertions(+), 2 deletions(-) diff --git a/include/wx/utils.h b/include/wx/utils.h index 86824cee31..a016ff9468 100644 --- a/include/wx/utils.h +++ b/include/wx/utils.h @@ -347,15 +347,17 @@ enum // If flags contain wxEXEC_SYNC, return -1 on failure and the exit code of the // process if everything was ok. Otherwise (i.e. if wxEXEC_ASYNC), return 0 on // failure and the PID of the launched process if ok. -WXDLLIMPEXP_BASE long wxExecute(wchar_t **argv, +WXDLLIMPEXP_BASE long wxExecute(const wxString& command, int flags = wxEXEC_ASYNC, wxProcess *process = NULL); WXDLLIMPEXP_BASE long wxExecute(char **argv, int flags = wxEXEC_ASYNC, wxProcess *process = NULL); -WXDLLIMPEXP_BASE long wxExecute(const wxString& command, +#if wxUSE_UNICODE +WXDLLIMPEXP_BASE long wxExecute(wchar_t **argv, int flags = wxEXEC_ASYNC, wxProcess *process = NULL); +#endif // wxUSE_UNICODE // execute the command capturing its output into an array line by line, this is // always synchronous diff --git a/src/msw/utilsexc.cpp b/src/msw/utilsexc.cpp index 2c39f64dce..515d506d63 100644 --- a/src/msw/utilsexc.cpp +++ b/src/msw/utilsexc.cpp @@ -1035,7 +1035,11 @@ long wxExecute(char **argv, int flags, wxProcess *handler) return wxExecuteImpl(argv, flags, handler); } +#if wxUSE_UNICODE + long wxExecute(wchar_t **argv, int flags, wxProcess *handler) { return wxExecuteImpl(argv, flags, handler); } + +#endif // wxUSE_UNICODE diff --git a/src/unix/utilsunx.cpp b/src/unix/utilsunx.cpp index 823a853b25..5b9a1f627d 100644 --- a/src/unix/utilsunx.cpp +++ b/src/unix/utilsunx.cpp @@ -382,6 +382,7 @@ public: } } +#if wxUSE_UNICODE ArgsArray(wchar_t **wargv) { int argc = 0; @@ -395,6 +396,7 @@ public: m_argv[i] = wxSafeConvertWX2MB(wargv[i]).release(); } } +#endif // wxUSE_UNICODE ~ArgsArray() { @@ -491,6 +493,8 @@ long wxExecute(const wxString& command, int flags, wxProcess *process) return wxExecute(argv, flags, process); } +#if wxUSE_UNICODE + long wxExecute(wchar_t **wargv, int flags, wxProcess *process) { ArgsArray argv(wargv); @@ -498,6 +502,8 @@ long wxExecute(wchar_t **wargv, int flags, wxProcess *process) return wxExecute(argv, flags, process); } +#endif // wxUSE_UNICODE + // wxExecute: the real worker function long wxExecute(char **argv, int flags, wxProcess *process) { -- 2.47.2