* fixinc/fixinc.irix (stdio.h): Hack stdio.h to avoid problems
authorlaw <law@138bc75d-0d04-0410-961f-82ee72b054a4>
Tue, 28 Sep 1999 01:11:08 +0000 (01:11 +0000)
committerlaw <law@138bc75d-0d04-0410-961f-82ee72b054a4>
Tue, 28 Sep 1999 01:11:08 +0000 (01:11 +0000)
        with va_list.

git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@29683 138bc75d-0d04-0410-961f-82ee72b054a4

gcc/ChangeLog
gcc/fixinc/fixinc.irix

index e1fe76d..7c1d114 100644 (file)
@@ -1,3 +1,8 @@
+Mon Sep 27 19:06:04 1999  Jeffrey A Law  (law@cygnus.com)
+
+       * fixinc/fixinc.irix (stdio.h): Hack stdio.h to avoid problems
+       with va_list.
+
 Mon Sep 27 19:40:17 CEST 1999  Marc Espie <espie@cvs.openbsd.org>
 
        * configure.in (mips*el-*-openbsd*):  Don't duplicate default settings.
index d12c786..24a045a 100755 (executable)
@@ -232,6 +232,43 @@ 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@ __va_list__@' \
+      -e 's@\*va_list@*__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}