diff options
author | kenner <kenner@138bc75d-0d04-0410-961f-82ee72b054a4> | 1994-02-09 00:21:44 +0000 |
---|---|---|
committer | kenner <kenner@138bc75d-0d04-0410-961f-82ee72b054a4> | 1994-02-09 00:21:44 +0000 |
commit | 763ee6a8dcc00202b55039616f115c0e62149579 (patch) | |
tree | d260159d08862ef437540130f006ba8dbe49a09e /gcc/fixproto | |
parent | 929629d01aa726c2fadae685207e65b1ad34751e (diff) | |
download | gcc-763ee6a8dcc00202b55039616f115c0e62149579.tar.gz |
Append "#include <stdlib.h>" to assert.h if it uses exit or abort.
git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@6507 138bc75d-0d04-0410-961f-82ee72b054a4
Diffstat (limited to 'gcc/fixproto')
-rwxr-xr-x | gcc/fixproto | 32 |
1 files changed, 22 insertions, 10 deletions
diff --git a/gcc/fixproto b/gcc/fixproto index dd4234a0636..67241eaead1 100755 --- a/gcc/fixproto +++ b/gcc/fixproto @@ -4,7 +4,7 @@ # fixproto TARGET-DIR SOURCE-DIR-ALL SOURCE-DIR-STD # # COPYRIGHT -# Copyright (C) 1993 Free Software Foundation, Inc. +# Copyright (C) 1993, 1994 Free Software Foundation, Inc. # This file is part of GNU CC. # # GNU CC is free software; you can redistribute it and/or modify @@ -329,15 +329,27 @@ for code in ALL STD ; do rm -f fixtmp.c fixtmp.i done # check for broken assert.h that needs stdio.h - if test -f $abs_source_dir/assert.h -a \! -f $abs_target_dir/assert.h \ - && grep 'stderr' $abs_source_dir/assert.h >/dev/null - then - if grep 'include.*stdio.h' $abs_source_dir/assert.h >/dev/null - then true - else - echo 'Fixing broken assert.h (needs stdio.h)' - cat $abs_source_dir/assert.h >$abs_target_dir/assert.h - echo '#include <stdio.h>' >>$abs_target_dir/assert.h + if test -f $abs_source_dir/assert.h -a \! -f $abs_target_dir/assert.h; then + if grep 'stderr' $abs_source_dir/assert.h >/dev/null ; then + if grep 'include.*stdio.h' $abs_source_dir/assert.h >/dev/null ; then + true + else + echo 'Fixing broken assert.h (needs stdio.h)' + cat $abs_source_dir/assert.h >$abs_target_dir/assert.h + echo '#include <stdio.h>' >>$abs_target_dir/assert.h + fi + fi + if grep 'exit *(' $abs_source_dir/assert.h >/dev/null || + grep 'abort *(' $abs_source_dir/assert.h >/dev/null ; then + if grep 'include.*stdlib.h' $abs_source_dir/assert.h >/dev/null ; then + true + else + echo 'Fixing broken assert.h (needs stdlib.h)' + if test ! -f $abs_target_dir/assert.h ; then + cat $abs_source_dir/assert.h >$abs_target_dir/assert.h + fi + echo '#include <stdlib.h>' >>$abs_target_dir/assert.h + fi fi fi done_dirs="$done_dir $rel_source_dir" |