X-Git-Url: http://erislabs.net/gitweb/?a=blobdiff_plain;f=lib%2Fbackupfile.c;h=89b5f1e43d4cbfbc0937c268c036a699947e30e4;hb=4217177afc596dc0d1005f9eea607834ef2ae5c4;hp=e6956ee2aed8aea7250455392dd490987948f16a;hpb=a89ae060ff117b21f797a78ac9e4004164266694;p=gnulib.git diff --git a/lib/backupfile.c b/lib/backupfile.c index e6956ee2a..89b5f1e43 100644 --- a/lib/backupfile.c +++ b/lib/backupfile.c @@ -19,50 +19,37 @@ Some algorithms adapted from GNU Emacs. */ #ifdef HAVE_CONFIG_H -#if defined (CONFIG_BROKETS) -/* We use instead of "config.h" so that a compilation - using -I. -I$srcdir will use ./config.h rather than $srcdir/config.h - (which it would do because it found this file in $srcdir). */ #include -#else -#include "config.h" -#endif #endif #include #include #include #include "backupfile.h" -#if defined(STDC_HEADERS) || defined(HAVE_STRING_H) +#ifdef HAVE_STRING_H #include -#ifndef index -#define index strchr -#endif -#ifndef rindex -#define rindex strrchr -#endif #else #include #endif -#if defined(DIRENT) || defined(_POSIX_VERSION) +#ifdef HAVE_DIRENT_H #include #define NLENGTH(direct) (strlen((direct)->d_name)) -#else /* not (DIRENT or _POSIX_VERSION) */ +#else /* not HAVE_DIRENT_H */ #define dirent direct #define NLENGTH(direct) ((direct)->d_namlen) -#ifdef SYSNDIR +#ifdef HAVE_SYS_NDIR_H #include -#endif /* SYSNDIR */ -#ifdef SYSDIR +#endif /* HAVE_SYS_NDIR_H */ +#ifdef HAVE_SYS_DIR_H #include -#endif /* SYSDIR */ -#ifdef NDIR +#endif /* HAVE_SYS_DIR_H */ +#ifdef HAVE_NDIR_H #include -#endif /* NDIR */ -#endif /* DIRENT or _POSIX_VERSION */ +#endif /* HAVE_NDIR_H */ +#endif /* HAVE_DIRENT_H */ -#ifdef VOID_CLOSEDIR +#ifdef CLOSEDIR_VOID /* Fake a return value. */ #define CLOSEDIR(d) (closedir (d), 0) #else @@ -75,12 +62,13 @@ char *malloc (); #endif -#if !defined (isascii) || defined (STDC_HEADERS) -#undef isascii -#define isascii(c) 1 +#if defined (STDC_HEADERS) || (!defined (isascii) && !defined (HAVE_ISASCII)) +#define ISASCII(c) 1 +#else +#define ISASCII(c) isascii(c) #endif -#define ISDIGIT(c) (isascii ((unsigned char ) c) \ +#define ISDIGIT(c) (ISASCII ((unsigned char) (c)) \ && isdigit ((unsigned char) (c))) #if defined (HAVE_UNISTD_H)