C & eC Name mangling

General help with the eC language.
Post Reply
jfbilodeau
Posts: 19
Joined: Wed Feb 09, 2011 11:47 am

C & eC Name mangling

Post by jfbilodeau »

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!
jerome
Site Admin
Posts: 608
Joined: Sat Jan 16, 2010 11:16 pm

Re: C & eC Name mangling

Post by jerome »

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()
{
}
jfbilodeau
Posts: 19
Joined: Wed Feb 09, 2011 11:47 am

Re: C & eC Name mangling

Post by jfbilodeau »

Thanks! I realized you have already mentioned the default keyword, but I forgot about it :oops:
Post Reply