From 7104ed845da4aca8c26dc8b1fe9fd0b708bada0e Mon Sep 17 00:00:00 2001 From: Stefan Csomor Date: Sat, 24 Jun 2017 22:01:15 +0200 Subject: [PATCH] Allow for compilation under iOS 11 The system() API call has been deprecated since iOS 8, so it's better not to use it at all, eventhough compilation only breaks in iOS 11. --- include/wx/wxcrt.h | 5 ++++- src/unix/utilsunx.cpp | 5 +++++ 2 files changed, 9 insertions(+), 1 deletion(-) diff --git a/include/wx/wxcrt.h b/include/wx/wxcrt.h index dbf556310c..2cbd853ecf 100644 --- a/include/wx/wxcrt.h +++ b/include/wx/wxcrt.h @@ -905,7 +905,9 @@ WX_STRTOX_FUNC(wxULongLong_t, wxStrtoull, wxCRT_StrtoullA, wxCRT_StrtoullW) #undef WX_STRTOX_FUNC - +// ios doesn't export system starting from iOS 11 anymore and usage was critical before +#if defined(__WXOSX__) && wxOSX_USE_IPHONE +#else // mingw32 doesn't provide _tsystem() even though it provides other stdlib.h // functions in their wide versions #ifdef wxCRT_SystemW @@ -913,6 +915,7 @@ inline int wxSystem(const wxString& str) { return wxCRT_SystemW(str.wc_str()); } #else inline int wxSystem(const wxString& str) { return wxCRT_SystemA(str.mb_str()); } #endif +#endif inline char* wxGetenv(const char *name) { return wxCRT_GetenvA(name); } inline wchar_t* wxGetenv(const wchar_t *name) { return wxCRT_GetenvW(name); } diff --git a/src/unix/utilsunx.cpp b/src/unix/utilsunx.cpp index 6dd2e9927e..15c0f9e642 100644 --- a/src/unix/utilsunx.cpp +++ b/src/unix/utilsunx.cpp @@ -247,6 +247,10 @@ int wxKill(long pid, wxSignal sig, wxKillError *rc, int flags) // Shutdown or reboot the PC bool wxShutdown(int flags) { +#if defined(__WXOSX__) && wxOSX_USE_IPHONE + wxUnusedVar(flags); + return false; +#else flags &= ~wxSHUTDOWN_FORCE; wxChar level; @@ -270,6 +274,7 @@ bool wxShutdown(int flags) } return system(wxString::Format("init %c", level).mb_str()) == 0; +#endif } // ----------------------------------------------------------------------------