[cairo] internal cairo include syntax seems not flexible enough, backward-compatible fix proposal.

Fabien Costantini fab672000 at yahoo.fr
Sat Sep 20 00:56:26 PDT 2008

I was willing to include cairo include files using the cairo directory as follow:
    #include <cairo/cairo.h>
instead of
    #include <cairo.h>

This way,  I don't need to add a specific include directory statement in makefiles like -I /usr/local/include/cairo ,
provided that cairo is installed in common include directories.

The problem is that inside cairo.h (same remark for platform dependent includes like cairo-quartz.h an so on),
the lib uses the #include <myfile.h> syntax ; which prevents the compiler to also look in the current directory where the file including myfile.h is.

As an example in cairo.h, we find:
    #include <cairo-features.h>

But in cairo.h, we should have instead:
    #include "cairo-features.h"

Please note that this construction is _fully compatible_  with current compilation schemes (i.e: would also work if your system has a -I/usr/local/include/cairo definition).

So my proposal is :
Replace all cairo internal includes syntax using "" instead of <> when the include file concerned is in the cairo include directory.

It would be much easier for unix/cygwin users, and could in many situations avoid the need of encapsulated dirty  pkg-config tool invocation as `pkg-config --CXXFLAGS`.

Note that this could also simplify systematic include configuration in visualc devenv tools.

Any thoughts ?

Fabien Costantini.

More information about the cairo mailing list