egcs-CVS19980628, gansidecl.h clean out autoconf junk & NULL define

Kaveh R. Ghazi ghazi@caip.rutgers.edu
Mon Jun 29 17:44:00 GMT 1998


	This patch cleans up gansidecl.h so that autoconf things and OS
header stuff (namely NULL) are removed.  (These all live in system.h.)
This is in preparation for being able to include gansidecl.h in target
files, etc.

	Okay to install?

		--Kaveh


Mon Jun 29 20:34:45 1998  Kaveh R. Ghazi  <ghazi@caip.rutgers.edu>

	* gansidecl.h (ATTRIBUTE_UNUSED): Use __unused__ not `unused'.
  	Don't define NULL here.  Also, remove all vestiges of autoconf
 	based checks for bcmp/bcopy/bzero/index/rindex.

	* system.h: Immediately after including stdio.h, check for and if
	necessary provide a default definition of NULL.
	
diff -rup orig/egcs-CVS19980628/gcc/gansidecl.h egcs-CVS19980628/gcc/gansidecl.h
--- orig/egcs-CVS19980628/gcc/gansidecl.h	Sun Jun 28 09:23:07 1998
+++ egcs-CVS19980628/gcc/gansidecl.h	Mon Jun 29 17:07:23 1998
@@ -51,7 +51,7 @@ Boston, MA 02111-1307, USA.  */
 #endif
 
 #ifndef ATTRIBUTE_UNUSED
-#define ATTRIBUTE_UNUSED __attribute__ ((unused))
+#define ATTRIBUTE_UNUSED __attribute__ ((__unused__))
 #endif /* ATTRIBUTE_UNUSED */
 
 #ifndef ATTRIBUTE_PRINTF
@@ -63,12 +63,6 @@ Boston, MA 02111-1307, USA.  */
 #define ATTRIBUTE_PRINTF_5 ATTRIBUTE_PRINTF(5, 6)
 #endif /* ATTRIBUTE_PRINTF */
 
-/* Define a generic NULL if one hasn't already been defined.  */
-
-#ifndef NULL
-#define NULL 0
-#endif
-
 #ifndef GENERIC_PTR
 #if defined (USE_PROTOTYPES) ? USE_PROTOTYPES : defined (__STDC__)
 #define GENERIC_PTR void *
@@ -93,52 +87,5 @@ Boston, MA 02111-1307, USA.  */
 #endif
 
 #endif /* ! __STDC__ */
-
-/* We don't have autoconf for libgcc2.c since it's a target, so don't
-   define these functions, which aren't used there anyway.  */
-#ifndef IN_LIBGCC2
-#ifndef bcopy
-# ifdef HAVE_BCOPY
-#  ifdef NEED_DECLARATION_BCOPY
-void bcopy ();
-#  endif
-# else
-#  define bcopy(src,dst,len) memcpy ((dst),(src),(len))
-# endif
-#endif
-
-#ifndef bzero
-# ifdef HAVE_BZERO
-#  ifdef NEED_DECLARATION_BZERO
-void bzero ();
-#  endif
-# else
-#  define bzero(dst,len) memset ((dst),0,(len))
-# endif
-#endif
-
-#ifndef bcmp
-# ifdef HAVE_BCMP
-#  ifdef NEED_DECLARATION_BCMP
-int bcmp ();
-#  endif
-# else
-#  define bcmp(left,right,len) memcmp ((left),(right),(len))
-# endif
-#endif
-
-#ifndef HAVE_RINDEX
-# ifndef rindex
-#  define rindex strrchr
-# endif
-#endif
-
-#ifndef HAVE_INDEX
-# ifndef index
-#  define index strchr
-# endif
-#endif
-
-#endif /* IN_LIBGCC2 */
 
 #endif /* ANSIDECL_H */
diff -rup orig/egcs-CVS19980628/gcc/system.h egcs-CVS19980628/gcc/system.h
--- orig/egcs-CVS19980628/gcc/system.h	Sun Jun 28 09:23:49 1998
+++ egcs-CVS19980628/gcc/system.h	Mon Jun 29 17:13:23 1998
@@ -8,6 +8,12 @@
 #define __GCC_SYSTEM_H__
 
 #include <stdio.h>
+
+/* Define a generic NULL if one hasn't already been defined.  */
+#ifndef NULL
+#define NULL 0
+#endif
+
 #include <ctype.h>
 
 /* Jim Meyering writes:



More information about the Gcc-patches mailing list