hi,
during the conference it was mentioned that pike embedding support is not done yet because there are still namespace issues?
what does it take to fix those?
is it anything more than renaming all the functions (prefixing them with "pike_")?
greetings, martin.
Martin Bähr mbaehr@email.archlab.tuwien.ac.at wrote:
hi,
during the conference it was mentioned that pike embedding support is not done yet because there are still namespace issues?
what does it take to fix those?
is it anything more than renaming all the functions (prefixing them with "pike_")?
greetings, martin.
FYI, someone who was trying to get Pike embedded into a game showed up on #pike some days last week: http://supradigital.org/index.php?title=Azadi%28english%29
Seems like the last point of the page is still under discussion about wether to use Pike: (2. Mod-Programmers can modiify engine behaviour through the AngelScript language.)
Don't know if he succeed to get lipike running under windows.
Prefixing functions with Pike_ and adding static to those that are local to a file should do the trick.
Preferably done in such a way that the actual source code doesn't look much different (defines? typedefs?).
#ifdef COMPATIBILITY_SHORTHAND #define foobar Pike_foobar #define gazonk Pike_gazonk ... #endif
I'm actually not in favor of that. Changing the source code is a one time effort; providing a compatibility layer is magic that we're (albeit optionally) forced to deal with for the foreseeable future.
I understand that it would be a pain to update source code (and I have many thousands of lines of it myself), I think this is one of those situations where compatibility may not be the best thing.
Besides, if you're going to the trouble of generating a header that provides the mapping, why not just add it to an rsif script or something like that?
Bill
This work is needed to provide source code compatibility with external modules.
We have been doing this gradually for a long time, so the compatibility is worth it. When everyone agrees it's finished we could perhaps remove the compatibility layer in the next minor.
isn't that compatibility layer then creating the same namespace conflict that we are trying to remove?
greetings, martin.
The idea is that COMPATIBILITY_SHORTHAND should be defined when compiling pike itself (and its modules), but not when compiling the code which wants to use pike as an embedded language. Thus we don't pollute the namespace of the embedder.
Yes. I would suggest mangling thru all the object files to see which symbols we expose and then feed that list to a script which mangles the code to become prefixed with pike_ and adding a shorthand to a shorthand.h include.
pike-devel@lists.lysator.liu.se