aboutsummaryrefslogtreecommitdiff
path: root/gcc
diff options
context:
space:
mode:
authorJason Merrill <merrill@gnu.org>1994-04-04 21:21:02 +0000
committerJason Merrill <merrill@gnu.org>1994-04-04 21:21:02 +0000
commit6c8ceeae0e772acfd1d7de5abcd623b78b7933e1 (patch)
treeec0ec92000042f0fd932e85ce0b0e93dcdf4d3d0 /gcc
parentf98e603e09daa98f71247d484ccf747031c2ab89 (diff)
downloadgcc-6c8ceeae0e772acfd1d7de5abcd623b78b7933e1.zip
gcc-6c8ceeae0e772acfd1d7de5abcd623b78b7933e1.tar.gz
gcc-6c8ceeae0e772acfd1d7de5abcd623b78b7933e1.tar.bz2
fixincludes: Fix ptrdiff_t and wchar_t in system headers like we do size_t.
* fixincludes: Fix ptrdiff_t and wchar_t in system headers like we do size_t. From-SVN: r6960
Diffstat (limited to 'gcc')
-rwxr-xr-xgcc/fixincludes23
1 files changed, 19 insertions, 4 deletions
diff --git a/gcc/fixincludes b/gcc/fixincludes
index 46ed6e1..95d4857 100755
--- a/gcc/fixincludes
+++ b/gcc/fixincludes
@@ -347,7 +347,8 @@ done
cd ${INPUT}
-# Install the proper definition of size_t in header files that it comes from.
+# Install the proper definition of the three standard types in header files
+# that they come from.
for file in sys/types.h stdlib.h sys/stdtypes.h stddef.h memory.h unistd.h; do
if [ -r $file ] && [ ! -r ${LIB}/$file ]; then
cp $file ${LIB}/$file >/dev/null 2>&1 || echo "Can't copy $file"
@@ -356,13 +357,27 @@ for file in sys/types.h stdlib.h sys/stdtypes.h stddef.h memory.h unistd.h; do
fi
if [ -r ${LIB}/$file ]; then
- echo Fixing size_t in $file
- sed -e '/typedef[ ][ ]*[a-z_][ a-z_]*[ ]size_t/i\
+ echo Fixing size_t, ptrdiff_t and wchar_t in $file
+ sed \
+ -e '/typedef[ ][ ]*[a-z_][ a-z_]*[ ]size_t/i\
#ifndef __SIZE_TYPE__\
#define __SIZE_TYPE__ long unsigned int\
#endif
' \
- -e 's/typedef[ ][ ]*[a-z_][ a-z_]*[ ]size_t/typedef __SIZE_TYPE__ size_t/' ${LIB}/$file > ${LIB}/${file}.sed
+ -e 's/typedef[ ][ ]*[a-z_][ a-z_]*[ ]size_t/typedef __SIZE_TYPE__ size_t/' \
+ -e '/typedef[ ][ ]*[a-z_][ a-z_]*[ ]ptrdiff_t/i\
+#ifndef __PTRDIFF_TYPE__\
+#define __PTRDIFF_TYPE__ long int\
+#endif
+' \
+ -e 's/typedef[ ][ ]*[a-z_][ a-z_]*[ ]ptrdiff_t/typedef __PTRDIFF_TYPE__ ptrdiff_t/' \
+ -e '/typedef[ ][ ]*[a-z_][ a-z_]*[ ]wchar_t/i\
+#ifndef __WCHAR_TYPE__\
+#define __WCHAR_TYPE__ int\
+#endif
+' \
+ -e 's/typedef[ ][ ]*[a-z_][ a-z_]*[ ]wchar_t/typedef __WCHAR_TYPE__ wchar_t/' \
+ ${LIB}/$file > ${LIB}/${file}.sed
rm -f ${LIB}/$file; mv ${LIB}/${file}.sed ${LIB}/$file
if cmp $file ${LIB}/$file >/dev/null 2>&1; then
rm ${LIB}/$file