summaryrefslogtreecommitdiff
path: root/tests/ftruncate.c
diff options
context:
space:
mode:
authorJörg Frings-Fürst <debian@jff.email>2025-10-18 19:07:08 +0200
committerJörg Frings-Fürst <debian@jff.email>2025-10-18 19:07:08 +0200
commit693ae7b71dfdd1a8146266b5794a71c0dbe5dff0 (patch)
tree9704e2f7bd8962ea8911cd6f4e2d37227d7eff2e /tests/ftruncate.c
parentb8b9b0ac61ac47dddc58717f23619f8b06640498 (diff)
parent27dae84ed92f1ef0300263091972338d12e78348 (diff)
Update upstream source from tag 'upstream/1.4.1'
Update to upstream version '1.4.1' with Debian dir 8add41ffbfe3e6636eec0ec134c5af96832cc143
Diffstat (limited to 'tests/ftruncate.c')
-rw-r--r--tests/ftruncate.c10
1 files changed, 7 insertions, 3 deletions
diff --git a/tests/ftruncate.c b/tests/ftruncate.c
index 63947257..ca19f21e 100644
--- a/tests/ftruncate.c
+++ b/tests/ftruncate.c
@@ -1,5 +1,5 @@
/* ftruncate emulations for native Windows.
- Copyright (C) 1992-2024 Free Software Foundation, Inc.
+ Copyright (C) 1992-2025 Free Software Foundation, Inc.
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
@@ -24,10 +24,14 @@
# include <errno.h>
-# if _GL_WINDOWS_64_BIT_OFF_T
+/* We need to test _FILE_OFFSET_BITS for mingw-w64
+ and _GL_WINDOWS_64_BIT_OFF_T for MSVC. */
+# if (_FILE_OFFSET_BITS == 64 || _GL_WINDOWS_64_BIT_OFF_T)
/* 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. */
+ argument. Some newer versions of the Windows CRT have a _chsize_s function
+ that takes a 64-bit argument, but we cannot rely on that.
+ So, define a 64-bit safe SetFileSize function ourselves. */
/* Ensure that <windows.h> declares GetFileSizeEx. */
# if !defined _WIN32_WINNT || (_WIN32_WINNT < _WIN32_WINNT_WIN2K)