? libstdc++-v3/mkchwrappers
? libstdc++-v3/config/os/solaris/solaris2.7/bits/chwrapper.map
Index: gcc/cppinit.c
===================================================================
RCS file: /cvs/gcc/gcc/gcc/cppinit.c,v
retrieving revision 1.147.2.5
diff -c -3 -p -r1.147.2.5 cppinit.c
*** cppinit.c	2001/03/02 19:08:03	1.147.2.5
--- cppinit.c	2001/03/07 16:33:29
*************** init_builtins (pfile)
*** 754,760 ****
  
    if (CPP_OPTION (pfile, cplusplus))
      {
!       _cpp_define_builtin (pfile, "__cplusplus 1");
        if (SUPPORTS_ONE_ONLY)
  	_cpp_define_builtin (pfile, "__GXX_WEAK__ 1");
        else
--- 754,760 ----
  
    if (CPP_OPTION (pfile, cplusplus))
      {
!       _cpp_define_builtin (pfile, "__cplusplus 199711L");
        if (SUPPORTS_ONE_ONLY)
  	_cpp_define_builtin (pfile, "__GXX_WEAK__ 1");
        else
Index: gcc/fixinc/fixincl.x
===================================================================
RCS file: /cvs/gcc/gcc/gcc/fixinc/fixincl.x,v
retrieving revision 1.98.2.1
diff -c -3 -p -r1.98.2.1 fixincl.x
*** fixincl.x	2001/02/21 20:08:16	1.98.2.1
--- fixincl.x	2001/03/07 16:33:35
***************
*** 5,11 ****
   * files which are fixed to work correctly with ANSI C and placed in a
   * directory that GNU C will search.
   *
!  * This file contains 134 fixup descriptions.
   *
   * See README for more information.
   *
--- 5,11 ----
   * files which are fixed to work correctly with ANSI C and placed in a
   * directory that GNU C will search.
   *
!  * This file contains 137 fixup descriptions.
   *
   * See README for more information.
   *
*************** static const char* apzX11_SprintfPatch[]
*** 5422,5435 ****
  #endif /* !defined __STDC__ */",
      (char*)NULL };
  
  
  /* * * * * * * * * * * * * * * * * * * * * * * * * *
   *
   *  List of all fixes
   */
! #define REGEX_COUNT          140
  #define MACH_LIST_SIZE_LIMIT 279
! #define FIX_COUNT            134
  
  tFixDesc fixDescList[ FIX_COUNT ] = {
    {  zAaa_Ki_IfaceName,    zAaa_Ki_IfaceList,
--- 5422,5563 ----
  #endif /* !defined __STDC__ */",
      (char*)NULL };
  
+ /* * * * * * * * * * * * * * * * * * * * * * * * * *
+  *
+  *  Description of Std_Namespace_Types fix
+  */
+ #define STD_NAMESPACE_TYPES_FIXIDX       134
+ tSCC zStd_Namespace_TypesName[] =
+      "std_namespace_types";
  
+ /*
+  *  File name selection pattern
+  */
+ tSCC zStd_Namespace_TypesList[] =
+   "|sys/types.h|sys/time.h|limits.h|";
+ /*
+  *  Machine/OS name selection pattern
+  */
+ tSCC* apzStd_Namespace_TypesMachs[] = {
+         "*-solaris2.[8]",
+         (const char*)NULL };
+ 
+ /*
+  *  content selection pattern - do fix if pattern found
+  */
+ tSCC zStd_Namespace_TypesSelect0[] =
+        "^[ \t]*typedef[ \t]+.*[ \t]((ptrdiff|size|time|clock)_t);.*$";
+ 
+ #define    STD_NAMESPACE_TYPES_TEST_CT  1
+ static tTestDesc aStd_Namespace_TypesTests[] = {
+   { TT_EGREP,    zStd_Namespace_TypesSelect0, (regex_t*)NULL }, };
+ 
+ /*
+  *  Fix Command Arguments for Std_Namespace_Types
+  */
+ static const char* apzStd_Namespace_TypesPatch[] = {
+     "format",
+     "#if __cplusplus >= 199711L\n\
+ namespace std {\n\
+ #endif /* __cplusplus >= 199711L */\n\
+ %0\n\
+ #if __cplusplus >= 199711L\n\
+ }\n\
+ using std::%1;\n\
+ #endif /* __cplusplus >= 199711L */\n",
+     (char*)NULL };
+ 
  /* * * * * * * * * * * * * * * * * * * * * * * * * *
   *
+  *  Description of Std_Time_T_Timeval fix
+  */
+ #define STD_TIME_T_TIMEVAL_FIXIDX        135
+ tSCC zStd_Time_T_TimevalName[] =
+      "std_time_t_timeval";
+ 
+ /*
+  *  File name selection pattern
+  */
+ tSCC zStd_Time_T_TimevalList[] =
+   "|sys/time.h|";
+ /*
+  *  Machine/OS name selection pattern
+  */
+ #define apzStd_Time_T_TimevalMachs (const char**)NULL
+ 
+ /*
+  *  content selection pattern - do fix if pattern found
+  */
+ tSCC zStd_Time_T_TimevalSelect0[] =
+        "^([ \t]*)(time_t[ \t]*tv_sec;.*)$";
+ 
+ #define    STD_TIME_T_TIMEVAL_TEST_CT  1
+ static tTestDesc aStd_Time_T_TimevalTests[] = {
+   { TT_EGREP,    zStd_Time_T_TimevalSelect0, (regex_t*)NULL }, };
+ 
+ /*
+  *  Fix Command Arguments for Std_Time_T_Timeval
+  */
+ static const char* apzStd_Time_T_TimevalPatch[] = {
+     "format",
+     "#if __cplusplus >= 199711L\n\
+ %1std::%2\n\
+ #else\n\
+ %0\n\
+ #endif /* __cplusplus >= 199711L */",
+     (char*)NULL };
+ 
+ /* * * * * * * * * * * * * * * * * * * * * * * * * *
+  *
+  *  Description of Hoist_Unistd_Rename fix
+  */
+ #define HOIST_UNISTD_RENAME_FIXIDX       136
+ tSCC zHoist_Unistd_RenameName[] =
+      "hoist_unistd_rename";
+ 
+ /*
+  *  File name selection pattern
+  */
+ tSCC zHoist_Unistd_RenameList[] =
+   "|unistd.h|";
+ /*
+  *  Machine/OS name selection pattern
+  */
+ #define apzHoist_Unistd_RenameMachs (const char**)NULL
+ 
+ /*
+  *  content selection pattern - do fix if pattern found
+  */
+ tSCC zHoist_Unistd_RenameSelect0[] =
+        "^extern int rename\\(const.*$";
+ 
+ #define    HOIST_UNISTD_RENAME_TEST_CT  1
+ static tTestDesc aHoist_Unistd_RenameTests[] = {
+   { TT_EGREP,    zHoist_Unistd_RenameSelect0, (regex_t*)NULL }, };
+ 
+ /*
+  *  Fix Command Arguments for Hoist_Unistd_Rename
+  */
+ static const char* apzHoist_Unistd_RenamePatch[] = {
+     "format",
+     "#if __cplusplus >= 199711L\n\
+ namespace std {\n\
+ #endif /* __cplusplus >= 199711L */\n\
+ %0\n\
+ #if __cplusplus >= 199711L\n\
+ }\n\
+ using std::rename;\n\
+ #endif /* __cplusplus >= 199711L */\n",
+     (char*)NULL };
+ 
+ 
+ /* * * * * * * * * * * * * * * * * * * * * * * * * *
+  *
   *  List of all fixes
   */
! #define REGEX_COUNT          143
  #define MACH_LIST_SIZE_LIMIT 279
! #define FIX_COUNT            137
  
  tFixDesc fixDescList[ FIX_COUNT ] = {
    {  zAaa_Ki_IfaceName,    zAaa_Ki_IfaceList,
*************** tFixDesc fixDescList[ FIX_COUNT ] = {
*** 6100,6104 ****
    {  zX11_SprintfName,    zX11_SprintfList,
       apzX11_SprintfMachs,
       X11_SPRINTF_TEST_CT, FD_MACH_ONLY | FD_SUBROUTINE,
!      aX11_SprintfTests,   apzX11_SprintfPatch, 0 }
  };
--- 6228,6247 ----
    {  zX11_SprintfName,    zX11_SprintfList,
       apzX11_SprintfMachs,
       X11_SPRINTF_TEST_CT, FD_MACH_ONLY | FD_SUBROUTINE,
!      aX11_SprintfTests,   apzX11_SprintfPatch, 0 },
! 
!   {  zStd_Namespace_TypesName,    zStd_Namespace_TypesList,
!      apzStd_Namespace_TypesMachs,
!      STD_NAMESPACE_TYPES_TEST_CT, FD_MACH_ONLY | FD_SUBROUTINE,
!      aStd_Namespace_TypesTests,   apzStd_Namespace_TypesPatch, 0 },
! 
!   {  zStd_Time_T_TimevalName,    zStd_Time_T_TimevalList,
!      apzStd_Time_T_TimevalMachs,
!      STD_TIME_T_TIMEVAL_TEST_CT, FD_MACH_ONLY | FD_SUBROUTINE,
!      aStd_Time_T_TimevalTests,   apzStd_Time_T_TimevalPatch, 0 },
! 
!   {  zHoist_Unistd_RenameName,    zHoist_Unistd_RenameList,
!      apzHoist_Unistd_RenameMachs,
!      HOIST_UNISTD_RENAME_TEST_CT, FD_MACH_ONLY | FD_SUBROUTINE,
!      aHoist_Unistd_RenameTests,   apzHoist_Unistd_RenamePatch, 0 }
  };
Index: gcc/fixinc/inclhack.def
===================================================================
RCS file: /cvs/gcc/gcc/gcc/fixinc/inclhack.def,v
retrieving revision 1.101.2.1
diff -c -3 -p -r1.101.2.1 inclhack.def
*** inclhack.def	2001/02/21 20:08:17	1.101.2.1
--- inclhack.def	2001/03/07 16:33:37
*************** fix = {
*** 3186,3189 ****
--- 3186,3263 ----
      test_text = "extern char *\tsprintf();";
  };
  
+ 
+ /*
+  * Adjust the namespace coherence of these typedefs.
+  *
+  * Solaris 8 puts certain typedefs in both global and std namespaces in ISO
+  * C++ compatibility mode, but not in a consistent way in certain system headers.
+  * These names must be defined in namespace std (to satisfy koenig lookup) and
+  * injected into the global namespace (to satisfy numerous other system headers).
+  */
+ fix = {
+  	hackname  = std_namespace_types;
+     files     = sys/types.h;
+ 	files     = sys/time.h;
+ 	files     = limits.h;
+     select    = "^[ 	]*typedef[ 	]+.*[ 	]\((ptrdiff|size|time|clock)_t\);.*$";
+     mach      = "*-solaris2.[8]";
+ 
+  	c_fix     = format; 
+  	c_fix_arg = "#if __cplusplus >= 199711L\n"
+ 				"namespace std {\n"
+ 				"#endif /* __cplusplus >= 199711L */\n"
+ 				"%0\n"
+  				"#if __cplusplus >= 199711L\n"
+ 				"}\n"
+ 				"using std::%1;\n"
+ 				"#endif /* __cplusplus >= 199711L */\n";
+ 
+ 	test_text = "typedef long int ptrdiff_t";
+ };
+ 
+ 
+ /*
+  * Kludgy bit to make Solaris 8 work.
+  */
+ fix = {
+     hackname  = std_time_t_timeval;
+ 	files     = sys/time.h;
+ 	select    = "^\([ 	]*\)\(time_t[ 	]*tv_sec;.*\)$";
+ 
+ 	c_fix     = format;
+ 	c_fix_arg = "#if __cplusplus >= 199711L\n"
+ 	            "%1std::%2\n"
+ 				"#else\n"
+ 				"%0\n"
+ 				"#endif /* __cplusplus >= 199711L */";
+ };
+ 
+ 
+ /*
+  * Deprecated standards had the rename() function live in the global namespace
+  * in the header <unistd.h>.  This will cause a name conflict when using that
+  * header with a C++ compiler that conforms to the ISO/IEC 14882:1997 standard.
+  * So that older programs do not break, the rename() function declaration that
+  * appears in that header must be hoisted into the global namespace and injected
+  * into the global namespace.
+  */
+ fix = {
+     hackname  = hoist_unistd_rename;
+ 	files     = unistd.h;
+     select    = '^extern int rename\\(const.*$';
+ 
+ 	c_fix     = format;
+  	c_fix_arg = "#if __cplusplus >= 199711L\n"
+ 				"namespace std {\n"
+ 				"#endif /* __cplusplus >= 199711L */\n"
+ 				"%0\n"
+  				"#if __cplusplus >= 199711L\n"
+ 				"}\n"
+ 				"using std::rename;\n"
+ 				"#endif /* __cplusplus >= 199711L */\n";
+ 
+     test_text = "extern int rename(const char*, const char*);";
+ };
+ 
  /*EOF*/
Index: gcc/ginclude/stddef.h
===================================================================
RCS file: /cvs/gcc/gcc/gcc/ginclude/stddef.h,v
retrieving revision 1.10
diff -c -3 -p -r1.10 stddef.h
*** stddef.h	2000/08/04 16:00:48	1.10
--- stddef.h	2001/03/07 16:33:38
*************** _TYPE_wchar_t;
*** 144,150 ****
--- 144,157 ----
  #ifndef __PTRDIFF_TYPE__
  #define __PTRDIFF_TYPE__ long int
  #endif
+ #if __cplusplus >= 199711L
+ namespace std {
+ #endif
  typedef __PTRDIFF_TYPE__ ptrdiff_t;
+ #if __cplusplus >= 199711L
+ }
+ using std::ptrdiff_t;
+ #endif
  #endif /* _GCC_PTRDIFF_T */
  #endif /* ___int_ptrdiff_t_h */
  #endif /* _BSD_PTRDIFF_T_ */
*************** typedef __PTRDIFF_TYPE__ ptrdiff_t;
*** 196,202 ****
--- 203,216 ----
  #define __SIZE_TYPE__ long unsigned int
  #endif
  #if !(defined (__GNUG__) && defined (size_t))
+ #if __cplusplus >= 199711L
+ namespace std {
+ #endif
  typedef __SIZE_TYPE__ size_t;
+ #if __cplusplus >= 199711L
+ }
+ using std::size_t;		/* ISO C++ 14882: D.1.5.2 */
+ #endif
  #ifdef __BEOS__
  typedef long ssize_t;
  #endif /* __BEOS__ */
Index: libstdc++-v3/acinclude.m4
===================================================================
RCS file: /cvs/gcc/gcc/libstdc++-v3/acinclude.m4,v
retrieving revision 1.129.2.3
diff -c -3 -p -r1.129.2.3 acinclude.m4
*** acinclude.m4	2001/02/28 06:45:30	1.129.2.3
--- acinclude.m4	2001/03/07 16:34:03
*************** changequote([, ])
*** 1405,1417 ****
          ;;
      c)   
          CSHADOW_FLAGS=""
!         C_INCLUDE_DIR='${top_srcdir}/include/c'
          ;;
    esac
  
    AC_SUBST(CSHADOW_FLAGS)
    AC_SUBST(C_INCLUDE_DIR)
    AM_CONDITIONAL(GLIBCPP_USE_CSHADOW, test "$enable_cheaders" = c_shadow)
  ])
  
  
