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

Bill Spitzak spitzak at thefoundry.co.uk
Mon Sep 22 09:28:29 PDT 2008


I have to disagree with this. LOTS of software uses the "" syntax for 
internal header files. The fact that a program cannot use Cairo without 
the -I compiler switches being set is very annoying and makes it harder 
to add Cairo support to existing software. Not everybody thinks running 
"configure" is how you should be compiling software.

A quick search reveals that libpng, which is used by Cairo, does this. 
/usr/include/libpng/png.h includes "pngconf.h" in quotes.

You are correct that software should be written to not assume any 
searching of any locations for quoted files, that the only thing 
guaranteed to work is a file in the same directory, or a relative 
pathname. Note that the Borland example you gave obeys this.

David Turner wrote:
> As far as I remember, the implementation of #include "file" is 
> unspecified by the standard. while Visual C++ and GCC do first look at 
> 'directory where the current file is',
> some other compilers are known to have a different scheme (e.g. Borland 
> C++ uses 'current directory when compiling, then system dirs').
> 
> I would not recommend using #include "file" in any public API unless you 
> really like debugging weird install/path bugs on other people's computers...
> 
> 2008/9/20 Fabien Costantini <fab672000 at yahoo.fr <mailto:fab672000 at yahoo.fr>>

-- 
Bill Spitzak, Senior Software Engineer
The Foundry, 618 Hampton Drive, Venice, CA, 90291, USA
Tel: +1 310 399-4555 * Fax: +1 310 450-4516 * Web: www.thefoundry.co.uk
The Foundry Visionmongers Ltd * Registered in England and Wales No: 4642027


More information about the cairo mailing list