aboutsummaryrefslogtreecommitdiff
path: root/gcc
diff options
context:
space:
mode:
authorIan Lance Taylor <ian@gcc.gnu.org>1996-09-30 21:19:24 +0000
committerIan Lance Taylor <ian@gcc.gnu.org>1996-09-30 21:19:24 +0000
commitbf6103db43946957540b9153e988589ebdb23f63 (patch)
treeaefc1f4019d4417f2516adc29440d4212d43f1d4 /gcc
parentded732a0b7c7f4a84bd9e1500346ba9b5c705a79 (diff)
downloadgcc-bf6103db43946957540b9153e988589ebdb23f63.zip
gcc-bf6103db43946957540b9153e988589ebdb23f63.tar.gz
gcc-bf6103db43946957540b9153e988589ebdb23f63.tar.bz2
Redefine exception in math.h for C++
From-SVN: r12882
Diffstat (limited to 'gcc')
-rwxr-xr-xgcc/fixinc.svr436
1 files changed, 36 insertions, 0 deletions
diff --git a/gcc/fixinc.svr4 b/gcc/fixinc.svr4
index bf00c03..0a9c6f9 100755
--- a/gcc/fixinc.svr4
+++ b/gcc/fixinc.svr4
@@ -1476,6 +1476,42 @@ for file in math.h floatingpoint.h; do
fi
done
+# The Solaris math.h defines 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
+base=`basename $file`
+if [ -r ${LIB}/$file ]; then
+ file_to_fix=${LIB}/$file
+else
+ if [ -r ${INPUT}/$file ]; then
+ file_to_fix=${INPUT}/$file
+ else
+ file_to_fix=""
+ fi
+fi
+if [ \! -z "$file_to_fix" ]; then
+ echo Checking $file_to_fix
+ sed -e '/struct exception/i\
+#ifdef __cplusplus\
+#define exception __math_exception\
+#endif'\
+ -e '/struct exception/a\
+#ifdef __cplusplus\
+#undef exception\
+#endif' $file_to_fix > /tmp/$base
+ if cmp $file_to_fix /tmp/$base >/dev/null 2>&1; then \
+ true
+ else
+ echo Fixed $file_to_fix
+ rm -f ${LIB}/$file
+ cp /tmp/$base ${LIB}/$file
+ chmod a+r ${LIB}/$file
+ fi
+ rm -f /tmp/$base
+fi
+
echo 'Removing unneeded directories:'
cd $LIB
files=`find . -type d -print | sort -r`