summaryrefslogtreecommitdiffstats
path: root/gnu/usr.bin/diff/system.h
diff options
context:
space:
mode:
authornate <nate@FreeBSD.org>1993-11-12 07:05:54 +0000
committernate <nate@FreeBSD.org>1993-11-12 07:05:54 +0000
commit0ed72634295eab0018dcb17d89c196206eb60c8a (patch)
treeccdf94118f89667bc5481656e35a277126890ddc /gnu/usr.bin/diff/system.h
parentfbf13a99b770ab2f131e13a138ec4d9575a70308 (diff)
downloadFreeBSD-src-0ed72634295eab0018dcb17d89c196206eb60c8a.zip
FreeBSD-src-0ed72634295eab0018dcb17d89c196206eb60c8a.tar.gz
Updated to GNU diffutils 2.6
Diffstat (limited to 'gnu/usr.bin/diff/system.h')
-rw-r--r--gnu/usr.bin/diff/system.h146
1 files changed, 101 insertions, 45 deletions
diff --git a/gnu/usr.bin/diff/system.h b/gnu/usr.bin/diff/system.h
index b17d39a..2da6247 100644
--- a/gnu/usr.bin/diff/system.h
+++ b/gnu/usr.bin/diff/system.h
@@ -17,20 +17,84 @@ You should have received a copy of the GNU General Public License
along with GNU DIFF; see the file COPYING. If not, write to
the Free Software Foundation, 675 Mass Ave, Cambridge, MA 02139, USA. */
+/* We must define `volatile' and `const' first (the latter inside config.h),
+ so that they're used consistently in all system includes. */
+#if !__STDC__
+#ifndef volatile
+#define volatile
+#endif
+#endif
+#include "config.h"
+
#include <sys/types.h>
#include <sys/stat.h>
+#if __STDC__
+#define PARAMS(args) args
+#define VOID void
+#else
+#define PARAMS(args) ()
+#define VOID char
+#endif
+
+#if STAT_MACROS_BROKEN
+#undef S_ISBLK
+#undef S_ISCHR
+#undef S_ISDIR
+#undef S_ISFIFO
+#undef S_ISREG
+#undef S_ISSOCK
+#endif
#ifndef S_ISDIR
#define S_ISDIR(mode) (((mode) & S_IFMT) == S_IFDIR)
#endif
#ifndef S_ISREG
#define S_ISREG(mode) (((mode) & S_IFMT) == S_IFREG)
#endif
+#if !defined(S_ISBLK) && defined(S_IFBLK)
+#define S_ISBLK(mode) (((mode) & S_IFMT) == S_IFBLK)
+#endif
+#if !defined(S_ISCHR) && defined(S_IFCHR)
+#define S_ISCHR(mode) (((mode) & S_IFMT) == S_IFCHR)
+#endif
+#if !defined(S_ISFIFO) && defined(S_IFFIFO)
+#define S_ISFIFO(mode) (((mode) & S_IFMT) == S_IFFIFO)
+#endif
+#if !defined(S_ISSOCK) && defined(S_IFSOCK)
+#define S_ISSOCK(mode) (((mode) & S_IFMT) == S_IFSOCK)
+#endif
+
+#ifndef S_IXOTH
+#define S_IXOTH 1
+#endif
+#ifndef S_IXGRP
+#define S_IXGRP (S_IXOTH << 3)
+#endif
+#ifndef S_IXUSR
+#define S_IXUSR (S_IXGRP << 3)
+#endif
#if HAVE_UNISTD_H
#include <unistd.h>
#endif
+#ifndef SEEK_SET
+#define SEEK_SET 0
+#endif
+#ifndef SEEK_CUR
+#define SEEK_CUR 1
+#endif
+
+#ifndef STDIN_FILENO
+#define STDIN_FILENO 0
+#endif
+#ifndef STDOUT_FILENO
+#define STDOUT_FILENO 1
+#endif
+#ifndef STDERR_FILENO
+#define STDERR_FILENO 2
+#endif
+
#if HAVE_TIME_H
#include <time.h>
#else
@@ -73,15 +137,11 @@ the Free Software Foundation, 675 Mass Ave, Cambridge, MA 02139, USA. */
#if HAVE_ST_BLKSIZE
#define STAT_BLOCKSIZE(s) (s).st_blksize
#else
-#define STAT_BLOCKSIZE(s) (S_ISREG ((s).st_mode) ? 8192 : 4096)
+#define STAT_BLOCKSIZE(s) (8 * 1024)
#endif
#if DIRENT || defined (_POSIX_VERSION)
#include <dirent.h>
-#ifdef direct
-#undef direct
-#endif
-#define direct dirent
#else /* ! (DIRENT || defined (_POSIX_VERSION)) */
#if SYSNDIR
#include <sys/ndir.h>
@@ -92,49 +152,58 @@ the Free Software Foundation, 675 Mass Ave, Cambridge, MA 02139, USA. */
#include <ndir.h>
#endif
#endif
+#ifdef dirent
+#undef dirent
+#endif
+#define dirent direct
#endif /* ! (DIRENT || defined (_POSIX_VERSION)) */
#if HAVE_VFORK_H
#include <vfork.h>
#endif
-#if HAVE_STRING_H || STDC_HEADERS
-#include <string.h>
-#ifndef index
-#define index strchr
+#if HAVE_STDLIB_H
+#include <stdlib.h>
+#else
+VOID *malloc ();
+VOID *realloc ();
#endif
-#ifndef rindex
-#define rindex strrchr
+#ifndef getenv
+char *getenv ();
#endif
-#ifndef bcopy
-#define bcopy(s,d,n) memcpy (d,s,n)
+
+#if HAVE_LIMITS_H
+#include <limits.h>
#endif
-#ifndef bcmp
-#define bcmp(s1,s2,n) memcmp (s1,s2,n)
+#ifndef INT_MAX
+#define INT_MAX 2147483647
+#endif
+#ifndef CHAR_BIT
+#define CHAR_BIT 8
#endif
+
+#if HAVE_STRING_H
+#include <string.h>
#ifndef bzero
-#define bzero(s,n) memset (s,0,n)
+#define bzero(s,n) memset (s,0,n)
#endif
-#else
+#else /* !HAVE_STRING_H */
#include <strings.h>
+#ifndef strchr
+#define strchr index
#endif
-#if !HAVE_MEMCHR && !STDC_HEADERS
-char *memchr ();
+#ifndef strrchr
+#define strrchr rindex
#endif
-
-#if STDC_HEADERS
-#include <stdlib.h>
-#include <limits.h>
-#else
-char *getenv ();
-char *malloc ();
-char *realloc ();
-#if __STDC__ || __GNUC__
-#include "limits.h"
-#else
-#define INT_MAX 2147483647
-#define CHAR_BIT 8
+#ifndef memcpy
+#define memcpy(d,s,n) bcopy (s,d,n)
+#endif
+#ifndef memcmp
+#define memcmp(s1,s2,n) bcmp (s1,s2,n)
#endif
+#endif /* !HAVE_STRING_H */
+#if !HAVE_MEMCHR
+char *memchr ();
#endif
#include <errno.h>
@@ -142,18 +211,5 @@ char *realloc ();
extern int errno;
#endif
-#ifdef TRUE
-#undef TRUE
-#endif
-#ifdef FALSE
-#undef FALSE
-#endif
-#define TRUE 1
-#define FALSE 0
-
-#if !__STDC__
-#define volatile
-#endif
-
#define min(a,b) ((a) <= (b) ? (a) : (b))
#define max(a,b) ((a) >= (b) ? (a) : (b))
OpenPOWER on IntegriCloud