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]

libg++/curses fix for OSR5 committed.


> Should the curses.h problem be fixed by fixincludes?
Jason> Yes.  You could just copy the code out of fixinc.wrap.

The following patch to fix this for OpenServer has now been committed.
I've verified that this allows libg++ to build and pass a 'make check'.

I haven't yet decided if this is broken on any of the UnixWare or UDK 
targets.   If so, I'll fix them similarly.

RJL



Index: fixinc.sco
===================================================================
RCS file: /egcs/carton/cvsfiles/egcs/gcc/fixinc.sco,v
retrieving revision 1.2
diff -u -p -r1.2 fixinc.sco
--- fixinc.sco	1998/04/03 16:34:45	1.2
+++ fixinc.sco	1998/09/03 16:43:29
@@ -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 <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
+
 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]