[multiple changes]
authorNathanael Nerode <neroden@gcc.gnu.org>
Mon, 14 Jul 2003 16:56:03 +0000 (16:56 +0000)
committerNathanael Nerode <neroden@gcc.gnu.org>
Mon, 14 Jul 2003 16:56:03 +0000 (16:56 +0000)
2003-07-14  Douglas Rupp  <rupp@gnat.com>

* fixinc/server.c (server_setup): Don't use non-POSIX NULL first
argument to getcwd; use fixed buffer instead.

2003-07-14  Nathanael Nerode  <neroden@gcc.gnu.org>

* fixinc/mkfixinc.sh: Treat OpenBSD normally.
* fixinc/fixinc.wrap: Delete.

From-SVN: r69339

gcc/ChangeLog
gcc/fixinc/fixinc.wrap [deleted file]
gcc/fixinc/mkfixinc.sh
gcc/fixinc/server.c

index 72a57bd..aa09fb3 100644 (file)
@@ -1,3 +1,13 @@
+2003-07-14  Douglas Rupp  <rupp@gnat.com>
+
+       * fixinc/server.c (server_setup): Don't use non-POSIX NULL first
+       argument to getcwd; use fixed buffer instead.
+
+2003-07-14  Nathanael Nerode  <neroden@gcc.gnu.org>
+
+       * fixinc/mkfixinc.sh: Treat OpenBSD normally.
+       * fixinc/fixinc.wrap: Delete.
+
 2003-07-14  Dan Nicolaescu  <dann@ics.uci.edu>
 
        * ggc-page.c (extra_order_size_table): Insns have 9 slots. Regs
diff --git a/gcc/fixinc/fixinc.wrap b/gcc/fixinc/fixinc.wrap
deleted file mode 100755 (executable)
index e242d5a..0000000
+++ /dev/null
@@ -1,136 +0,0 @@
-#! /bin/sh
-# Create wrappers for include files instead of replacing them.
-#
-# This script is designed for systems whose include files can be fixed
-# by creating small wrappers around them.
-# An advantage of this method is that if the system include files are changed
-# (e.g. by OS upgrade), you need not re-run fixincludes.
-#
-# See README-fixinc for more information.
-
-# Directory in which to store the results.
-LIB=${1?"fixincludes: output directory not specified"}
-
-# Make sure it exists.
-if [ ! -d $LIB ]; then
-  mkdir $LIB || exit 1
-fi
-
-ORIG_DIR=`${PWDCMD-pwd}`
-
-# Make LIB absolute if it is relative.
-# Don't do this if not necessary, since may screw up automounters.
-case $LIB in
-/*)
-       ;;
-*)
-       cd $LIB; LIB=`${PWDCMD-pwd}`
-       ;;
-esac
-
-echo Building fixed headers in ${LIB}
-# Directory containing the original header files.
-shift
-if [ $# -eq 0 ] ; then
-  set /usr/include
-fi
-
-INLIST="$@"
-
-for INPUT in ${INLIST} ; do
-cd ${ORIG_DIR}
-cd ${INPUT}
-
-# Some math.h files define struct exception, which conflicts with
-# the class exception defined in the C++ file std/stdexcept.h.  We
-# redefine it to __math_exception.  This is not a great fix, but I
-# haven't been able to think of anything better.
-file=math.h
-if [ -r $INPUT/$file ]; then
-  echo Checking $INPUT/$file
-  if grep 'struct exception' $INPUT/$file >/dev/null
-  then
-    echo Fixed $file
-    rm -f $LIB/$file
-    cat <<'__EOF__' >$LIB/$file
-#ifndef _MATH_H_WRAPPER
-#ifdef __cplusplus
-# define exception __math_exception
-#endif
- #include_next <math.h>
-#ifdef __cplusplus
-# undef exception
-#endif
-#define _MATH_H_WRAPPER
-#endif /* _MATH_H_WRAPPER */
-__EOF__
-    # Define _MATH_H_WRAPPER at the end of the wrapper, not the start,
-    # so that if #include_next gets another instance of the wrapper,
-    # this will follow the #include_next chain until we arrive at
-    # the real <math.h>.
-    chmod a+r $LIB/$file
-  fi
-fi
-
-# Similarly for struct queue in sys/stream.h.
-file=sys/stream.h
-if [ -r $INPUT/$file ]; then
-  echo Checking $INPUT/$file
-  if grep 'struct[     ]*queue' $INPUT/$file >/dev/null
-  then
-    echo Fixed $file
-    mkdir -p $LIB/`dirname $file`
-    rm -f $LIB/$file
-    cat <<'__EOF__' >$LIB/$file
-#ifndef _SYS_STREAM_H_WRAPPER
-#ifdef __cplusplus
-# define queue __stream_queue
-#endif
- #include_next <sys/stream.h>
-#ifdef __cplusplus
-# undef queue
-#endif
-#define _SYS_STREAM_H_WRAPPER
-#endif /* _SYS_STREAM_H_WRAPPER */
-__EOF__
-    # Define _SYS_STREAM_H_WRAPPER at the end of the wrapper, not the start,
-    # so that if #include_next gets another instance of the wrapper,
-    # this will follow the #include_next chain until we arrive at
-    # the real <sys/stream.h>.
-    chmod a+r $LIB/$file
-  fi
-fi
-
-# Avoid the definition of the bool type in the Solaris 2.x curses.h when using
-# g++, since it's now an official type in the C++ language.
-file=curses.h
-if [ -r $INPUT/$file ]; then
-  echo Checking $INPUT/$file
-  w='[  ]'
-  if grep "typedef$w$w*char$w$w*bool$w*;" $INPUT/$file >/dev/null
-  then
-    echo Fixed $file
-    rm -f $LIB/$file
-    cat <<'__EOF__' >$LIB/$file
-#ifndef _CURSES_H_WRAPPER
-#ifdef __cplusplus
-# define bool __curses_bool_t
-#endif
- #include_next <curses.h>
-#ifdef __cplusplus
-# undef bool
-#endif
-#define _CURSES_H_WRAPPER
-#endif /* _CURSES_H_WRAPPER */
-__EOF__
-    # Define _CURSES_H_WRAPPER at the end of the wrapper, not the start,
-    # so that if #include_next gets another instance of the wrapper,
-    # this will follow the #include_next chain until we arrive at
-    # the real <curses.h>.
-    chmod a+r $LIB/$file
-  fi
-fi
-
-done
-
-exit 0
index b8b5353..ff178b9 100755 (executable)
@@ -42,10 +42,6 @@ case $machine in
         fixincludes=fixinc.svr4
         ;;
 
-    i?86-*-openbsd*)
-        fixincludes=fixinc.wrap
-        ;;
-
     i?86-sequent-ptx* | i?86-sequent-sysv[34]*)
         fixincludes=fixinc.ptx
         ;;
index 842a321..4cb5810 100644 (file)
@@ -183,6 +183,7 @@ static void
 server_setup ()
 {
   static int atexit_done = 0;
+  char buff [MAXPATHLEN + 1];
   
   if (atexit_done++ == 0)
     atexit (close_server);
@@ -196,7 +197,8 @@ server_setup ()
 
   fputs ("trap : 1\n", server_pair.pf_write);
   fflush (server_pair.pf_write);
-  p_cur_dir = getcwd ((char *) NULL, MAXPATHLEN + 1);
+  getcwd (buff, MAXPATHLEN + 1);
+  p_cur_dir = xstrdup (buff);
 }
 
 /*