cURL / Mailing Lists / curl-library / Single Mail

curl-library

Re: NSS support quirks

From: Axel Tillequin <axel.tillequin_at_gmail.com>
Date: Mon, 16 Jun 2008 15:26:55 +0200

> Both these should be using <> and not "" since the headers won't be in the same dir as the .c file, right?

well using <xxx> or "xxx" is not the real problem here.
Strictly speaking I would say that <> are for standardized headers
(ISO, POSIX) found in standard places (/usr/include in unix)
while "" are used for other headers. This makes things clear but is
probably too strict...
(reminds me some emacs/vi discussions with friends...)

In the case of Curl, the search path when I compile is -I../lib
-I/usr/include/nss -I/usr/include/nspr,
and well...sice we are in lib/, note that "-I../lib" is just "." here.
it means that
-<xxx> files are searched there in left-to-right order and finally in
my system standard /usr/include,
-"xxx" files are searched in "." and if not found like a <xxx>.

> Even if you use <base64.h> instead of "base64.h" ?

yes: with <base64.h>, ../lib/base64.h is found before
/usr/include/nss/base64.h...too bad right ?

using "xxx" for private local includes is fine but then you don't need -I../lib
(unless some headers are needed elsewhere but then its not really
private anymore and those headers should
probably be in some dedicated dir IMHO)

anyway you will end up with being careful of either not having
conflicting header names
or using few search paths and having <nss/base64.h> (or "nss/base64.h") style.
Otherwise check the order of the includes paths.
The good thing with having nss/base64.h is that it makes it clear from
the source what interface you are talking about.
Received on 2008-06-16