--- 1405,1423 ----
          ;;
      c)   
          CSHADOW_FLAGS=""
!         C_INCLUDE_DIR='${top_builddir}/include/c'
! 		CHWRAPPER_MAPFILE="\${top_srcdir}/${os_include_dir}/bits/chwrapper.map"
! 		if ! test -f $CHWRAPPER_MAPFILE; then
! 		    AC_MSG_ERROR([No C header map file defined for enable_cheaders=c])
! 		fi
! 		AC_SUBST(CHWRAPPER_MAPFILE)
          ;;
    esac
  
    AC_SUBST(CSHADOW_FLAGS)
    AC_SUBST(C_INCLUDE_DIR)
    AM_CONDITIONAL(GLIBCPP_USE_CSHADOW, test "$enable_cheaders" = c_shadow)
+   AM_CONDITIONAL(GLIBCPP_USE_CHWRAPPER, test "$enable_cheaders" = c)
  ])
  
  
Index: libstdc++-v3/src/Makefile.am
===================================================================
RCS file: /cvs/gcc/gcc/libstdc++-v3/src/Makefile.am,v
retrieving revision 1.71.2.3
diff -c -3 -p -r1.71.2.3 Makefile.am
*** Makefile.am	2001/02/28 06:45:36	1.71.2.3
--- Makefile.am	2001/03/07 16:34:23
*************** libstdc___la_LDFLAGS = -version-info 3:0
*** 196,217 ****
  libstdc___la_DEPENDENCIES = $(libstdc___la_LIBADD)
  
  
