Permalink
Browse files

10.8 BridgeSupport structure name fix

  • Loading branch information...
1 parent c5690f8 commit 6935da67d1508b45ef899d1cf961f23290c88359 @parmanoir committed May 17, 2012
@@ -87,13 +87,26 @@ - (BOOL)loadBridgeSupport:(NSString*)path
// 'st' struct
if ((c[1] == 'c' && (c[2] == 'o' || c[2] == 'l')) || c[1] == 'e' || (c[1] == 'f' && c[2] == 'u') || (c[1] == 's' && c[2] == 't'))
{
+ char* tagStart;
+ char* c0;
+
+ tagStart = c;
+parsename:
// Extract name
- char* tagStart = c;
for (; *c && *c != '\''; c++);
c++;
- char* c0 = c;
+ c0 = c;
for (; *c && *c != '\''; c++);
+ // 10.8 : 'name' might not be the first attribute in structures. Go back up to find it.
+ if (*c0 == '{') {
+ // Skip '
+ c++;
+ if (!*c)
+ return NSLog(@"No name in bridgesupport"), NO;
+ goto parsename;
+ }
+
id name = [[NSString alloc] initWithBytes:c0 length:c-c0 encoding:NSUTF8StringEncoding];
// Move to tag end
@@ -8,7 +8,7 @@
<arg type='f'/>
<retval type='{ccColor4F=ffff}'/>
</function>
-<struct name='ccColor4F' type='{ccColor4F=&quot;r&quot;f&quot;g&quot;f&quot;b&quot;f&quot;a&quot;f}'>
+<struct type='{ccColor4F=&quot;r&quot;f&quot;g&quot;f&quot;b&quot;f&quot;a&quot;f}' name='ccColor4F'>
<field name='r' declared_type='GLfloat' type='f'/>
<field name='g' declared_type='GLfloat' type='f'/>
<field name='b' declared_type='GLfloat' type='f'/>

0 comments on commit 6935da6

Please sign in to comment.