[cairo] win32 mingw build problems

Damian Frank damian.frank at gmail.com
Wed Jul 15 13:57:48 PDT 2009


I think cairo git sources are a bit broken, at least for win32.

The first problem is the use of ffs().  Apparently this is a POSIX function
that mingw doesn't include support for.  (See
http://www.nabble.com/undefined-reference-to-%60ffs%27-when-using--O0-td21607092.htmlfor
a conversation about this problem.)  I believe the official position
is
that it is best for each project to define its own implementation;
alternatively, for GCC, one can add -D ffs=__builtin_ffs to CFLAGS.  That
worked for me.

cairo-win32-surface appears to be missing #include
"cairo-surface-fallback-private.h", resulting in a compiler error about
_cairo_surface_fallback_composite.

cairo-script-private.h has some rather unhygienic macros for bswap_16() and
friends (which are used only on platforms like mingw which lack glibc's
byteswap.h).  Of note, the macro includes a trailing semicolon, which causes
the following error (and many similar).
  cairo-script-scanner.c: In function '_scan_file':
  cairo-script-scanner.c:791: error: expected ')' before ';' token

It's probably preferable (and much easier foor poor schmucks like me to
debug!) to use inline functions, like the cygwin headers do:
http://cygwin.com/cgi-bin/cvsweb.cgi/~checkout~/src/winsup/cygwin/include/byteswap.h?rev=1.1&content-type=text/plain&cvsroot=src

Fixing these makes cairo build, although I'm having shared library problems
that are almost certainly of my own creation.  (Sorry these aren't patches!)

Damian
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.cairographics.org/archives/cairo/attachments/20090715/49b2e74a/attachment.htm 


More information about the cairo mailing list