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.
This commit is contained in:
@@ -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); }
|
||||
|
@@ -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
|
||||
}
|
||||
|
||||
// ----------------------------------------------------------------------------
|
||||
|
Reference in New Issue
Block a user