>>>>> "Paul" == Paul Eggert <[EMAIL PROTECTED]> writes:

Akim> sys/stat.h:  Portable or not?

Paul> I think it's portable to all targets of interest to GNU
Paul> applications.  Many GNU applications include <sys/stat.h>
Paul> without checking for its inclusion.  <sys/stat.h> has been
Paul> supported by every Unix-like system for over two decades; it was
Paul> in Unix Version 7.  I wouldn't worry about checking for it.

OK, thanks.  Shall we include it in the set of default includes?

@example
@group
#include <stdio.h>
#include <sys/types.h>
#if STDC_HEADERS
# include <stdlib.h>
# include <stddef.h>
#else
# if HAVE_STDLIB_H
#  include <stdlib.h>
# endif
#endif
#if HAVE_STRING_H
# if !STDC_HEADERS && HAVE_MEMORY_H
#  include <memory.h>
# endif
# include <string.h>
#else
# if HAVE_STRINGS_H
#  include <strings.h>
# endif
#endif
#if HAVE_INTTYPES_H
# include <inttypes.h>
#endif
#if HAVE_UNISTD_H
# include <unistd.h>
#endif
@end group
@end example

Also, the above set of default includes is traditional, but is there
any reason not to use elif?  Lemme bet, not KnR?

#if HAVE_STRING_H
# if !STDC_HEADERS && HAVE_MEMORY_H
#  include <memory.h>
# endif
# include <string.h>
#elif HAVE_STRINGS_H
#  include <strings.h>
#endif

        Akim

Reply via email to