|
Packit Service |
4684c1 |
# fseeko.m4 serial 19
|
|
Packit Service |
4684c1 |
dnl Copyright (C) 2007-2020 Free Software Foundation, Inc.
|
|
Packit Service |
4684c1 |
dnl This file is free software; the Free Software Foundation
|
|
Packit Service |
4684c1 |
dnl gives unlimited permission to copy and/or distribute it,
|
|
Packit Service |
4684c1 |
dnl with or without modifications, as long as this notice is preserved.
|
|
Packit Service |
4684c1 |
|
|
Packit Service |
4684c1 |
AC_DEFUN([gl_FUNC_FSEEKO],
|
|
Packit Service |
4684c1 |
[
|
|
Packit Service |
4684c1 |
AC_REQUIRE([gl_STDIO_H_DEFAULTS])
|
|
Packit Service |
4684c1 |
AC_REQUIRE([gl_STDIN_LARGE_OFFSET])
|
|
Packit Service |
4684c1 |
AC_REQUIRE([gl_SYS_TYPES_H])
|
|
Packit Service |
4684c1 |
AC_REQUIRE([AC_PROG_CC])
|
|
Packit Service |
4684c1 |
|
|
Packit Service |
4684c1 |
dnl Persuade glibc <stdio.h> to declare fseeko().
|
|
Packit Service |
4684c1 |
AC_REQUIRE([AC_USE_SYSTEM_EXTENSIONS])
|
|
Packit Service |
4684c1 |
|
|
Packit Service |
4684c1 |
AC_CACHE_CHECK([for fseeko], [gl_cv_func_fseeko],
|
|
Packit Service |
4684c1 |
[
|
|
Packit Service |
4684c1 |
AC_LINK_IFELSE([AC_LANG_PROGRAM([[#include <stdio.h>
|
|
Packit Service |
4684c1 |
]], [fseeko (stdin, 0, 0);])],
|
|
Packit Service |
4684c1 |
[gl_cv_func_fseeko=yes], [gl_cv_func_fseeko=no])
|
|
Packit Service |
4684c1 |
])
|
|
Packit Service |
4684c1 |
|
|
Packit Service |
4684c1 |
AC_CHECK_DECLS_ONCE([fseeko])
|
|
Packit Service |
4684c1 |
if test $ac_cv_have_decl_fseeko = no; then
|
|
Packit Service |
4684c1 |
HAVE_DECL_FSEEKO=0
|
|
Packit Service |
4684c1 |
fi
|
|
Packit Service |
4684c1 |
|
|
Packit Service |
4684c1 |
if test $gl_cv_func_fseeko = no; then
|
|
Packit Service |
4684c1 |
HAVE_FSEEKO=0
|
|
Packit Service |
4684c1 |
else
|
|
Packit Service |
4684c1 |
if test $WINDOWS_64_BIT_OFF_T = 1; then
|
|
Packit Service |
4684c1 |
REPLACE_FSEEKO=1
|
|
Packit Service |
4684c1 |
fi
|
|
Packit Service |
4684c1 |
if test $gl_cv_var_stdin_large_offset = no; then
|
|
Packit Service |
4684c1 |
REPLACE_FSEEKO=1
|
|
Packit Service |
4684c1 |
fi
|
|
Packit Service |
4684c1 |
m4_ifdef([gl_FUNC_FFLUSH_STDIN], [
|
|
Packit Service |
4684c1 |
gl_FUNC_FFLUSH_STDIN
|
|
Packit Service |
4684c1 |
case "$gl_cv_func_fflush_stdin" in
|
|
Packit Service |
4684c1 |
*yes) ;;
|
|
Packit Service |
4684c1 |
*) REPLACE_FSEEKO=1 ;;
|
|
Packit Service |
4684c1 |
esac
|
|
Packit Service |
4684c1 |
])
|
|
Packit Service |
4684c1 |
fi
|
|
Packit Service |
4684c1 |
])
|
|
Packit Service |
4684c1 |
|
|
Packit Service |
4684c1 |
dnl Code shared by fseeko and ftello. Determine if large files are supported,
|
|
Packit Service |
4684c1 |
dnl but stdin does not start as a large file by default.
|
|
Packit Service |
4684c1 |
AC_DEFUN([gl_STDIN_LARGE_OFFSET],
|
|
Packit Service |
4684c1 |
[
|
|
Packit Service |
4684c1 |
AC_CACHE_CHECK([whether stdin defaults to large file offsets],
|
|
Packit Service |
4684c1 |
[gl_cv_var_stdin_large_offset],
|
|
Packit Service |
4684c1 |
[AC_LINK_IFELSE([AC_LANG_PROGRAM([[#include <stdio.h>]],
|
|
Packit Service |
4684c1 |
[[#if defined __SL64 && defined __SCLE /* cygwin */
|
|
Packit Service |
4684c1 |
/* Cygwin 1.5.24 and earlier fail to put stdin in 64-bit mode, making
|
|
Packit Service |
4684c1 |
fseeko/ftello needlessly fail. This bug was fixed in 1.5.25, and
|
|
Packit Service |
4684c1 |
it is easier to do a version check than building a runtime test. */
|
|
Packit Service |
4684c1 |
# include <cygwin/version.h>
|
|
Packit Service |
4684c1 |
# if CYGWIN_VERSION_DLL_COMBINED < CYGWIN_VERSION_DLL_MAKE_COMBINED (1005, 25)
|
|
Packit Service |
4684c1 |
choke me
|
|
Packit Service |
4684c1 |
# endif
|
|
Packit Service |
4684c1 |
#endif]])],
|
|
Packit Service |
4684c1 |
[gl_cv_var_stdin_large_offset=yes],
|
|
Packit Service |
4684c1 |
[gl_cv_var_stdin_large_offset=no])])
|
|
Packit Service |
4684c1 |
])
|
|
Packit Service |
4684c1 |
|
|
Packit Service |
4684c1 |
# Prerequisites of lib/fseeko.c.
|
|
Packit Service |
4684c1 |
AC_DEFUN([gl_PREREQ_FSEEKO],
|
|
Packit Service |
4684c1 |
[
|
|
Packit Service |
4684c1 |
dnl Native Windows has the function _fseeki64. mingw hides it in some
|
|
Packit Service |
4684c1 |
dnl circumstances, but mingw64 makes it usable again.
|
|
Packit Service |
4684c1 |
AC_CHECK_FUNCS([_fseeki64])
|
|
Packit Service |
4684c1 |
if test $ac_cv_func__fseeki64 = yes; then
|
|
Packit Service |
4684c1 |
AC_CHECK_DECLS([_fseeki64])
|
|
Packit Service |
4684c1 |
fi
|
|
Packit Service |
4684c1 |
])
|