summaryrefslogtreecommitdiff
path: root/gcc/fixinc
diff options
context:
space:
mode:
authorneroden <neroden@138bc75d-0d04-0410-961f-82ee72b054a4>2003-07-14 16:56:03 +0000
committerneroden <neroden@138bc75d-0d04-0410-961f-82ee72b054a4>2003-07-14 16:56:03 +0000
commitf86abe455b749d554baaea751d70911fccdc46a0 (patch)
tree3baf5158214bf487485c2c11f6100d9af30b29f9 /gcc/fixinc
parent960e38caa7eaf6c956b7820e71c2f5c81a0b01ef (diff)
downloadgcc-f86abe455b749d554baaea751d70911fccdc46a0.tar.gz
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. git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@69339 138bc75d-0d04-0410-961f-82ee72b054a4
Diffstat (limited to 'gcc/fixinc')
-rwxr-xr-xgcc/fixinc/fixinc.wrap136
-rwxr-xr-xgcc/fixinc/mkfixinc.sh4
-rw-r--r--gcc/fixinc/server.c4
3 files changed, 3 insertions, 141 deletions
diff --git a/gcc/fixinc/fixinc.wrap b/gcc/fixinc/fixinc.wrap
deleted file mode 100755
index e242d5aa5cf..00000000000
--- a/gcc/fixinc/fixinc.wrap
+++ /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
diff --git a/gcc/fixinc/mkfixinc.sh b/gcc/fixinc/mkfixinc.sh
index b8b5353fe2a..ff178b9b0d2 100755
--- a/gcc/fixinc/mkfixinc.sh
+++ b/gcc/fixinc/mkfixinc.sh
@@ -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
;;
diff --git a/gcc/fixinc/server.c b/gcc/fixinc/server.c
index 842a32181ef..4cb581086cd 100644
--- a/gcc/fixinc/server.c
+++ b/gcc/fixinc/server.c
@@ -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);
}
/*