This is the mail archive of the
gcc-patches@gcc.gnu.org
mailing list for the GCC project.
[1.1.1 candidate] fixinc.sco patch
- To: egcs-patches at cygnus dot com
- Subject: [1.1.1 candidate] fixinc.sco patch
- From: Robert Lipe <robertl at dgii dot com>
- Date: Sun, 1 Nov 1998 10:45:43 -0600
- Cc: jpr at jpr dot com
Jeff, how would you feel about installing this patch from the trunk into
the 1.1.1 branch?
Sat Oct 31 22:35:29 1998 Jean-Pierre Radley <jpr@jpr.com>
* fixinc.sco: Paramaterize #include_next values.
* fixinc/fixinc.sco: Likewise.
Thu Sep 3 11:41:40 1998 Robert Lipe <robertl@dgii.com>
* fixinc.sco: Borrow code to wrap 'bool' typedefs from tinfo.h
and term.h from fixinc.wrap.
Thanx,
RJL
Index: fixinc.sco
===================================================================
RCS file: /egcs/carton/cvsfiles/egcs/gcc/fixinc.sco,v
retrieving revision 1.2
retrieving revision 1.4
diff -u -p -r1.2 -r1.4
--- fixinc.sco 1998/04/03 16:34:45 1.2
+++ fixinc.sco 1998/10/31 20:37:48 1.4
@@ -369,6 +369,39 @@ extern "C"\
fi
fi
+# This fix has the regex modified from the from fixinc.wrap
+# Avoid the definition of the bool type in the following files when using
+# g++, since it's now an official type in the C++ language.
+for file in term.h tinfo.h
+do
+ if [ -r $INPUT/$file ]; then
+ echo Checking $INPUT/$file
+ w='[ ]'
+ if grep "typedef$w.*char$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 <$file>
+#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 system include file.
+ chmod a+r $LIB/$file
+ fi
+ fi
+done
+
echo 'Removing unneeded directories:'
cd $LIB
files=`find . -type d -print | sort -r`