Mail Archives: djgpp/2001/11/20/20:01:30
On 20 Nov 2001 19:18:07 GMT, Hans-Bernhard Broeker
<broeker AT physik DOT rwth-aachen DOT de> wrote:
>Radical wrote:
[[snippity snip]]
>__DJGPP__ is defined *only* on DJGPP, __GNUC__ is defined on lots of
>other platforms. If and only if you know that a particular feature is
>common to all versions of GNU CC, you should use __GNUC__.
>
>Best practice usually is to use neither of the two, but rather use
>GNU's "autoconf" to test for the exact features themselves, not the
>platform they run on. Then you can write things like #if
>HAVE_SYS_STAT_H or #if HAVE_SNPRINTF and so on.
I've seen that done, too.
>In the original case at hand, you'ld write
>
>#ifndef S_ISDIR
># if defined(S_IFDIR) && defined(S_IFMT)
># define S_ISDIR(m) ((m & S_IFMT) == S_IFDIR)
># else
># error "no definition of S_ISDIR!"
>#endif
very interesting
>and be done with it.
>
>> in that someone who wants to compile for Linux GCC and not just
>> MSDOS/DJGPP, is GNUC acceptable?
>
>Probably no. You don't know where else GNU CC is used.
Thanks all.
- Raw text -