* m4/ftruncate.m4 (gl_PREREQ_FTRUNCATE): Test for _chsize, not chsize.
* lib/ftruncate.c: Test HAVE__CHSIZE.
(chsize_nothrow): Use _chsize, not chsize.
+2020-08-09 Bruno Haible <bruno@clisp.org>
+
+ ftruncate: Use _chsize, not chsize.
+ * m4/ftruncate.m4 (gl_PREREQ_FTRUNCATE): Test for _chsize, not chsize.
+ * lib/ftruncate.c: Test HAVE__CHSIZE.
+ (chsize_nothrow): Use _chsize, not chsize.
+
2020-08-09 Bruno Haible <bruno@clisp.org>
Silence warnings from clang 10 with -Wimplicit-fallthrough.
/* Specification. */
#include <unistd.h>
-#if HAVE_CHSIZE
+#if HAVE__CHSIZE
/* A native Windows platform. */
# include <errno.h>
# if _GL_WINDOWS_64_BIT_OFF_T
-/* Large File Support: off_t is 64-bit, but chsize() takes only a 32-bit
+/* Large File Support: off_t is 64-bit, but _chsize() takes only a 32-bit
argument. So, define a 64-bit safe SetFileSize function ourselves. */
/* Ensure that <windows.h> declares GetFileSizeEx. */
TRY_MSVC_INVAL
{
- result = chsize (fd, length);
+ result = _chsize (fd, length);
}
CATCH_MSVC_INVAL
{
return result;
}
# else
-# define chsize_nothrow chsize
+# define chsize_nothrow _chsize
# endif
int
-# serial 20
+# serial 21
-# See if we need to emulate a missing ftruncate function using chsize.
+# See if we need to emulate a missing ftruncate function using _chsize.
# Copyright (C) 2000-2001, 2003-2007, 2009-2020 Free Software Foundation, Inc.
# This file is free software; the Free Software Foundation
# Prerequisites of lib/ftruncate.c.
AC_DEFUN([gl_PREREQ_FTRUNCATE],
[
- AC_CHECK_FUNCS([chsize])
+ AC_CHECK_FUNCS([_chsize])
])