Ecere SDK/eC Forums
http://ecere.org/community/
Print view

C & eC Name mangling
http://ecere.org/community/viewtopic.php?f=1&t=133
Page 1 of 1
Author:  jfbilodeau [ Thu Feb 17, 2011 2:41 pm ]
Post subject:  C & eC Name mangling

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!
Author:  jerome [ Thu Feb 17, 2011 3:19 pm ]
Post subject:  Re: C & eC Name mangling

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()
{
}
Author:  jfbilodeau [ Thu Feb 17, 2011 3:23 pm ]
Post subject:  Re: C & eC Name mangling

Thanks! I realized you have already mentioned the default keyword, but I forgot about it :oops:
All times are UTC-05:00 Page 1 of 1