Account Options

  1. Sign in
The old Google Groups will be going away soon, but your browser is incompatible with the new version.
Google Groups Home
« Groups Home
inline functions
There are currently too many topics in this group that display first. To make this topic appear first, remove this option from another topic.
There was an error processing your request. Please try again.
flag
  7 messages - Collapse all  -  Translate all to Translated (View all originals)
The group you are posting to is a Usenet group. Messages posted to this group will make your email address visible to anyone on the Internet.
Your reply message has not been sent.
Your post was successful
 
From:
To:
Cc:
Followup To:
Add Cc | Add Followup-to | Edit Subject
Subject:
Validation:
For verification purposes please type the characters you see in the picture below or the numbers you hear by clicking the accessibility icon. Listen and type the numbers you hear
 
Ricardo Quesada  
View profile  
 More options May 14 2012, 8:54 pm
From: Ricardo Quesada <ricardoques...@gmail.com>
Date: Mon, 14 May 2012 17:54:12 -0700 (PDT)
Local: Mon, May 14 2012 8:54 pm
Subject: inline functions

Hi,

I am playing with the most recent version of JSCocoa.
And I noticed that I can't use custom inline C function (previously loading
the BridgeSupport file), but for example, CGPointMake works OK.

Any idea ?

Thanks.


 
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
Patrick Geiller  
View profile  
 More options May 14 2012, 9:42 pm
From: Patrick Geiller <parman...@gmail.com>
Date: Tue, 15 May 2012 03:42:26 +0200
Local: Mon, May 14 2012 9:42 pm
Subject: Re: inline functions

> I am playing with the most recent version of JSCocoa.
> And I noticed that I can't use custom inline C function (previously loading the BridgeSupport file), but for example, CGPointMake works OK.

Inline functions are compiled every time they're used, so they don't exist as something that can be called.

BridgeSupport can handle inline functions like CGPointMake because they're defined in an external library.
(CoreGraphics.framework/Versions/A/Resources/BridgeSupport/CoreGraphics.dyl ib)

See the help of gen_bridge_metadata
https://developer.apple.com/library/mac/#documentation/Darwin/Referen...

     Certain elements, such as inline functions, cannot be described in the metadata files. It is therefore
     required to generate a dynamic library in order to make the bridges use them. The gen_bridge_metadata
     tool can take care of that for you.


 
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
Ricardo Quesada  
View profile  
 More options May 15 2012, 12:24 am
From: Ricardo Quesada <ricardoques...@gmail.com>
Date: Mon, 14 May 2012 21:24:59 -0700 (PDT)
Local: Tues, May 15 2012 12:24 am
Subject: Re: inline functions

Thanks. It makes sense.


 
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
Ricardo Quesada  
View profile  
 More options May 15 2012, 7:58 pm
From: Ricardo Quesada <ricardoques...@gmail.com>
Date: Tue, 15 May 2012 16:58:25 -0700 (PDT)
Local: Tues, May 15 2012 7:58 pm
Subject: Re: inline functions

So, I created a dylib with gen_bridge_metada -F dylib, and now all the
inline functions are in the dylib (I verified this with the 'nm' command
line tool).

My question is: how can I use this dylib inside my project ?
I added it in the "copy resources", also in the "link binary with
libraries", but when I load the app it fails with this error:

*dyld: Library not loaded: ../Resources-Mac/cocos2d-mac.dylib*

*Reason: image not found*
*
*
Should I call dyld manually ?*
*

Do you know where should I put the .dylib file ? If possible, I would like
to avoid changing the LD_LIBRARY_PATH environment.*
*

Thank you,

Ricardo


 
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
Ricardo Quesada  
View profile  
 More options May 15 2012, 8:43 pm
From: Ricardo Quesada <ricardoques...@gmail.com>
Date: Tue, 15 May 2012 17:43:16 -0700 (PDT)
Local: Tues, May 15 2012 8:43 pm
Subject: Re: inline functions

Ignore my previous question (I managed to load the .dylib).

My current problem is that when I call the inline function from javascript,
JSCocoa gives me this error:

*2012-05-15 17:34:53.908 JavascriptTest[24154:503] toJSValueRef FAILED*

*2012-05-15 17:34:53.908 JavascriptTest[24154:503] JSException: Return
value not converted in ccc4f on line 369 of
/Users/rquesada/Library/Developer/Xcode/DerivedData/cocos2d-mac-elbpvrbdkhi jembzvwboldykqqaq/Build/Products/Debug/JavascriptTest.app/Contents/Resource s/js/test-action.js
*
*
*
ccc4 is defined like this:*
*

struct ccColor4F {

GLfloat r;

GLfloat g;

GLfloat b;

GLfloat a;

};

typedef struct ccColor4F ccColor4F;

static inline ccColor4F ccc4f(const GLfloat r, const GLfloat g, const
GLfloat b, const GLfloat a)

{

return (ccColor4F){r, g, b, a};

}

And the BridgeSupport for ccColor4F is:

<struct name='ccColor4F' type=
'{ccColor4F=&quot;r&quot;f&quot;g&quot;f&quot;b&quot;f&quot;a&quot;f}'>

<field name='r' declared_type='GLfloat' type='f'/>

<field name='g' declared_type='GLfloat' type='f'/>

<field name='b' declared_type='GLfloat' type='f'/>

<field name='a' declared_type='GLfloat' type='f'/>

</struct>

I am using the most recent JSCocoa from github, and I am manually loading
the bridgesupport file with:

[[BridgeSupportController sharedController] loadBridgeSupport
:cocos2dBridgeFilePath];

Am I doing something wrong ? Am I missing something ?

Thank you,

Ricardo


 
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
Patrick Geiller  
View profile  
 More options May 16 2012, 12:42 pm
From: Patrick Geiller <parman...@gmail.com>
Date: Wed, 16 May 2012 18:42:25 +0200
Local: Wed, May 16 2012 12:42 pm
Subject: Re: inline functions

> 2012-05-15 17:34:53.908 JavascriptTest[24154:503] toJSValueRef FAILED
> 2012-05-15 17:34:53.908 JavascriptTest[24154:503] JSException: Return value not converted in ccc4f on line 369 of /Users/rquesada/Library/Developer/Xcode/DerivedData/cocos2d-mac-elbpvrbdkhi jembzvwboldykqqaq/Build/Products/Debug/JavascriptTest.app/Contents/Resource s/js/test-action.js

Fixed, please pull.

 
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
Ricardo Quesada  
View profile  
 More options May 16 2012, 2:02 pm
From: Ricardo Quesada <ricardoques...@gmail.com>
Date: Wed, 16 May 2012 11:02:32 -0700
Local: Wed, May 16 2012 2:02 pm
Subject: Re: inline functions
Thanks for the quick fix!

On 16 May 2012 09:42, Patrick Geiller <parman...@gmail.com> wrote:


 
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
End of messages
« Back to Discussions « Newer topic     Older topic »