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
56a77e1e
Commit
56a77e1e
authored
Nov 12, 2000
by
Bruce Korb
Committed by
Bruce Korb
Nov 12, 2000
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
avoid commenting out #endifs
From-SVN: r37401
parent
8d8523fe
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
8 additions
and
286 deletions
+8
-286
gcc/ChangeLog
+6
-0
gcc/fixinc/fixinc.irix
+0
-280
gcc/fixinc/fixincl.x
+0
-2
gcc/fixinc/inclhack.def
+2
-4
No files found.
gcc/ChangeLog
View file @
56a77e1e
2000-11-11 Bruce Korb <bkorb@gnu.org>
* fixinc/inclhack.def (avoid_bool_type): avoid commenting out #endif
(avoid_wchar_t_type): ditto
* fixinc/fixinc.irix: obsoleted
2000-11-11 Zack Weinberg <zack@wolery.stanford.edu>
* configure.in: Don't add $outputs to all_lang_makefiles. Add
...
...
gcc/fixinc/fixinc.irix
deleted
100755 → 0
View file @
8d8523fe
#! /bin/sh
# Install modified versions of certain problematic Irix include files.
# If possible, create a wrapper (see fixinc.wrap) instead of copying files.
#
# Copyright (C) 1997, 1998 Free Software Foundation, Inc.
# Contributed by Brendan Kehoe (brendan@cygnus.com).
#
# This file is part of GNU CC.
#
# GNU CC is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation; either version 2, or (at your option)
# any later version.
#
# GNU CC is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details.
#
# You should have received a copy of the GNU General Public License
# along with GNU CC; see the file COPYING. If not, write to
# the Free Software Foundation, 59 Temple Place - Suite 330,
# Boston, MA 02111-1307, USA.
#
# See README-fixinc for more information.
# Fail if no arg to specify a directory for the output.
if
[
x
$1
=
x
]
then
echo
fixincludes: no output directory specified
exit
1
fi
# 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
ORIG_DIR
=
`
${
PWDCMD
-pwd
}
`
# Make LIB absolute if it is relative.
# Don't do this if not necessary, since may screw up automounters.
case
$LIB
in
/
*
)
;;
*
)
cd
$LIB
;
LIB
=
`
${
PWDCMD
-pwd
}
`
;;
esac
echo
'Building fixincludes in '
${
LIB
}
# Directory containing the original header files.
shift
if
[
$#
-eq
0
]
;
then
set
/usr/include
fi
INLIST
=
"
$@
"
for
INPUT
in
${
INLIST
}
;
do
cd
${
ORIG_DIR
}
cd
${
INPUT
}
#
# Note: For Irix, we deliberately don't try to create the directory trees,
# since we only modify math.h, limits.h and unistd.h. If we
# ADD ANY OTHERS, the "Making directories:" and symlinks code from
# fixinc.svr4 may have to go back in.
# This math.h fix is copied from fixinc.wrap. We want to avoid copying
# math.h because both math.h and stdlib.h have a declaration for initstate,
# and this declaration changed between Irix 6.2 and Irix 6.3. If we copy this
# file, then the same toolchain can't be shared between 6.2 and 6.3+.
# 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 curses.h when using
# g++, since it's now an official type in the C++ language.
# This is also from fixinc.wrap.
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
# In limits.h, put #ifndefs around things that are supposed to be defined
# in float.h to avoid redefinition errors if float.h is included first.
file
=
limits.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
'/[ ]FLT_MIN[ ]/i\
#ifndef FLT_MIN
'
\
-e
'/[ ]FLT_MIN[ ]/a\
#endif
'
\
-e
'/[ ]FLT_MAX[ ]/i\
#ifndef FLT_MAX
'
\
-e
'/[ ]FLT_MAX[ ]/a\
#endif
'
\
-e
'/[ ]FLT_DIG[ ]/i\
#ifndef FLT_DIG
'
\
-e
'/[ ]FLT_DIG[ ]/a\
#endif
'
\
-e
'/[ ]DBL_MIN[ ]/i\
#ifndef DBL_MIN
'
\
-e
'/[ ]DBL_MIN[ ]/a\
#endif
'
\
-e
'/[ ]DBL_MAX[ ]/i\
#ifndef DBL_MAX
'
\
-e
'/[ ]DBL_MAX[ ]/a\
#endif
'
\
-e
'/[ ]DBL_DIG[ ]/i\
#ifndef DBL_DIG
'
\
-e
'/[ ]DBL_DIG[ ]/a\
#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
# The Irix unistd.h will introduce a call to __vfork in its libc, but the
# function is never actually prototyped.
file
=
unistd.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
'/__vfork/i\
extern pid_t __vfork(void);'
\
$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
done
# Don't use or define the name va_list in stdio.h.
# This is for ANSI and also to interoperate properly with gcc's varargs.h.
# Arrange for stdio.h to use stdarg.h to define __gnuc_va_list
file
=
stdio.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
Fixing
$file_to_fix
echo
"#define __need___va_list"
>
/tmp/
$base
echo
"#include <stdarg.h>"
>>
/tmp/
$base
sed
-e
's@ va_list @ __gnuc_va_list @'
\
-e
's@ va_list)@ __gnuc_va_list)@'
\
-e
's@ _BSD_VA_LIST_))@ __gnuc_va_list))@'
\
-e
's@ _VA_LIST_));@ __gnuc_va_list));@'
\
-e
's@ va_list@ __not_va_list__@'
\
-e
's@\*va_list@*__not_va_list__@'
\
-e
's@ __va_list)@ __gnuc_va_list)@'
\
-e
's@GNUC_VA_LIST@GNUC_Va_LIST@'
\
-e
's@_NEED___VA_LIST@_NEED___Va_LIST@'
\
-e
's@VA_LIST@DUMMY_VA_LIST@'
\
-e
's@_Va_LIST@_VA_LIST@'
$file_to_fix
>>
/tmp/
$base
echo
Fixed
$file_to_fix
rm
-f
${
LIB
}
/
$file
cp /tmp/
$base
${
LIB
}
/
$file
chmod a+r
${
LIB
}
/
$file
rm
-f
/tmp/
$base
fi
if
[
x
${
INSTALL_ASSERT_H
}
!=
x
]
then
cd
${
ORIG_DIR
}
rm
-f
include/assert.h
cp
${
srcdir
}
/assert.h include/assert.h
||
exit
1
chmod a+r include/assert.h
fi
exit
0
gcc/fixinc/fixincl.x
View file @
56a77e1e
...
...
@@ -1290,7 +1290,6 @@ static const char* apzAvoid_Bool_TypePatch[] = {
"#ifndef __cplusplus\n\
%0\n\
#endif",
"^[ \t]*typedef[ \t].*[ \t]bool[ \t]*;.*",
(char*)NULL };
/* * * * * * * * * * * * * * * * * * * * * * * * * *
...
...
@@ -1328,7 +1327,6 @@ static const char* apzAvoid_Wchar_T_TypePatch[] = {
"#ifndef __cplusplus\n\
%0\n\
#endif",
"^[ \t]*typedef[ \t].*[ \t]wchar_t[ \t]*;.*",
(char*)NULL };
/* * * * * * * * * * * * * * * * * * * * * * * * * *
...
...
gcc/fixinc/inclhack.def
View file @
56a77e1e
...
...
@@ -764,9 +764,8 @@ fix = {
c_fix = format;
c_fix_arg = "#ifndef __cplusplus\n%0\n#endif";
c_fix_arg = "^[ \t]*typedef[ \t].*[ \t]bool[ \t]*;.*";
test_text = "typedef unsigned int\tbool \t; /* bool type */";
test_text = "typedef unsigned int\tbool \t; /* bool
\n
type */";
};
/*
...
...
@@ -781,9 +780,8 @@ fix = {
c_fix = format;
c_fix_arg = "#ifndef __cplusplus\n%0\n#endif";
c_fix_arg = "^[ \t]*typedef[ \t].*[ \t]wchar_t[ \t]*;.*";
test_text = "typedef unsigned short\twchar_t \t; /* wchar_t type */";
test_text = "typedef unsigned short\twchar_t \t; /* wchar_t
\n
type */";
};
/*
...
...
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