diff options
author | Paolo Bonzini <bonzini@gnu.org> | 2009-11-26 18:46:27 +0100 |
---|---|---|
committer | Paolo Bonzini <bonzini@gnu.org> | 2009-11-26 18:47:56 +0100 |
commit | 9b5e7d42e0abd88bb6c01a145f5171bc0fb7d84c (patch) | |
tree | 3f5b5e7268933df4abe2462ec16adac486120866 /src/system.h | |
parent | 589387d19f6e4179d6675b7585ffa5455d079582 (diff) | |
download | grep-9b5e7d42e0abd88bb6c01a145f5171bc0fb7d84c.tar.gz |
replace AC_CHECK_* with gnulib modules
* bootstrap.conf: Add gnulib modules for replacement functions and
headers.
* configure.ac: Remove macros subsumed by gnulib.
* lib/hard-locale.c: Remove guards for headers/functions provided by gnulib.
* lib/regex.c: Likewise.
* lib/savedir.c: Likewise.
* src/dfa.c: Likewise.
* src/dfa.h: Do not look at PROTOTYPES.
* src/grep.c: Likewise.
* src/mbsupport.h: Likewise.
* src/system.h: Likewise.
* m4/mbstate_t.m4: Remove.
* src/getpagesize.h: Remove.
Diffstat (limited to 'src/system.h')
-rw-r--r-- | src/system.h | 103 |
1 files changed, 12 insertions, 91 deletions
diff --git a/src/system.h b/src/system.h index c63039c8..5bb06262 100644 --- a/src/system.h +++ b/src/system.h @@ -31,20 +31,9 @@ # define PARAMS(x) () #endif -#ifdef HAVE_UNISTD_H -# include <fcntl.h> -# include <unistd.h> -#else -# define O_RDONLY 0 -# define SEEK_SET 0 -# define SEEK_CUR 1 -int open(), read(), close(); -#endif - +#include <fcntl.h> +#include <unistd.h> #include <errno.h> -#ifndef errno -extern int errno; -#endif /* Some operating systems treat text and binary files differently. */ #ifdef __BEOS__ @@ -74,90 +63,24 @@ extern int errno; int isdir PARAMS ((char const *)); -#ifdef HAVE_DIR_EACCES_BUG -# ifdef EISDIR -# define is_EISDIR(e, f) \ - ((e) == EISDIR \ - || ((e) == EACCES && isdir (f) && ((e) = EISDIR, 1))) -# else -# define is_EISDIR(e, f) ((e) == EACCES && isdir (f)) -# endif -#endif - -#ifndef is_EISDIR -# ifdef EISDIR -# define is_EISDIR(e, f) ((e) == EISDIR) -# else -# define is_EISDIR(e, f) 0 -# endif -#endif - -#if STAT_MACROS_BROKEN -# undef S_ISDIR -# undef S_ISREG -#endif -#if !defined(S_ISDIR) && defined(S_IFDIR) -# define S_ISDIR(Mode) (((Mode) & S_IFMT) == S_IFDIR) -#endif -#if !defined(S_ISREG) && defined(S_IFREG) -# define S_ISREG(Mode) (((Mode) & S_IFMT) == S_IFREG) -#endif - -#ifdef STDC_HEADERS -# include <stdlib.h> +#ifdef EISDIR +# define is_EISDIR(e, f) ((e) == EISDIR) #else -char *getenv (); -ptr_t malloc(), realloc(), calloc(); -void free(); +# define is_EISDIR(e, f) 0 #endif -#if __STDC__ -# include <stddef.h> -#endif -#ifdef STDC_HEADERS -# include <limits.h> -#endif -#ifndef CHAR_BIT -# define CHAR_BIT 8 -#endif +#include <stdlib.h> +#include <stddef.h> +#include <limits.h> +#include <string.h> +#include <ctype.h> + /* The extra casts work around common compiler bugs. */ #define TYPE_SIGNED(t) (! ((t) 0 < (t) -1)) #define TYPE_MINIMUM(t) ((t) (TYPE_SIGNED (t) \ ? ~ (t) 0 << (sizeof (t) * CHAR_BIT - 1) \ : (t) 0)) #define TYPE_MAXIMUM(t) ((t) (~ (t) 0 - TYPE_MINIMUM (t))) -#ifndef CHAR_MAX -# define CHAR_MAX TYPE_MAXIMUM (char) -#endif -#ifndef INT_MAX -# define INT_MAX TYPE_MAXIMUM (int) -#endif -#ifndef UCHAR_MAX -# define UCHAR_MAX TYPE_MAXIMUM (unsigned char) -#endif - -#if !defined(STDC_HEADERS) && defined(HAVE_STRING_H) && defined(HAVE_MEMORY_H) -# include <memory.h> -#endif -#if defined(STDC_HEADERS) || defined(HAVE_STRING_H) -# include <string.h> -#else -# include <strings.h> -# undef strchr -# define strchr index -# undef strrchr -# define strrchr rindex -# undef memcpy -# define memcpy(d, s, n) bcopy (s, d, n) -#endif -#ifndef HAVE_MEMCHR -ptr_t memchr(); -#endif -#if ! defined HAVE_MEMMOVE && ! defined memmove -# define memmove(d, s, n) bcopy (s, d, n) -#endif - -#include <ctype.h> #ifndef isgraph # define isgraph(C) (isprint(C) && !isspace(C)) @@ -187,9 +110,7 @@ ptr_t memchr(); #define N_(String) gettext_noop(String) #define _(String) gettext(String) -#if HAVE_SETLOCALE -# include <locale.h> -#endif +#include <locale.h> #ifndef initialize_main #define initialize_main(argcp, argvp) |