This is a partial patch for the _GNU_SOURCE bug in g++-3.2. It does not fix everything, but it will cause a simple "Hello, world" program to compile. I am working on fixing other headers. This patch is in the public domain. It comes "as is" with *absolutely no warranty*.
fdc2f6871d40d5bbbc8656541a8425c0 *c++.patch -- Brian M. Carlson <[EMAIL PROTECTED]> 0x560553e7 "Let us think the unthinkable, let us do the undoable. Let us prepare to grapple with the ineffable itself, and see if we may not eff it after all." --Douglas Adams
diff -cr /usr/include/c++/3.2/cstdio ./c++/3.2/cstdio *** /usr/include/c++/3.2/cstdio 2002-03-30 10:56:06.000000000 +0000 --- ./c++/3.2/cstdio 2003-04-05 15:17:11.000000000 +0000 *************** *** 142,148 **** using ::vsprintf; } ! #if _GLIBCPP_USE_C99 #undef snprintf #undef vfscanf --- 142,148 ---- using ::vsprintf; } ! #if _GLIBCPP_USE_C99 || defined(__cplusplus) #undef snprintf #undef vfscanf diff -cr /usr/include/locale.h ./locale.h *** /usr/include/locale.h 2003-03-21 16:16:47.000000000 +0000 --- ./locale.h 2003-04-05 15:38:55.000000000 +0000 *************** *** 130,136 **** __END_NAMESPACE_STD ! #ifdef __USE_GNU /* The concept of one static locale per category is not very well thought out. Many applications will need to process its data using information from several different locales. Another application is --- 130,136 ---- __END_NAMESPACE_STD ! #if defined __USE_GNU || defined __cplusplus /* The concept of one static locale per category is not very well thought out. Many applications will need to process its data using information from several different locales. Another application is diff -cr /usr/include/stdio.h ./stdio.h *** /usr/include/stdio.h 2003-03-21 16:17:33.000000000 +0000 --- ./stdio.h 2003-04-05 15:17:01.000000000 +0000 *************** *** 357,363 **** __const char *__restrict __format, ...) __THROW; __END_NAMESPACE_STD ! #ifdef __USE_ISOC99 __BEGIN_NAMESPACE_C99 /* Read formatted input from S into argument list ARG. */ extern int vfscanf (FILE *__restrict __s, __const char *__restrict __format, --- 357,363 ---- __const char *__restrict __format, ...) __THROW; __END_NAMESPACE_STD ! #if defined(__USE_ISOC99) || defined(__cplusplus) __BEGIN_NAMESPACE_C99 /* Read formatted input from S into argument list ARG. */ extern int vfscanf (FILE *__restrict __s, __const char *__restrict __format, diff -cr /usr/include/stdlib.h ./stdlib.h *** /usr/include/stdlib.h 2003-03-21 16:17:29.000000000 +0000 --- ./stdlib.h 2003-04-05 15:45:12.000000000 +0000 *************** *** 109,115 **** #endif __END_NAMESPACE_STD ! #if defined __USE_ISOC99 && !defined __lldiv_t_defined __BEGIN_NAMESPACE_C99 /* Returned by `lldiv'. */ __extension__ typedef struct --- 109,115 ---- #endif __END_NAMESPACE_STD ! #if (defined __USE_ISOC99 || defined __cplusplus) && !defined __lldiv_t_defined __BEGIN_NAMESPACE_C99 /* Returned by `lldiv'. */ __extension__ typedef struct *************** *** 160,166 **** char **__restrict __endptr) __THROW; __END_NAMESPACE_STD ! #ifdef __USE_ISOC99 __BEGIN_NAMESPACE_C99 /* Likewise for `float' and `long double' sizes of floating-point numbers. */ extern float strtof (__const char *__restrict __nptr, --- 160,166 ---- char **__restrict __endptr) __THROW; __END_NAMESPACE_STD ! #if defined __USE_ISOC99 || defined __cplusplus __BEGIN_NAMESPACE_C99 /* Likewise for `float' and `long double' sizes of floating-point numbers. */ extern float strtof (__const char *__restrict __nptr, *************** *** 610,616 **** extern void exit (int __status) __THROW __attribute__ ((__noreturn__)); __END_NAMESPACE_STD ! #ifdef __USE_ISOC99 __BEGIN_NAMESPACE_C99 /* Terminate the program with STATUS without calling any of the functions registered with `atexit' or `on_exit'. */ --- 610,616 ---- extern void exit (int __status) __THROW __attribute__ ((__noreturn__)); __END_NAMESPACE_STD ! #if defined __USE_ISOC99 || defined __cplusplus __BEGIN_NAMESPACE_C99 /* Terminate the program with STATUS without calling any of the functions registered with `atexit' or `on_exit'. */ diff -cr /usr/include/wchar.h ./wchar.h *** /usr/include/wchar.h 2003-03-21 16:17:40.000000000 +0000 --- ./wchar.h 2003-04-05 15:34:37.000000000 +0000 *************** *** 369,375 **** extern double wcstod (__const wchar_t *__restrict __nptr, wchar_t **__restrict __endptr) __THROW; ! #ifdef __USE_ISOC99 /* Likewise for `float' and `long double' sizes of floating-point numbers. */ extern float wcstof (__const wchar_t *__restrict __nptr, wchar_t **__restrict __endptr) __THROW; --- 369,375 ---- extern double wcstod (__const wchar_t *__restrict __nptr, wchar_t **__restrict __endptr) __THROW; ! #if defined __USE_ISOC99 || defined __cplusplus /* Likewise for `float' and `long double' sizes of floating-point numbers. */ extern float wcstof (__const wchar_t *__restrict __nptr, wchar_t **__restrict __endptr) __THROW; *************** *** 389,395 **** wchar_t **__restrict __endptr, int __base) __THROW; ! #if defined __USE_ISOC99 || (defined __GNUC__ && defined __USE_GNU) /* Convert initial portion of wide string NPTR to `long int' representation. */ __extension__ --- 389,396 ---- wchar_t **__restrict __endptr, int __base) __THROW; ! #if defined __USE_ISOC99 || (defined __GNUC__ && defined __USE_GNU) || \ ! defined __cplusplus /* Convert initial portion of wide string NPTR to `long int' representation. */ __extension__ *************** *** 570,576 **** /* Wide character I/O functions. */ ! #if defined __USE_ISOC99 || defined __USE_UNIX98 __BEGIN_NAMESPACE_C99 /* Select orientation for stream. */ --- 571,577 ---- /* Wide character I/O functions. */ ! #if defined __USE_ISOC99 || defined __USE_UNIX98 || defined __cplusplus __BEGIN_NAMESPACE_C99 /* Select orientation for stream. */ *************** *** 621,627 **** __END_NAMESPACE_C99 #endif /* Use ISO C99 and Unix98. */ ! #ifdef __USE_ISOC99 __BEGIN_NAMESPACE_C99 /* Read formatted input from S into argument list ARG. */ --- 622,628 ---- __END_NAMESPACE_C99 #endif /* Use ISO C99 and Unix98. */ ! #if defined __USE_ISOC99 || defined __cplusplus __BEGIN_NAMESPACE_C99 /* Read formatted input from S into argument list ARG. */ diff -cr /usr/include/wctype.h ./wctype.h *** /usr/include/wctype.h 2003-03-21 16:18:06.000000000 +0000 --- ./wctype.h 2003-04-05 15:52:28.000000000 +0000 *************** *** 173,179 **** /* Test for any wide character that corresponds to a standard blank wide character or a locale-specific set of wide characters for which `iswalnum' is false. */ ! # ifdef __USE_ISOC99 extern int iswblank (wint_t __wc) __THROW; # endif --- 173,179 ---- /* Test for any wide character that corresponds to a standard blank wide character or a locale-specific set of wide characters for which `iswalnum' is false. */ ! # if defined __USE_ISOC99 || defined __cplusplus extern int iswblank (wint_t __wc) __THROW; # endif
pgpncc2n4U5Pw.pgp
Description: PGP signature