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
e8ee97bf
Commit
e8ee97bf
authored
Sep 16, 1997
by
Manfred Hollstein
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Renamed fixinc.math to fixinc.wrap
From-SVN: r15465
parent
ca55abae
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
86 additions
and
0 deletions
+86
-0
gcc/fixinc.wrap
+86
-0
No files found.
gcc/fixinc.wrap
0 → 100755
View file @
e8ee97bf
#! /bin/sh
# Create wrappers for include files instead of replacing them.
#
# This script is designed for systems whose include files can be fixed
# by creating small wrappers around them.
# An advantage of this method is that if the system include files are changed
# (e.g. by OS upgrade), you need not re-run fixincludes.
#
# See README-fixinc for more information.
# Directory containing the original header files.
# (This was named INCLUDES, but that conflicts with a name in Makefile.in.)
INPUT
=
${
2
-
${
INPUT
-/usr/include
}}
# Directory in which to store the results.
LIB
=
${
1
?
"fixincludes: output directory not specified"
}
# Make sure it exists.
if
[
!
-d
$LIB
]
;
then
mkdir
$LIB
||
exit
1
fi
echo
Building fixed headers
in
${
LIB
}
# 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
$INPUT
/
$file
]
;
then
echo
Checking
$INPUT
/
$file
if
grep
'struct exception'
$INPUT
/
$file
>
/dev/null
then
echo
Fixed
$file
rm
-f
$LIB
/
$file
cat
<<
'
__EOF__
' >
$LIB
/
$file
#ifndef _MATH_H_WRAPPER
#ifdef __cplusplus
# define exception __math_exception
#endif
#include_next <math.h>
#ifdef __cplusplus
# undef exception
#endif
#define _MATH_H_WRAPPER
#endif /* _MATH_H_WRAPPER */
__EOF__
# Define _MATH_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 <math.h>.
chmod a+r
$LIB
/
$file
fi
fi
# Avoid the definition of the bool type in the Solaris 2.x curses.h when using
# g++, since it's now an official type in the C++ language.
file
=
curses.h
if
[
-r
$INPUT
/
$file
]
;
then
echo
Checking
$INPUT
/
$file
w
=
'[ ]'
if
grep
"typedef
$w$w
*char
$w$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
exit
0
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