Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
R
riscv-gcc-1
Overview
Overview
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
lvzhengyang
riscv-gcc-1
Commits
ded732a0
Commit
ded732a0
authored
Sep 30, 1996
by
Ian Lance Taylor
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Redefine exception in math.h
From-SVN: r12881
parent
6cb2e74e
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
45 additions
and
1 deletions
+45
-1
gcc/fixincludes
+45
-1
No files found.
gcc/fixincludes
View file @
ded732a0
...
@@ -1322,7 +1322,7 @@ if [ -r $file ] && [ ! -r ${LIB}/$file ]; then
...
@@ -1322,7 +1322,7 @@ if [ -r $file ] && [ ! -r ${LIB}/$file ]; then
fi
fi
if
[
-r
${
LIB
}
/
$file
]
;
then
if
[
-r
${
LIB
}
/
$file
]
;
then
if
grep
'class[(]'
${
LIB
}
/
$file
>
/dev/null
;
then
if
grep
'
[^a-zA-Z_]
class[(]'
${
LIB
}
/
$file
>
/dev/null
;
then
echo
Fixing
$file
echo
Fixing
$file
sed
-e
'/class[(]/i\
sed
-e
'/class[(]/i\
#ifndef __cplusplus
#ifndef __cplusplus
...
@@ -2705,6 +2705,50 @@ if [ -r ${LIB}/$file ]; then
...
@@ -2705,6 +2705,50 @@ if [ -r ${LIB}/$file ]; then
fi
fi
fi
fi
# Some math.h files define 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
if
[
-r
$file
]
&&
[
!
-r
${
LIB
}
/
$file
]
;
then
cp
$file
${
LIB
}
/
$file
>
/dev/null 2>&1
||
echo
"Can't copy
$file
"
chmod +w
${
LIB
}
/
$file
2>/dev/null
chmod a+r
${
LIB
}
/
$file
2>/dev/null
fi
if
[
-r
${
LIB
}
/
$file
]
;
then
echo
Fixing
$file
, exception
sed
-e
'/struct exception/i\
#ifdef __cplusplus\
#define exception __math_exception\
#endif'
\
-e
'/struct exception/a\
#ifdef __cplusplus\
#undef exception\
#endif'
${
LIB
}
/
$file
>
${
LIB
}
/
${
file
}
.sed
rm
-f
${
LIB
}
/
$file
;
mv
${
LIB
}
/
${
file
}
.sed
${
LIB
}
/
$file
if
egrep
'matherr()'
${
LIB
}
/
$file
>
/dev/null 2>&1
;
then
sed
-e
'/matherr/i\
#ifdef __cplusplus\
#define exception __math_exception\
#endif'
\
-e
'/matherr/a\
#ifdef __cplusplus\
#undef exception\
#endif'
${
LIB
}
/
$file
>
${
LIB
}
/
${
file
}
.sed
rm
-f
${
LIB
}
/
$file
;
mv
${
LIB
}
/
${
file
}
.sed
${
LIB
}
/
$file
fi
if
cmp
$file
${
LIB
}
/
$file
>
/dev/null 2>&1
;
then
rm
-f
${
LIB
}
/
$file
else
# Find any include directives that use "file".
for
include
in
`
egrep
'^[ ]*#[ ]*include[ ]*"[^/]'
${
LIB
}
/
$file
| sed
-e
's/^[ ]*#[ ]*include[ ]*"\([^"]*\)".*$/\1/'
`
;
do
dir
=
`
echo
$file
| sed
-e
s
'|/[^/]*$||'
`
required
=
"
$required
${
INPUT
}
$dir
/
$include
${
LIB
}
/
$dir
/
$include
"
done
fi
fi
# This loop does not appear to do anything, because it uses file
# This loop does not appear to do anything, because it uses file
# rather than $file when setting target. It also appears to be
# rather than $file when setting target. It also appears to be
# unnecessary, since the main loop processes symbolic links.
# unnecessary, since the main loop processes symbolic links.
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment