Selaa lähdekoodia

Added ifdefs for C++.

NathanSweet 12 vuotta sitten
vanhempi
commit
c9fbe938b8

+ 10 - 0
spine-cocos2d-iphone/src/spine/spine-cocos2d-iphone.h

@@ -29,6 +29,11 @@
 #include <spine/spine.h>
 #include "cocos2d.h"
 
+#ifdef __cplusplus
+namespace spine {
+extern "C" {
+#endif
+
 typedef struct {
 	AtlasPage super;
 	CCTexture2D* texture;
@@ -116,4 +121,9 @@ typedef struct {
 	CCTextureAtlas* atlas;
 } Cocos2dRegionAttachment;
 
+#ifdef __cplusplus
+}
+}
+#endif
+
 #endif /* SPINE_COCOS2D_H_ */

+ 8 - 0
spine-cocos2d-iphone/src/spine/spine-cocos2d-iphone.m

@@ -26,6 +26,10 @@
 #include <spine/spine-cocos2d-iphone.h>
 #include <spine/extension.h>
 
+#ifdef __cplusplus
+namespace spine {
+#endif
+
 void _Cocos2dAtlasPage_dispose (AtlasPage* page) {
 	Cocos2dAtlasPage* self = SUB_CAST(Cocos2dAtlasPage, page);
 	_AtlasPage_deinit(SUPER(self));
@@ -373,3 +377,7 @@ RegionAttachment* RegionAttachment_create (const char* name, AtlasRegion* region
 char* _Util_readFile (const char* path, int* length) {
 	return _readFile([[[CCFileUtils sharedFileUtils] fullPathForFilename:@(path)] UTF8String], length);
 }
+
+#ifdef __cplusplus
+}
+#endif