summaryrefslogtreecommitdiff
path: root/gcc/fixinc.sco
diff options
context:
space:
mode:
authorIan Lance Taylor <ian@gcc.gnu.org>1997-07-01 15:16:38 +0000
committerIan Lance Taylor <ian@gcc.gnu.org>1997-07-01 15:16:38 +0000
commit8195ec37afe082d68902cab332762a92fc4c5abf (patch)
tree2480299d037e1104edab21beb110dd38616b5fbd /gcc/fixinc.sco
parent7cd5235bad7e352c5364dcdac82bf123d42aa154 (diff)
downloadgcc-8195ec37afe082d68902cab332762a92fc4c5abf.tar.gz
Restore directory after copy. Fix abs in math.h.
From-SVN: r14365
Diffstat (limited to 'gcc/fixinc.sco')
-rwxr-xr-xgcc/fixinc.sco11
1 files changed, 10 insertions, 1 deletions
diff --git a/gcc/fixinc.sco b/gcc/fixinc.sco
index 1b2a0630f66..ead82984b58 100755
--- a/gcc/fixinc.sco
+++ b/gcc/fixinc.sco
@@ -171,6 +171,9 @@ while [ $# != 0 ]; do
shift; shift
done
+# We shouldn't stay in the directory we just copied.
+cd ${INPUT}
+
# Fix first broken decl of getcwd present on some svr4 systems.
file=stdlib.h
@@ -297,6 +300,10 @@ fi
# 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.
+#
+# OpenServer's math.h declares abs as inline int abs... Unfortunately,
+# we blow over that one (with C++ linkage) and stick a new one in stdlib.h
+# with C linkage. So we eat the one out of math.h.
file=math.h
base=`basename $file`
if [ -r ${LIB}/$file ]; then
@@ -317,7 +324,9 @@ if [ \! -z "$file_to_fix" ]; then
-e '/struct exception/a\
#ifdef __cplusplus\
#undef exception\
-#endif' $file_to_fix > /tmp/$base
+#endif' \
+ -e 's@inline int abs(int [a-z][a-z]*) {.*}@extern "C" int abs(int);@' \
+ $file_to_fix > /tmp/$base
if cmp $file_to_fix /tmp/$base >/dev/null 2>&1; then \
true
else