k-takata / Onigmo

Onigmo is a regular expressions library forked from Oniguruma.
Other
626 stars 94 forks source link

Separating or excluding the regcomp/regexec/regerror functions from the library. #160

Open pem opened 2 years ago

pem commented 2 years ago

The POSIX compatibility functions regcomp, regexec and regerror are included in the Onigmo library. There doesn't seem to be any way to avoid this without patching the code or build scripts. If there is one, please advice, we haven't found it.

This is a problem for us. We have a large application with lots of libraries, some of which uses the standard library functions regcomp et al, but we also use the Onigmo library (the native functions) in some places. If library A used regomp, and library B uses the native Onigmo functions, and both are linked in the same binary, A will use the functions in the Onigmo library, not the standard library versions. You might argue the it shouldn't matter, but it does for us. It's important that we know exactly which function is used. Or to put it differently, we want regcomp to mean the standard library function and nothing else, everywhere.

We can work around this by patching Makefile.in before building, but we would prefer if there was a supported way to do this. Either

Either method would be ok.