On 16 January 2013 17:31, Paolo Bonzini <pbonz...@redhat.com> wrote: > We can provide fast versions based on the other functions defined > by host-utils.h. Some care is required on glibc, which provides > ffsl already. > > Signed-off-by: Paolo Bonzini <pbonz...@redhat.com>
Hi. This patch breaks compile on MacOS (and likely other BSDs): CC qga/commands-posix.o In file included from qga/commands-posix.c:22: /Users/pm215/src/qemu/include/qemu/host-utils.h:248: error: static declaration of ‘ffsl’ follows non-static declaration (because BSD strings.h provides a system ffsl()). > +/* glibc does not provide an inline version of ffsl, so always define > + * ours. We need to give it a different name, however. > + */ > +#ifdef __GLIBC__ > +#define ffsl qemu_ffsl > +#endif Overriding a system function like this seems a bit brittle -- can't we either (a) always use the system version or (b) always use a QEMU implementation? Failing that, you probably need a configure test to check for system ffsl(). thanks -- PMM