Internal APIs from cutils.c and other utility functions should be made static in the amalgamated source to prevent name clashes with the project it is linked to.
Suggested solutions:
-
use the preprocessor with a JS_INTERNAL storage class for such symbols that would expand to nothing in the regular case and to static in the amalgamated source
-
add the static keyword on all symbols not explicitly tagged as JS_EXTERN when amalgamating sources
Originally posted by @chqrlie in #936 (comment) with light editing by yours truly
Internal APIs from cutils.c and other utility functions should be made
staticin the amalgamated source to prevent name clashes with the project it is linked to.Suggested solutions:
use the preprocessor with a
JS_INTERNALstorage class for such symbols that would expand to nothing in the regular case and tostaticin the amalgamated sourceadd the
statickeyword on all symbols not explicitly tagged asJS_EXTERNwhen amalgamating sourcesOriginally posted by @chqrlie in #936 (comment) with light editing by yours truly