You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
There are several functions in qjs which are too easy to collide as:
they are not static
they are not namespaced with a prefix.
There are two specific offenders I encountered, pstrcat & pstrcpy, both colliding with their equivalent implementations in tinycc. There are few more which have just too much of a generic name, like has_suffix.
All these "offenders" are declared in cutils.h and implemented in cutils.c.
My suggestion would be for these functions to be scoped with some prefix, as I don't think they are really meant to be used from outside qjs.
I ran into the same issue for qemacs, for the same reason... as the original author of these functions that Fabrice collected in cutils.[hc] and used in different projects. We should just scope them with a js_ prefix using #define or changing the calls in the qjs source files (actually very few instances). Other offenders include strstart, rqsort, [ui]{32,64}toa{,_radix} and digits36, utf8_xxx handlers, dbuf_xxx API...
Activity
saghul commentedon Dec 14, 2024
They are not zoomed in the API so their visibility should be hidden, how are you using them?
chqrlie commentedon Dec 14, 2024
I ran into the same issue for qemacs, for the same reason... as the original author of these functions that Fabrice collected in cutils.[hc] and used in different projects. We should just scope them with a
js_prefix using#defineor changing the calls in the qjs source files (actually very few instances). Other offenders includestrstart,rqsort,[ui]{32,64}toa{,_radix}anddigits36,utf8_xxxhandlers,dbuf_xxxAPI...KaruroChori commentedon Dec 14, 2024
Just statically linking qjs and tcc within the same project.
saghul commentedon Dec 14, 2024
👍 would either of you mind sending a pr?
chqrlie commentedon Dec 14, 2024
Will do! back in business :)
Removed some of the offending functions quickjs-ng#754
KaruroChori commentedon Dec 15, 2024
I already started changing some locally to make my project work
and pushed them in #755