Subject: Re: CVS commit: src
To: None <lukem@netbsd.org>
From: None <Anders.Hjalmarsson@economics.gu.se>
List: current-users
Date: 09/05/1998 15:00:38
> Module Name:	src
> Committed By:	lukem
> Date:		Sat Sep  5 11:30:12 UTC 1998
> 
> Modified Files:
> 	src/usr.bin/tn3270/tools: Makefile.inc
> Log Message:
> -Dunix needed for tools
> 
> 
Would it not be better to fix the source files, the test for unix in these
files are IMO wrong (the tests in the main tn3270 source seem reasonable,
since they distinguish msdos from unix), they are used to select b* or 
mem* functions and string.h or strings.h and NetBSD is supposed to be
moving away from strings.h and the b* functions.

Here are the changes I made to make it compile:

--- general/general.h.orig	Thu Mar 12 13:13:59 1998
+++ general/general.h	Fri Sep  4 19:43:40 1998
@@ -44,32 +44,10 @@
 #define	numberof(x)	(sizeof x/sizeof x[0])
 #define	highestof(x)	(numberof(x)-1)
 
-#if	defined(unix)
-#define	ClearElement(x)		bzero((char *)&x, sizeof x)
-#define	ClearArray(x)		bzero((char *)x, sizeof x)
-#else	/* defined(unix) */
 #define	ClearElement(x)		memset((char *)&x, 0, sizeof x)
 #define	ClearArray(x)		memset((char *)x, 0, sizeof x)
-#endif	/* defined(unix) */
 
-/* Define BSD equivalent mem* functions */
-#if	defined(unix) && !defined(__NetBSD__)
-#define	memcpy(dest,src,n)	bcopy(src,dest,n)
-#define	memmove(dest,src,n)	bcopy(src,dest,n)
-#define	memset(s,c,n)		if (c == 0) { \
-				    bzero(s,n); \
-				} else { \
-				    char *src = s; \
-				    int count = n; \
-					\
-				    while (count--) { \
-					*src++ = c; \
-				    } \
-				}
-#define	memcmp(s1,s2,n)		bcmp(s1,s2,n)
-#else /* !(defined(unix) && !defined(__NetBSD__)) */
 #include <string.h>
-#endif	/* !(defined(unix) && !defined(__NetBSD__)) */
 
 /* genbsubs.c */
 int bunequal __P((char *, char *, int));
--- tools/mkastods/mkastods.c.orig	Thu Mar  5 13:24:25 1998
+++ tools/mkastods/mkastods.c	Fri Sep  4 19:46:04 1998
@@ -49,11 +49,7 @@
 #endif /* not lint */
 
 #include <stdio.h>
-#if	defined(unix)
-#include <strings.h>
-#else	/* defined(unix) */
 #include <string.h>
-#endif	/* defined(unix) */
 #include <ctype.h>
 #include "../api/asc_ebc.h"
 #include "../api/ebc_disp.h"
--- tools/mkastosc/mkastosc.c.orig	Wed Mar 11 13:11:35 1998
+++ tools/mkastosc/mkastosc.c	Fri Sep  4 19:45:16 1998
@@ -49,11 +49,7 @@
 #endif /* not lint */
 
 #include <stdio.h>
-#if	defined(unix)
-#include <strings.h>
-#else	/* defined(unix) */
 #include <string.h>
-#endif	/* defined(unix) */
 #include <err.h>
 #include <ctype.h>
 
--- tools/mkdstoas/mkdstoas.c.orig	Thu Mar  5 13:24:26 1998
+++ tools/mkdstoas/mkdstoas.c	Fri Sep  4 19:46:46 1998
@@ -49,11 +49,7 @@
 #endif /* not lint */
 
 #include <stdio.h>
-#if	defined(unix)
-#include <strings.h>
-#else	/* defined(unix) */
 #include <string.h>
-#endif	/* defined(unix) */
 #include <ctype.h>
 #include "../api/asc_ebc.h"
 #include "../api/ebc_disp.h"
--- tools/mkhits/dohits.c.orig	Tue Apr  7 07:54:34 1998
+++ tools/mkhits/dohits.c	Fri Sep  4 19:37:19 1998
@@ -61,11 +61,7 @@
  */
 
 #include <stdio.h>
-#if	defined(unix)
-#include <strings.h>
-#else	/* defined(unix) */
 #include <string.h>
-#endif	/* defined(unix) */
 #include <err.h>
 #include <ctype.h>
 #ifdef __STDC__
--- tools/mkhits/mkhits.c.orig	Thu Mar  5 13:24:26 1998
+++ tools/mkhits/mkhits.c	Fri Sep  4 19:37:02 1998
@@ -67,11 +67,7 @@
  */
 
 #include <stdio.h>
-#if	defined(unix)
-#include <strings.h>
-#else	/* defined(unix) */
 #include <string.h>
-#endif	/* defined(unix) */
 #include <ctype.h>
 #include "../ctlr/function.h"
 
--- tools/prt3270/prt3270.c.orig	Thu Mar  5 13:24:28 1998
+++ tools/prt3270/prt3270.c	Fri Sep  4 19:59:03 1998
@@ -48,8 +48,6 @@
 #endif
 #endif /* not lint */
 
-#if defined(unix)
-#endif
 #include <stdio.h>
 #include <ctype.h>