summaryrefslogtreecommitdiff
path: root/m4
diff options
context:
space:
mode:
authorBruno Haible <bruno@clisp.org>2007-04-25 09:14:49 +0000
committerBruno Haible <bruno@clisp.org>2007-04-25 09:14:49 +0000
commit16332895663c60d815322830a027ec5f660e2639 (patch)
tree92e485da0c372891c0d6c6271e890f36bded2a6a /m4
parent055a92f2c30ec10745e1aaf61a746461917695ab (diff)
downloadgnulib-16332895663c60d815322830a027ec5f660e2639.tar.gz
Make the combination of fflush and fseek/fseeko POSIX compliant.
Diffstat (limited to 'm4')
-rwxr-xr-xm4/fflush.m48
-rw-r--r--m4/fseeko.m411
2 files changed, 15 insertions, 4 deletions
diff --git a/m4/fflush.m4 b/m4/fflush.m4
index d4ebeccb6c..fca7769be1 100755
--- a/m4/fflush.m4
+++ b/m4/fflush.m4
@@ -1,4 +1,4 @@
-#serial 2
+#serial 3
# Copyright (C) 2007 Free Software Foundation, Inc.
# This file is free software; the Free Software Foundation
@@ -45,6 +45,12 @@ AC_DEFUN([gl_FUNC_FFLUSH],
AC_DEFUN([gl_REPLACE_FFLUSH],
[
AC_LIBOBJ([fflush])
+ AC_LIBOBJ([fseeko])
AC_REQUIRE([gl_STDIO_H_DEFAULTS])
REPLACE_FFLUSH=1
+ gl_CHECK_FSEEKO
+ if test $gl_cv_func_fseeko = yes; then
+ AC_DEFINE([HAVE_FSEEKO], 1,
+ [Define to 1 if you have the fseeko() function or macro.])
+ fi
])
diff --git a/m4/fseeko.m4 b/m4/fseeko.m4
index 86d42f40cc..fd3f019f7f 100644
--- a/m4/fseeko.m4
+++ b/m4/fseeko.m4
@@ -7,13 +7,18 @@ dnl with or without modifications, as long as this notice is preserved.
AC_DEFUN([gl_FUNC_FSEEKO],
[
AC_REQUIRE([gl_STDIO_H_DEFAULTS])
+ gl_CHECK_FSEEKO
+ if test $gl_cv_func_fseeko = no; then
+ HAVE_FSEEKO=0
+ fi
+])
+
+AC_DEFUN([gl_CHECK_FSEEKO],
+[
AC_REQUIRE([AC_PROG_CC])
AC_CACHE_CHECK([for fseeko], [gl_cv_func_fseeko],
[
AC_TRY_LINK([#include <stdio.h>], [fseeko (stdin, 0, 0);],
[gl_cv_func_fseeko=yes], [gl_cv_func_fseeko=no])
])
- if test $gl_cv_func_fseeko = no; then
- HAVE_FSEEKO=0
- fi
])