Commit 8195ec37 by Ian Lance Taylor

Restore directory after copy. Fix abs in math.h.

From-SVN: r14365
parent 7cd5235b
...@@ -171,6 +171,9 @@ while [ $# != 0 ]; do ...@@ -171,6 +171,9 @@ while [ $# != 0 ]; do
shift; shift shift; shift
done done
# We shouldn't stay in the directory we just copied.
cd ${INPUT}
# Fix first broken decl of getcwd present on some svr4 systems. # Fix first broken decl of getcwd present on some svr4 systems.
file=stdlib.h file=stdlib.h
...@@ -297,6 +300,10 @@ fi ...@@ -297,6 +300,10 @@ fi
# the class exception defined in the C++ file std/stdexcept.h. We # 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 # redefine it to __math_exception. This is not a great fix, but I
# haven't been able to think of anything better. # 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 file=math.h
base=`basename $file` base=`basename $file`
if [ -r ${LIB}/$file ]; then if [ -r ${LIB}/$file ]; then
...@@ -317,7 +324,9 @@ if [ \! -z "$file_to_fix" ]; then ...@@ -317,7 +324,9 @@ if [ \! -z "$file_to_fix" ]; then
-e '/struct exception/a\ -e '/struct exception/a\
#ifdef __cplusplus\ #ifdef __cplusplus\
#undef exception\ #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 \ if cmp $file_to_fix /tmp/$base >/dev/null 2>&1; then \
true true
else else
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment