Browse Source

libc.system removed in ios11

Mark Sibly 8 years ago
parent
commit
de42ab28dd
2 changed files with 12 additions and 0 deletions
  1. 2 0
      modules/libc/libc.monkey2
  2. 10 0
      modules/libc/native/libc.cpp

+ 2 - 0
modules/libc/libc.monkey2

@@ -116,7 +116,9 @@ Function puts:Int( str:CString )
 Function malloc:Void Ptr( size:Int )
 Function free:Void( mem:Void Ptr )
 
+#If __TARGET__<>"ios"	'gone in ios11!
 Function system:Int( cmd:CString )="system_"
+#endif
 Function setenv:Int( name:CString,value:CString,overwrite:Int )="setenv_"
 Function getenv:char_t ptr( name:CString )
 

+ 10 - 0
modules/libc/native/libc.cpp

@@ -7,6 +7,8 @@
 #if _MSC_VER
 #include <stdint.h>
 #endif
+#elif __APPLE__
+#include <TargetConditionals.h>
 #endif
 
 void setenv_( const char *name,const char *value,int overwrite ){
@@ -58,6 +60,12 @@ int system_( const char *cmd ){
 	CloseHandle( pi.hThread );
 
 	return res;
+	
+#elif __APPLE__
+
+#if !TARGET_OS_IPHONE
+	return system( cmd );
+#endif
 
 #else
 
@@ -65,6 +73,8 @@ int system_( const char *cmd ){
 
 #endif
 
+	return -1;
+
 }
 
 int mkdir_( const char *path,int mode ){