Subject: GCC 2.6.0/2.6.1
To: None <current-users@netbsd.org>
From: Mark P. Gooderum <mark@nirvana.good.com>
List: current-users
Date: 11/16/1994 08:21:11
I've found I need the following patch to GCC 2.6.1 for it to build,
this is similar to the stddef.h patch I needed for 2.6.0 and 2.5.8?

Other people seem to be building okay, I'm not sure why I have this 
problem.  The patch basically fixes the GNU stddef.h to not have problems
about things like size_t not being defined.  The problem only shows up
in libgcc2.c and a few other files from libgcc2, other files compile fine.

I'd like comment as to whether other people have had this problem before
sending it in to the GCC people.  This is with 1.0 release.

--- stddef.h.orig	Tue Nov 15 18:25:08 1994
+++ stddef.h	Tue Nov 15 18:33:26 1994
@@ -22,22 +22,22 @@
 
 /* On 4.3bsd-net2, make sure ansi.h is included, so we have
    one less case to deal with in the following.  */
-#if defined (__BSD_NET2__) || defined (____386BSD____) || defined (__FreeBSD__)
+#if defined (__BSD_NET2__) || defined (____386BSD____) || defined (__FreeBSD__) || defined(__NetBSD__)
 #include <machine/ansi.h>
 #endif
 
 /* In 4.3bsd-net2, machine/ansi.h defines these symbols, which are
     defined if the corresponding type is *not* defined.  */
 #ifdef _ANSI_H_
-#ifndef _SIZE_T_
+#if !defined(_SIZE_T_) && !defined(_BSD_SIZE_T_)
 #define _SIZE_T
 #endif
-#ifndef _PTRDIFF_T_
+#if !defined(_PTRDIFF_T_) && !defined(_BSD_PTRDIFF_T_)
 #define _PTRDIFF_T
 #endif
 /* On BSD/386 1.1, at least, machine/ansi.h defines _BSD_WCHAR_T_
    instead of _WCHAR_T_. */
-#ifndef _WCHAR_T_
+#if !defined(_WCHAR_T_) && !defined(_BSD_WCHAR_T_)
 #ifndef _BSD_WCHAR_T_
 #define _WCHAR_T
 #endif
@@ -45,12 +45,15 @@
 /* Undef _FOO_T_ if we are supposed to define foo_t.  */
 #if defined (__need_ptrdiff_t) || defined (_STDDEF_H_)
 #undef _PTRDIFF_T_
+#undef _BSD_PTRDIFF_T_
 #endif
 #if defined (__need_size_t) || defined (_STDDEF_H_)
 #undef _SIZE_T_
+#undef _BSD_SIZE_T_
 #endif
 #if defined (__need_wchar_t) || defined (_STDDEF_H_)
 #undef _WCHAR_T_
+#undef _BSD_WCHAR_T_
 #endif
 #endif /* _ANSI_H_ */
 
@@ -76,6 +79,7 @@
 #ifndef _T_PTRDIFF
 #ifndef __PTRDIFF_T
 #ifndef _PTRDIFF_T_
+#ifndef _BSD_PTRDIFF_T_
 #ifndef ___int_ptrdiff_t_h
 #ifndef _GCC_PTRDIFF_T
 #define _PTRDIFF_T
@@ -83,6 +87,7 @@
 #define _T_PTRDIFF
 #define __PTRDIFF_T
 #define _PTRDIFF_T_
+#define _BSD_PTRDIFF_T_
 #define ___int_ptrdiff_t_h
 #define _GCC_PTRDIFF_T
 #ifndef __PTRDIFF_TYPE__
@@ -91,6 +96,7 @@
 typedef __PTRDIFF_TYPE__ ptrdiff_t;
 #endif /* _GCC_PTRDIFF_T */
 #endif /* ___int_ptrdiff_t_h */
+#endif /* _BSD_PTRDIFF_T_ */
 #endif /* _PTRDIFF_T_ */
 #endif /* __PTRDIFF_T */
 #endif /* _T_PTRDIFF */
@@ -113,6 +119,7 @@
 #ifndef _T_SIZE
 #ifndef __SIZE_T
 #ifndef _SIZE_T_
+#ifndef _BSD_SIZE_T_
 #ifndef _SIZE_T_DEFINED_
 #ifndef ___int_size_t_h
 #ifndef _GCC_SIZE_T
@@ -124,6 +131,7 @@
 #define _T_SIZE
 #define __SIZE_T
 #define _SIZE_T_
+#define _BSD_SIZE_T_
 #define _SIZE_T_DEFINED_
 #define ___int_size_t_h
 #define _GCC_SIZE_T
@@ -140,6 +148,7 @@
 #endif /* _GCC_SIZE_T */
 #endif /* ___int_size_t_h */
 #endif /* _SIZE_T_DEFINED_ */
+#endif /* _BSD_SIZE_T_ */
 #endif /* _SIZE_T_ */
 #endif /* __SIZE_T */
 #endif /* _T_SIZE */
@@ -163,6 +172,7 @@
 #ifndef _T_WCHAR
 #ifndef __WCHAR_T
 #ifndef _WCHAR_T_
+#ifndef _BSD_WCHAR_T_
 #ifndef _WCHAR_T_DEFINED_
 #ifndef _WCHAR_T_H
 #ifndef ___int_wchar_t_h
@@ -173,6 +183,7 @@
 #define _T_WCHAR
 #define __WCHAR_T
 #define _WCHAR_T_
+#define _BSD_WCHAR_T_
 #define _WCHAR_T_DEFINED_
 #define _WCHAR_T_H
 #define ___int_wchar_t_h
@@ -212,6 +223,7 @@
 #endif
 #endif
 #endif
+#endif
 #undef	__need_wchar_t
 #endif /* _STDDEF_H or __need_wchar_t.  */
 
@@ -222,12 +234,15 @@
     are probably typos and should be removed before 2.7 is released.  */
 #ifdef _GCC_PTRDIFF_T_
 #undef _PTRDIFF_T_
+#undef _BSD_PTRDIFF_T_
 #endif
 #ifdef _GCC_SIZE_T_
 #undef _SIZE_T_
+#undef _BSD_SIZE_T_
 #endif
 #ifdef _GCC_WCHAR_T_
 #undef _WCHAR_T_
+#undef _BSD_WCHAR_T_
 #endif
 /*  The following ones are the real ones.  */
 #ifdef _GCC_PTRDIFF_T
-- 
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Mark P. Gooderum			   USSnail:  Good Creations
Senior Consultant - Operating Systems Group	     3029 Blackstone Ave. So.
  "Working hard to be hardly working..."	     St. Louis Park, MN 55416
EMail:	     mark@Good.com		   Voice:    (612) 922-3953
Interactive: mark@nirvana.Good.com	   Fax:	     (612) 922-2676
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~