Make sure we get all the .h files we need so this compiles.

This commit is contained in:
mycroft 1997-05-18 11:27:06 +00:00
parent af80734488
commit c4acdea0ab
2 changed files with 3 additions and 8 deletions

View File

@ -33,9 +33,7 @@
#include <stdio.h>
#include <sys/types.h>
#include <ctype.h>
#ifdef STRINGS_H
#include <strings.h>
#else
#ifdef HAVE_STRING_H
#include <string.h>
#endif
#ifdef HAVE_LIMITS_H

View File

@ -159,13 +159,14 @@ static enum
/* Value of POSIXLY_CORRECT environment variable. */
static char *posixly_correct;
#ifdef __GNU_LIBRARY__
#if defined(__GNU_LIBRARY__) || defined(__NetBSD__)
/* We want to avoid inclusion of string.h with non-GNU libraries
because there are many ways it can cause trouble.
On some systems, it contains special magic macros that don't work
in GCC. */
#include <string.h>
#define my_index strchr
#include <stdlib.h>
#else
/* Avoid depending on library functions or files
@ -189,9 +190,6 @@ my_index (str, chr)
/* If using GCC, we can safely declare strlen this way.
If not using GCC, it is ok not to declare it. */
#ifdef __NetBSD__
#include <string.h>
#else
#ifdef __GNUC__
/* Note that Motorola Delta 68k R3V7 comes with GCC but not stddef.h.
That was relevant to code that was here before. */
@ -203,7 +201,6 @@ extern int strlen (const char *);
#endif /* __GNUC__ */
#endif /* not __GNU_LIBRARY__ */
#endif
/* Handle permutation of arguments. */