bug-gnulib
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: openat: conditional dependencies


From: Jim Meyering
Subject: Re: openat: conditional dependencies
Date: Tue, 08 Nov 2011 12:52:23 +0100

Bruno Haible wrote:
> Jim, ping?
>
>> Hi Jim,
>>
>> Now that the module structure of the *at functions is cleaned up - one
>> function provided per module (except for mkfifoat and mknodat which can
>> stay in a single module because they are nearly the same thing) -, let
>> me try to improve what's built with --conditional-dependencies.
>>
>> Here's the first proposed patch, for the 'openat' replacement.
>>
>> The save-cwd code is only needed when $HAVE_OPENAT = 0 (i.e. when the system
>> does not have openat()), not when $REPLACE_OPENAT = 1 (i.e. when gnulib
>> overrides the system's openat() function). But the .c file currently includes
>> save-cwd.h in both cases. Since we cannot include save-cwd.h without having
>> invoked gl_SAVE_CWD, we need to depend on 'save-cwd' (and thus compile the
>> code of save-cwd.c) _just_ for the sake of the position of the #include
>> statement.
>>
>> Here's the proposed patch. While it is a good general guideline to do all
>> #includes before all function definitions and all #ifs, I think it's worth
>> deviating from that practice if it can avoid to compile unused compilation
>> units.
>>
>>
>> 2011-11-05  Bruno Haible  <address@hidden>
>>
>>      openat: Conditionalize dependencies.
>>      * lib/openat.c: Reduce the scope of some #includes.
>>      * modules/openat (Depends-on): Add conditions.

Hi Bruno,

Thanks for the ping.
I thought I'd already replied, but apparently not.
This change looks fine.



reply via email to

[Prev in Thread] Current Thread [Next in Thread]