Permalink
Browse files

Fixed some C++/Obj-C interop issues

  • Loading branch information...
1 parent 567e77c commit b0425bc66d9e2d6b5597243c0274f9815248ec58 @phoboslab committed Nov 12, 2012
Showing with 10 additions and 2 deletions.
  1. +2 −2 Classes/Ejecta/EJBindingBase.h
  2. +8 −0 Classes/Ejecta/EJConvert.h
View
4 Classes/Ejecta/EJBindingBase.h
@@ -1,7 +1,7 @@
#import <Foundation/Foundation.h>
#import "EJApp.h"
-id objc_msgSend(id theReceiver, SEL theSelector, ...);
+#include <objc/message.h>
extern JSValueRef ej_global_undefined;
@@ -135,7 +135,7 @@ extern JSValueRef ej_global_undefined;
}
static inline bool JSStrIsEqualToStr( const JSChar * s1, const char * s2, int length ) {
- for( int i = 0; i < length && *s1 != '\0' && *s1 == *s2; i++ ) {
+ for( int i = 0; i < length && *s1 == *s2; i++ ) {
s1++;
s2++;
}
View
8 Classes/Ejecta/EJConvert.h
@@ -3,6 +3,10 @@
#import "EJCanvas/EJCanvasTypes.h"
+#ifdef __cplusplus
+extern "C" {
+#endif
+
NSString * JSValueToNSString( JSContextRef ctx, JSValueRef v );
JSValueRef NSStringToJSValue( JSContextRef ctx, NSString * string );
JSValueRef NSStringToJSValueProtect( JSContextRef ctx, NSString * string );
@@ -13,3 +17,7 @@ JSValueRef ColorRGBAToJSValue( JSContextRef ctx, EJColorRGBA c );
JSObjectRef ByteArrayToJSObject( JSContextRef ctx, unsigned char * bytes, int count );
void JSObjectToByteArray( JSContextRef ctx, JSObjectRef array, unsigned char * bytes, int count );
+
+#ifdef __cplusplus
+}
+#endif

0 comments on commit b0425bc

Please sign in to comment.