This is the mail archive of the
gcc-patches@gcc.gnu.org
mailing list for the GCC project.
Re: libg++/curses fix for OSR5 committed.
- To: ddsinc09 at ix dot netcom dot com
- Subject: Re: libg++/curses fix for OSR5 committed.
- From: Bruce Korb <korbb at datadesign dot com>
- Date: Wed, 09 Sep 1998 16:46:39 -0700
- CC: law at cygnus dot com, Robert Lipe <robertl at dgii dot com>, egcs-patches at cygnus dot com
- Organization: Data Design Systems
- References: <23112.905027745@hurl.cygnus.com> <35F70985.FAEC1153@datadesign.com>
- Reply-To: ddsinc09 at ix dot netcom dot com
Bruce Korb wrote:
> This is different than the "fixinc.wrap" approach. That approach is to
> #define "bool" for the duration of processing the file "curses.h"
> and then "#include_next" the original. That approach will *fail* if
> there are other fixes that need to be applied to "curses.h" because
> it uses a fixed-contentent wrapper file that would displace any other
> applied fixes. This approach merely disables #define-d and typedef-ed
> remappings of "bool" for __cplusplus compiles.
Um, even worse. The fixinc.sco fix has a bug. Please note the name of
the "#include_next"-ed file. You must remove the single quotes on the
here-doc EOF marker and parameterize the file name:
# 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
--
Bruce Korb | Data Design Systems, Inc.
Korbb at DataDesign dot com | 45 Cabot Dr., Suite 110
Voice: 408-260-0280 | Santa Clara, CA 95051
Fax: 408-260-0281 | USA