-
Notifications
You must be signed in to change notification settings - Fork 317
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
POSIX API replacement #210
Comments
That's a good way to do it, so I thought I would. |
are you refering to applications linked to oniguruma but using the (previous) POSIX API? #if POSIX_API_ENABLED
int regcomp(regex_t *restrict preg, const char *restrict pattern,
int cflags) { return onig_posix_regcomp((void*)preg, pattern, cflags); }
...
#endif they could even be weak aliases, for that matter. |
Added --enable-binary-compatible-posix-api=[yes/no] to configure. ./configure --enable-binary-compatible-posix-api=yes : Binary level compatible POSIX API Sorry, but I don't want to enable the POSIX API by default anymore. |
that's great, thanks! are the macros defined here f7ca475#diff-e6b2ff26a208acb48af0b6ffb093e623R176 still needed though? now that the switch --enable-binary-compatible-posix-api=yes provides those as wrappers? |
actually, scrap that. the macros you provide are handy and won't cause any issue as long as libc's regex.h isn't included. the only possible issue is that compiling the abi-compat wrapper funcs the macros get expanded (so one would end up with 2 onig_posix_regcomp in the lib), but i suppose you already checked that case. the only minor issue i see that's still left is regoff_t being int instead of ssize_t, but you're probably aware of the issues it causes ( http://ewontfix.com/9/ ) and it probably can't be changed anyway due to ABI compat. thanks again! |
You're right about regoff_t, it can't be changed. |
@kkos
Running Can you advice, please, how to go around this? Any help is appreciated, thanks! Update 1: |
@spershin You need Line 33 in e62a8e5
|
Thank you for pointing this out. Asking because with the new library I have one test failing - apparently it was expecting a failure, but now it actually returns a result:
Update: |
hello, i assume POSIX API was disabled by default to prevent clashes with libc's regex.h.
now that the posix api switch has been introduced it's possible to encounter installed oniguruma with and without the functionality.
however it would be interesting to use oniguruma over libc's version because according to this benchmark http://lh3lh3.users.sourceforge.net/reb.shtml it is up to 3x faster than GLIB.
therefore i would suggest that whether POSIX API is turned off or not, it should be made available using function names in the oniguruma namespace but with the POSIX signature, e.g.
and likewise for regexec/regfree.
this would allow a package to have a configure test like
checking whether oniguruma has onig_posix_regcomp()... yes
and then set a CPP macro like HAVE_ONIG_REGCOMP and then the code could do something likeand use regcomp and friends in the code without caring whether behind the scene work is done by libc or oniguruma.
The text was updated successfully, but these errors were encountered: