Ecere SDK/eC Forums • View topic - C & eC Name mangling




Ecere SDK/eC Forums

Ecere Developers Community

C & eC Name mangling

General help with the eC language.

C & eC Name mangling

Postby jfbilodeau » Thu Feb 17, 2011 2:41 pm

Hey,

Is there any way to prevent ecc from mangling names of C functions?

For example, in CocoaDispatch.ec:
Code: Select all

bool CocoaDispatch_OnCreate(EcereWindowRef ref);


the symbol CocoaDispatch_OnCreate gets transformed to ___ecereNameSpace__ecere__gui__drivers__CocoaDispatch_OnCreate. I would prefer to use the original function name than the one generated by ecc.

Thanks!
jfbilodeau
 
Posts: 19
Joined: Wed Feb 09, 2011 11:47 am

Re: C & eC Name mangling

Postby jerome » Thu Feb 17, 2011 3:19 pm

That's happening because you are inside a namespace. The 'default' keyword is to get around that.

You can put it either at the global level, and all further symbols will be unmangled:

e.g.:
Code: Select all
default:
void MyUnmangledStuff()
{
}
private: // go back in eC mode


Or you can put it right before the function:
Code: Select all
default void MyUnmangledFunction()
{
}
jerome
Site Admin
 
Posts: 622
Joined: Sat Jan 16, 2010 11:16 pm

Re: C & eC Name mangling

Postby jfbilodeau » Thu Feb 17, 2011 3:23 pm

Thanks! I realized you have already mentioned the default keyword, but I forgot about it :oops:
jfbilodeau
 
Posts: 19
Joined: Wed Feb 09, 2011 11:47 am


Return to eC Language

Who is online

Users browsing this forum: No registered users and 2 guests

cron