PATCH: Fixes "size_t" compile problems with binutils, etc. on HPUX 11.00

Josh Martin Josh.Martin@abq.sc.philips.com
Tue Aug 28 17:34:00 GMT 2001


Made changes to gcc/ginclude/stddef.h to correct compile problem causing size_t 
to be undefined on HPUX 11.00 when compiling such packages as GNU binutils and 
Sleepycat Berkeley Database. Certain HPUX 11.00 system headers were defining 
__size_t as size_t, thus causing the definition of size_t to be skipped in the 
stddef.h header file. Ideally, a hack should be added to fixincludes which 
removes these defines from the system headers, but I don't know if this will 
break any of the other system headers. This patch successfully bootstrapped on a 
hppa2.0n-hp-hpux11.00

Patch follows, and then ChangeLog:

--- /usr/local/build/gcc-3.0/gcc/ginclude/stddef.h      Fri Aug  4 10:00:48 2000
+++ ./stddef.h  Wed Aug 15 16:21:25 2001
@@ -177,7 +177,9 @@ typedef __PTRDIFF_TYPE__ ptrdiff_t;
 #ifndef ___int_size_t_h
 #ifndef _GCC_SIZE_T
 #ifndef _SIZET_
-#ifndef __size_t
+/* This is to correct a case in certain HPUX headers where __size_t
+   is defined as size_t (or std::size_t) without size_t being defined. */
+#if !defined (__size_t) || defined (__hpux__)
 #define __size_t__     /* BeOS */
 #define _SIZE_T
 #define _SYS_SIZE_T_H
@@ -191,7 +193,9 @@ typedef __PTRDIFF_TYPE__ ptrdiff_t;
 #define ___int_size_t_h
 #define _GCC_SIZE_T
 #define _SIZET_
+#ifndef __size_t /* HPUX */
 #define __size_t
+#endif /* HPUX */
 #ifndef __SIZE_TYPE__
 #define __SIZE_TYPE__ long unsigned int
 #endif




2001-08-15  Josh Martin  <timeslice@iname.com>

        * gcc/ginclude/stddef.h (__size_t): Check for HPUX and undefine
        __size_t to allow size_t to be defined.



More information about the Gcc-patches mailing list