Bug 30968 - Cairo won't build on Win32 because there is no ffs function
Summary: Cairo won't build on Win32 because there is no ffs function
Status: RESOLVED DUPLICATE of bug 30277
Alias: None
Product: cairo
Classification: Unclassified
Component: win32 backend (show other bugs)
Version: 1.10.1
Hardware: Other All
: medium normal
Assignee: cairo-bugs mailing list
QA Contact: cairo-bugs mailing list
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2010-10-18 10:30 UTC by Neil Roberts
Modified: 2010-11-01 15:28 UTC (History)
1 user (show)

See Also:
i915 platform:
i915 features:


Attachments
win32: Add a workaround for missing ffs on MinGW (1.26 KB, patch)
2010-10-18 10:32 UTC, Neil Roberts
Details | Splinter Review

Description Neil Roberts 2010-10-18 10:30:59 UTC
Windows doesn't seem to provide an ffs function so I can't get Cairo to build. It looks like ffs is only used when the Intel atomic primitives are available so maybe this isn't affecting everyone.
Comment 1 Neil Roberts 2010-10-18 10:32:01 UTC
Created attachment 39510 [details] [review]
win32: Add a workaround for missing ffs on MinGW

On Windows it seems that msvcrt does not define an ffs function. There
is already a workaround for MSVC in cairo-compiler-private.h but this
does not help when compiling with MinGW. This patch adds an extra
check for when targetting Windows with GCC and makes it use
__builtin_ffs.
Comment 2 Martin Schlemmer 2010-11-01 06:50:34 UTC
I'm not too familiar with Cygwin, but not sure if the condition should be only for GCC and Win32:

#if defined(__GNUC__) && defined(__WIN32__)

Might be better to check for MinGW specifically, and also do a check that we do not have a ffs() implementation:

#if defined(__MINGW32__) && !defined(HAVE_FFS)
Comment 3 Adrian Johnson 2010-11-01 15:28:29 UTC

*** This bug has been marked as a duplicate of bug 30277 ***


Use of freedesktop.org services, including Bugzilla, is subject to our Code of Conduct. How we collect and use information is described in our Privacy Policy.