This is the mail archive of the libc-hacker@sourceware.cygnus.com mailing list for the glibc project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]

A glibc 2.1 patch for egcs


This patch will allow you use egcs with glibc 2.1 again.


-- 
H.J. Lu (hjl@gnu.org)
---
Sat Aug 22 16:20:42 1998  H.J. Lu  (hjl@gnu.org)

	* misc/sys/cdefs.h (__BIP): New macro.

	* stdlib/stdlib.h (abort, exit, abs, labs): Use __BIP instead
	of __P.
	* string/string.h (memcpy, memcmp, strcpy, strcmp, strlen):
	Likwise.

Index: misc/sys/cdefs.h
===================================================================
RCS file: /home/work/cvs/gnu/glibc/misc/sys/cdefs.h,v
retrieving revision 1.1.1.5
diff -u -p -r1.1.1.5 cdefs.h
--- cdefs.h	1998/06/27 15:41:33	1.1.1.5
+++ cdefs.h	1998/08/22 23:18:49
@@ -34,6 +34,23 @@
 # else
 #  define __P(args)	args
 # endif
+
+/* For the time being, we cannot add throw () for gcc built in
+   fuctions:
+
+	memcpy
+	memcmp
+	strcpy
+	strcmp
+	strlen
+	abort
+	exit
+	abs
+	labs
+
+   Use use __BIP instead of __P for now.  */
+# define  __BIP(args)	args
+
 /* This macro will be used for functions which might take C++ callback
    functions.  */
 # define __PMT(args)	args
@@ -46,6 +63,7 @@
 # if (defined __STDC__ && __STDC__) || defined __cplusplus
 
 #  define __P(args)	args
+#  define __BIP(args)	args
 #  define __PMT(args)	args
 #  define __const	const
 #  define __signed	signed
@@ -55,6 +73,7 @@
 # else	/* Not ANSI C or C++.  */
 
 #  define __P(args)	()	/* No prototypes.  */
+#  define __BIP(args)	()
 #  define __PMT(args)	()
 #  define __const		/* No ANSI C keywords.  */
 #  define __signed
Index: stdlib/stdlib.h
===================================================================
RCS file: /home/work/cvs/gnu/glibc/stdlib/stdlib.h,v
retrieving revision 1.1.1.18
diff -u -p -r1.1.1.18 stdlib.h
--- stdlib.h	1998/08/20 16:10:33	1.1.1.18
+++ stdlib.h	1998/08/22 23:15:18
@@ -467,7 +467,7 @@ extern __ptr_t valloc __P ((size_t __siz
 
 
 /* Abort execution and generate a core-dump.  */
-extern void abort __P ((void)) __attribute__ ((__noreturn__));
+extern void abort __BIP ((void)) __attribute__ ((__noreturn__));
 
 
 /* Register a function to be called when `exit' is called.  */
@@ -485,7 +485,7 @@ extern int on_exit __P ((void (*__func) 
 /* Call all functions registered with `atexit' and `on_exit',
    in the reverse of the order in which they were registered
    perform stdio cleanup, and terminate program execution with STATUS.  */
-extern void exit __P ((int __status)) __attribute__ ((__noreturn__));
+extern void exit __BIP ((int __status)) __attribute__ ((__noreturn__));
 
 
 /* Return the value of envariable NAME, or NULL if it doesn't exist.  */
@@ -581,8 +581,8 @@ extern void qsort __PMT ((__ptr_t __base
 
 
 /* Return the absolute value of X.  */
-extern int abs __P ((int __x)) __attribute__ ((__const__));
-extern long int labs __P ((long int __x)) __attribute__ ((__const__));
+extern int abs __BIP ((int __x)) __attribute__ ((__const__));
+extern long int labs __BIP ((long int __x)) __attribute__ ((__const__));
 #ifdef __USE_ISOC9X
 extern long long int llabs __P ((long long int __x))
      __attribute__ ((__const__));
Index: string/string.h
===================================================================
RCS file: /home/work/cvs/gnu/glibc/string/string.h,v
retrieving revision 1.1.1.22
diff -u -p -r1.1.1.22 string.h
--- string.h	1998/08/11 22:31:59	1.1.1.22
+++ string.h	1998/08/22 23:16:45
@@ -34,7 +34,7 @@ __BEGIN_DECLS
 
 
 /* Copy N bytes of SRC to DEST.  */
-extern __ptr_t memcpy __P ((__ptr_t __restrict __dest,
+extern __ptr_t memcpy __BIP ((__ptr_t __restrict __dest,
 			    __const __ptr_t __restrict __src, size_t __n));
 /* Copy N bytes of SRC to DEST, guaranteeing
    correct behavior for overlapping strings.  */
@@ -54,7 +54,7 @@ extern __ptr_t memccpy __P ((__ptr_t __d
 extern __ptr_t memset __P ((__ptr_t __s, int __c, size_t __n));
 
 /* Compare N bytes of S1 and S2.  */
-extern int memcmp __P ((__const __ptr_t __s1, __const __ptr_t __s2,
+extern int memcmp __BIP ((__const __ptr_t __s1, __const __ptr_t __s2,
 			size_t __n));
 
 /* Search N bytes of S for C.  */
@@ -62,7 +62,7 @@ extern __ptr_t memchr __P ((__const __pt
 
 
 /* Copy SRC to DEST.  */
-extern char *strcpy __P ((char *__restrict __dest,
+extern char *strcpy __BIP ((char *__restrict __dest,
 			  __const char *__restrict __src));
 /* Copy no more than N characters of SRC to DEST.  */
 extern char *strncpy __P ((char *__restrict __dest,
@@ -76,7 +76,7 @@ extern char *strncat __P ((char *__restr
 			   __const char *__restrict __src, size_t __n));
 
 /* Compare S1 and S2.  */
-extern int strcmp __P ((__const char *__s1, __const char *__s2));
+extern int strcmp __BIP ((__const char *__s1, __const char *__s2));
 /* Compare N characters of S1 and S2.  */
 extern int strncmp __P ((__const char *__s1, __const char *__s2, size_t __n));
 
@@ -191,7 +191,7 @@ extern __ptr_t mempcpy __P ((__ptr_t __r
 
 
 /* Return the length of S.  */
-extern size_t strlen __P ((__const char *__s));
+extern size_t strlen __BIP ((__const char *__s));
 
 #ifdef	__USE_GNU
 /* Find the length of STRING, but scan at most MAXLEN characters.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]