fsearch icon indicating copy to clipboard operation
fsearch copied to clipboard

Further improve FreeBSD support

Open danfe opened this issue 7 years ago • 1 comments

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).

danfe avatar Feb 21 '17 10:02 danfe

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

cboxdoerfer avatar Mar 16 '17 18:03 cboxdoerfer