浏览代码

Fixed macos NSLog link issue.

Mark Sibly 7 年之前
父节点
当前提交
d6fe2ff23d
共有 3 个文件被更改,包括 24 次插入1 次删除
  1. 1 0
      modules/monkey/monkey.monkey2
  2. 1 1
      modules/monkey/native/bbmonkey.cpp
  3. 22 0
      modules/monkey/native/bbmonkey.mm

+ 1 - 0
modules/monkey/monkey.monkey2

@@ -19,6 +19,7 @@ Namespace monkey
 #Import "native/bbgc.cpp"
 
 #If __TARGET__="macos" Or __TARGET__="ios"
+#Import "native/bbmonkey.mm"
 #Import "native/bbstring.mm"
 #Endif
 

+ 1 - 1
modules/monkey/native/bbmonkey.cpp

@@ -25,7 +25,7 @@ void bb_printf( const char *fmt,... ){
 	va_end( args );
 }
 
-#else
+#elif !BB_IOS
 
 void bb_print( bbString str ){
 	puts( str.c_str() );fflush( stdout );

+ 22 - 0
modules/monkey/native/bbmonkey.mm

@@ -0,0 +1,22 @@
+
+#include "bbmonkey.h"
+
+#if BB_IOS
+
+void bb_print( bbString str ){
+
+	NSLog( @"MX2: %@",[NSString stringWithUTF8String:str.c_str() ] );
+}
+
+void bb_printf( const char *fmt,...){
+
+    va_list args;
+    
+    va_start( args,fmt );
+    
+    NSLog( @"MX2: %@",[[NSString alloc] initWithFormat:[NSString stringWithUTF8String:fmt] arguments:args] );
+    
+    va_end(args);
+}
+
+#endif