[Cbe-oss-dev] [patch 1/4] MARS: Header file cleanups

Kazunori Asayama asayama at sm.sony.co.jp
Mon Sep 1 14:18:08 EST 2008


Geoff Levand wrote:
> On 08/24/2008 07:18 PM, Kazunori Asayama wrote:
>> Geoff Levand wrote:
>>> Cleanup header files:
>> (snip)
>>>  o Use system include path for installed headers.
>> Why is that needed? Many software, such as OpenGL, OpenSSL, X11 and 
>> more, follow the same way as the current MARS's one. IMO, it's better to 
>>    create a sub directory for MARS headers rather than to put many 
>> random MARS headers in the system include directory directly.
> 
> This is not related to where the headers are installed, but to the
> search path the pre-processor uses.  The search order is different
> for files included with "" and <>.

Ah, I was confused with the relative path issue. Now I understand you
were saying about "" vs <>. OK, agreed.

> 
> By using <> in installed headers, MARS will behave like the standard
> include files in regards to pre-processor options and error messages.
> 
> I don't have OpenGL installed, but I checked the others:
> 
> $ (find /usr/include/openssl/ -type f -exec cat {} \;) | egrep -c '#include <openssl'
> 174
> $ (find /usr/include/openssl/ -type f -exec cat {} \;) | egrep -c '#include "openssl'
> 8
> 
> $ (find /usr/include/X11/ -type f -exec cat {} \;) | egrep -c '#include <X11'
> 533
> $ (find /usr/include/X11/ -type f -exec cat {} \;) | egrep -c '#include "X11'
> 0
> 
> So it seems those use <>, not "".

I intended to show examples which had subdirectory for headers (i.e.
examples for the next item).

> 
>>>  o Remove hard-coded include path.
>> Which is 'hard-coded'? I guess 'hard-coded' means 'mars/*.h', but I 
>> don't think it is 'hard-coded'. I understand it is just *relative* to
>> include paths.
> 
> The relative path is hard coded.  Having these paths goes against the
> GNU coding standard, but we have no obligation to follow that.

I think the subdirectory is rather equivalent to a prefix of file names
than hard coded path. And as I said in the previous message, that
enables to avoid putting many random files in the system directory directly.

> I'll need to fix the makefiles to support it.

-- 
(ASAYAMA Kazunori
  (asayama at sm.sony.co.jp))
t



More information about the cbe-oss-dev mailing list