aboutsummaryrefslogtreecommitdiff
path: root/gcc/fixproto
diff options
context:
space:
mode:
authormanfred <manfred@138bc75d-0d04-0410-961f-82ee72b054a4>1998-03-27 00:01:08 +0000
committermanfred <manfred@138bc75d-0d04-0410-961f-82ee72b054a4>1998-03-27 00:01:08 +0000
commit6d4526729a8361917e35cc05bec604cd17070f0c (patch)
tree105d22c5b0200933d68e743087d6973b0fd7efc1 /gcc/fixproto
parent2f6cf5f15ad8d390a6dbb2d30be0bdd23f74bdb1 (diff)
a
* Makefile.in (stmp-fixinc): If we're actually fixing include files, copy gcc's assert.h into the fixed include dir. * fixincludes (assert.h): Avoid any attempts to fix a probably broken system specific assert.h file. * fixproto (stdlib.h): Make sure, it'll contain a definition of size_t. git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@18852 138bc75d-0d04-0410-961f-82ee72b054a4
Diffstat (limited to 'gcc/fixproto')
-rwxr-xr-xgcc/fixproto27
1 files changed, 24 insertions, 3 deletions
diff --git a/gcc/fixproto b/gcc/fixproto
index b7e85646470..dfeb5964c06 100755
--- a/gcc/fixproto
+++ b/gcc/fixproto
@@ -120,6 +120,7 @@ required_stdlib_h="abort abs atexit atof atoi atol bsearch calloc exit free gete
required_unistd_h="_exit access alarm chdir chown close ctermid cuserid dup dup2 execl execle execlp execv execve execvp fork fpathconf getcwd getegid geteuid getgid getlogin getopt getpgrp getpid getppid getuid isatty link lseek pathconf pause pipe read rmdir setgid setpgid setsid setuid sleep sysconf tcgetpgrp tcsetpgrp ttyname unlink write"
done_dirs=""
+subdirs_made=""
echo "" >fixproto.list
for code in ALL STD ; do
@@ -174,7 +175,9 @@ for code in ALL STD ; do
abs_target_subdir=${abs_target_dir}/${rel_source_subdir}
if [ \! -d $abs_target_subdir ] ; then
- mkdir $abs_target_subdir
+ if mkdir $abs_target_subdir ; then
+ subdirs_made="$abs_target_subdir $subdirs_made"
+ fi
fi
# Append "/"; remove initial "./". Hence "." -> "" and "sys" -> "sys/".
rel_source_prefix=`echo $rel_source_subdir | sed -e 's|$|/|' -e 's|^./||'`
@@ -199,7 +202,9 @@ for code in ALL STD ; do
# Create the dir where this file will go when fixed.
xxdir=`echo ./$file | sed -e 's|/[^/]*$||'`
if [ \! -d $abs_target_subdir/$xxdir ] ; then
- mkdir $abs_target_subdir/$xxdir
+ if mkdir $abs_target_subdir/$xxdir ; then
+ subdirs_made="$abs_target_subdir/$xxdir $subdirs_made"
+ fi
fi
# Just in case we have edited out a symbolic link
if [ -f $src_dir_std/$file -a -f $src_dir_std/$xxfile ] ; then
@@ -264,10 +269,26 @@ do
cat >tmp.h <<EOF
#ifndef ${rel_source_ident}
#define ${rel_source_ident}
-#endif
+EOF
+ if test $rel_source_file = stdlib.h
+ then
+ # Make sure it contains a definition of size_t.
+ cat >>tmp.h <<EOF
+
+#define __need_size_t
+#include <stddef.h>
+EOF
+ fi
+ cat >>tmp.h <<EOF
+
+#endif /* ${rel_source_ident} */
EOF
${FIX_HEADER} $rel_source_file tmp.h $abs_target_dir/$rel_source_file ${DEFINES} $include_path
rm tmp.h
fi
done
+
+# Remove any directories that we made that are still empty.
+rmdir $subdirs_made 2>/dev/null
+
exit 0