jerryscript icon indicating copy to clipboard operation
jerryscript copied to clipboard

Namespace for internal functions

Open stephenkyle-ARM opened this issue 10 years ago • 7 comments

If jerryscript is intended to be built as an external library for inclusion into other projects, are there any thoughts on renaming all internal functions (for example, 'mem_init') - that may clash with functions in other libraries - to give them a namespace?

stephenkyle-ARM avatar May 11 '16 13:05 stephenkyle-ARM

We are tying to use jerry_ or ecma_ prefix everywhere. I think adding a prefix to the conflicting functions could be a good solution for the problem. IMHO, the whole jerry-core/mem directory should use jerry_mem_ prefix instead of mem_.

LaszloLango avatar May 11 '16 13:05 LaszloLango

Yes, mem_ is the namespace. If we want to change that we should change the directory name and change all prefixes.

zherczeg avatar May 12 '16 06:05 zherczeg

Thanks for the responses. I'd appreciate if the namespace could be changed for the mem functions, as I currently cannot build a binary with both jerryscript and a lwIP stack that I'm using, as I'm encountering this exact function name clash between them. Of course, in the meantime I can work around it by renaming the symbol in jerryscript, but it'd be great if this weren't necessary.

stephenkyle-ARM avatar May 13 '16 08:05 stephenkyle-ARM

Looks like this has been fixed, can we close this issue?

tilmannOSG avatar Jun 15 '16 11:06 tilmannOSG

Accidentally closed it, please confirm :)

tilmannOSG avatar Jun 15 '16 11:06 tilmannOSG

I hope so

zherczeg avatar Jun 15 '16 18:06 zherczeg

We can close this issue. The mem_init name clash is solved. If there will be other problems with the current function namespaces, then we can raise a new issue for them.

LaszloLango avatar Jun 16 '16 06:06 LaszloLango