Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

Fixed some C++/Obj-C interop issues

  • Loading branch information...
commit b0425bc66d9e2d6b5597243c0274f9815248ec58 1 parent 567e77c
Dominic Szablewski authored
Showing with 10 additions and 2 deletions.
  1. +2 −2 Classes/Ejecta/EJBindingBase.h
  2. +8 −0 Classes/Ejecta/EJConvert.h
4 Classes/Ejecta/EJBindingBase.h
View
@@ -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++;
}
8 Classes/Ejecta/EJConvert.h
View
@@ -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
Please sign in to comment.
Something went wrong with that request. Please try again.