! # Make sure cshadow headers are built first.
  if GLIBCPP_USE_CSHADOW
! CSHADOW_H = $(top_builddir)/stamp-cshadow
  else
! CSHADOW_H =
  endif
  
! # Specify that all *.o's depend on this.
! $(libstdc___la_OBJECTS): $(CSHADOW_H)
  
  $(top_builddir)/stamp-cshadow: $(top_srcdir)/mkinclosure \
                                 $(top_srcdir)/mkcshadow
  	$(top_srcdir)/mkinclosure \
  	"-I $(top_builddir)/../../gcc/include -I /usr/include -G fcntl.h unistd.h" | $(top_srcdir)/mkcshadow;
  	rm -f  $(top_builddir)/stamp-cshadow 
  	echo "done" > $(top_builddir)/stamp-cshadow 
  
  
  # Check for various configure bits that change where the headers get installed.
--- 196,226 ----
  libstdc___la_DEPENDENCIES = $(libstdc___la_LIBADD)
  
  
! # Make sure headers are built first by forcing all OBJECTS to depend on them.
  if GLIBCPP_USE_CSHADOW
! built_headers = $(top_builddir)/stamp-cshadow
  else
! if GLIBCPP_USE_CHWRAPPER
! built_headers = $(top_builddir)/stamp-chwrapper
! else
! built_headers =
! endif
  endif
  
! $(libstdc___la_OBJECTS): $(built_headers)
  
+ # Build the CSHADOW headers if necessary.
  $(top_builddir)/stamp-cshadow: $(top_srcdir)/mkinclosure \
                                 $(top_srcdir)/mkcshadow
  	$(top_srcdir)/mkinclosure \
  	"-I $(top_builddir)/../../gcc/include -I /usr/include -G fcntl.h unistd.h" | $(top_srcdir)/mkcshadow;
  	rm -f  $(top_builddir)/stamp-cshadow 
  	echo "done" > $(top_builddir)/stamp-cshadow 
+ 
+ # Build the CHWRAPPER headers if necessary.
+ $(top_builddir)/stamp-chwrapper: $(top_srcdir)/mkchwrappers
+ 	$(top_srcdir)/mkchwrappers @CHWRAPPER_MAPFILE@ $(C_INCLUDE_DIR)/bits
+ 	echo "done" > $(top_builddir)/stamp-chwrapper
  
  
  # Check for various configure bits that change where the headers get installed.
