[gnu.utils.bug] patches to gnu diff to make it compile under SysV

andy@CSVAX.CALTECH.EDU (Andy Fyfe) (10/05/88)

diff -c ./diff.h ../diff.h
*** ./diff.h	Tue Oct  4 02:21:53 1988
--- ../diff.h	Tue Oct  4 02:32:35 1988
***************
*** 24,31 ****
--- 24,38 ----
  #include <sys/file.h>
  #include <sys/types.h>
  #include <sys/stat.h>
+ #ifdef USG
+ #include <time.h>
+ #include <ndir.h>
+ #include <fcntl.h>
+ #include "usg.h"
+ #else
  #include <sys/time.h>
  #include <sys/dir.h>
+ #endif
  #include <errno.h>
  
  /* Support old-fashioned C compilers.  */
diff -c ./regex.c ../regex.c
*** ./regex.c	Tue Oct  4 02:21:17 1988
--- ../regex.c	Tue Oct  4 02:40:06 1988
***************
*** 109,114 ****
--- 109,122 ----
   then reads a string and searches for it.  */
  
  
+ #ifdef USG
+ #include "usg.h"
+ #endif
+ 
+ #ifdef __GNUC__
+ #define alloca	__builtin_alloca
+ #endif
+ 
  #ifdef emacs
  
  /* The `emacs' switch turns on certain special matching commands
diff -c ./usg.h ../usg.h
*** ./usg.h	Tue Oct  4 03:28:52 1988
--- ../usg.h	Tue Oct  4 02:50:11 1988
***************
*** 0 ****
--- 1,13 ----
+ /*
+  * a place for all those standard #defines when moving from bsd to sysv
+  */
+ 
+ #define bcopy(s,d,n)	memcpy((d),(s),(n))
+ #define bcmp(s1,s2,n)	memcmp((s1),(s2),(n))
+ #define bzero(s,n)	memset((s),0,(n))
+ 
+ #define dup2(f,t)	(close(t),fcntl((f),F_DUPFD,(t)))
+ 
+ #define vfork	fork
+ #define index	strchr
+ #define rindex	strrchr

denny@mcmi.UUCP (Dennis Page) (10/06/88)

>+ #include <ndir.h>

SysV does not have an ndir.h in /usr/include.

#include "../emacs/src/ndir.h"

Denny

james@bigtex.uucp (James Van Artsdalen) (10/12/88)

In article <501@mcmi.UUCP>, denny@mcmi.UUCP (Dennis Page) wrote:

> SysV does not have an ndir.h in /usr/include.

> #include "../emacs/src/ndir.h"

SysVr3 does have <dirent.h>, so

#include <dirent.h>

works.  The routines are a little different from BSD's and usually
take a little work, but seem to work fine as is in GNU diff.
-- 
James R. Van Artsdalen   ...!uunet!utastro!bigtex!james   "Live Free or Die"
Home: 512-346-2444 Work: 338-8789        9505 Arboretum Blvd Austin TX 78759