Skip to content
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

Further improve FreeBSD support #63

Open
danfe opened this issue Feb 21, 2017 · 1 comment
Open

Further improve FreeBSD support #63

danfe opened this issue Feb 21, 2017 · 1 comment

Comments

@danfe
Copy link

danfe commented Feb 21, 2017

Two weeks ago I've added FSearch to FreeBSD Ports Collection. It required couple of changes in order to build that addressed certain Linux'isms. One of them (unconditional inclusion of linux/limits.h) was fixed in 917442e. The other issue seemingly remains: use of non-standard strverscmp() function.

This function is a GNU extension and thus is not present in other libc implementations, including (but not limited to) FreeBSD's. It turns out that it can be implemented using g_utf8_collate_key_for_filename() calls on compared strings (see the patches under files directory at the svnweb link above). This is probably better than writing strverscmp() implementation from scratch since FSearch is GTK/Glib application anyway, so it's OK to depend on functions offered by those APIs.

I did not wrap the code with any #ifndef __GNUC__ guards since there is no conflict to prevent in case of FreeBSD, and arguably it is better not to rely on some non-standard function in the first place (i.e., I'd probably simply used provided reference implementation under some non-clashy-with-GNUs-strverscmp name, regardless of the operating system and/or underlying standard C library).

@cboxdoerfer
Copy link
Owner

Awesome thank you. I'll have a look at your patches.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants