This is the mail archive of the gcc-patches@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]

[1.1.1 candidate] fixinc.sco patch


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`


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]