+2006-09-22 Danny Smith <dannysmith@users.sourceforge.net>
+
+ PR libfortran/27964
+ * configure.ac: Check for setmode() function.
+ * configure: Regenerate.
+ * config.h.in: Regenerate.
+ * io/unix.c (output_stream): Force stdout to binary mode.
+ (error_stream): Force stderr to binary mode.
+
2006-09-15 Jerry DeLisle <jvdelisle@gcc.gnu.org>
PR libgfortran/29099
/* libm includes scalbnl */
#undef HAVE_SCALBNL
+/* Define to 1 if you have the `setmode' function. */
+#undef HAVE_SETMODE
+
/* Define to 1 if you have the `signal' function. */
#undef HAVE_SIGNAL
done
-for ac_func in wait
+for ac_func in wait setmode
do
as_ac_var=`echo "ac_cv_func_$ac_func" | $as_tr_sh`
echo "$as_me:$LINENO: checking for $ac_func" >&5
AC_CHECK_FUNCS(getrusage times mkstemp strtof strtold snprintf ftruncate chsize)
AC_CHECK_FUNCS(chdir strerror getlogin gethostname kill link symlink perror)
AC_CHECK_FUNCS(sleep time ttyname signal alarm ctime clock access fork execl)
-AC_CHECK_FUNCS(wait)
+AC_CHECK_FUNCS(wait setmode)
# Check libc for getgid, getpid, getuid
AC_CHECK_LIB([c],[getgid],[AC_DEFINE([HAVE_GETGID],[1],[libc includes getgid])])
stream *
output_stream (void)
{
+#if defined(HAVE_CRLF) && defined(HAVE_SETMODE)
+ setmode (STDOUT_FILENO, O_BINARY);
+#endif
return fd_to_stream (STDOUT_FILENO, PROT_WRITE);
}
stream *
error_stream (void)
{
+#if defined(HAVE_CRLF) && defined(HAVE_SETMODE)
+ setmode (STDERR_FILENO, O_BINARY);
+#endif
return fd_to_stream (STDERR_FILENO, PROT_WRITE);
}