[Top][All Lists]

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

Re: windows build failure

From: Paul Eggert
Subject: Re: windows build failure
Date: Tue, 22 Feb 2011 01:40:24 -0800
User-agent: Mozilla/5.0 (X11; U; Linux i686; en-US; rv: Gecko/20101208 Thunderbird/3.1.7

On 02/22/2011 12:57 AM, Eli Zaretskii wrote:
>  the artificial definition to zero in sys_stat.in.h
> is only fine if one ignores the de-facto practice of testing for
> S_IFLNK or S_ISLNK to guard code elsewhere that cannot be compiled or
> run on platforms without symlinks

No, the idea is that normal code should not use #ifdef S_IFLNK.
It should instead use "if (S_ISLNK (...)) ...".
On hosts that don't have symbolic links, this "if"
gets optimized away to nothing, so it's just as fast
as the #ifdef.

Using plain "if" tends to lead to code that is
easier to maintain than using "#ifdef", in cases
like these.  Among other things, trivial typos
inside the then-part are detected even when compiling
on platforms that lack the feature in question.

Large chunks of GNU code have been written using this style,
in programs such as coreutils, and it typically works well.

reply via email to

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