From b0afb8fe0ff1d87165af9df61501197a06240dda Mon Sep 17 00:00:00 2001 From: Lorenz Kästle <12514511+RincewindsHat@users.noreply.github.com> Date: Sun, 28 Dec 2025 12:13:40 +0100 Subject: Sync with Gnulib stable-202507 code (a8ac9f9ce5) --- gl/ftello.c | 11 +++++++---- 1 file changed, 7 insertions(+), 4 deletions(-) (limited to 'gl/ftello.c') diff --git a/gl/ftello.c b/gl/ftello.c index 64119aab..b0a20bf3 100644 --- a/gl/ftello.c +++ b/gl/ftello.c @@ -1,5 +1,5 @@ /* An ftello() function that works around platform bugs. - Copyright (C) 2007, 2009-2024 Free Software Foundation, Inc. + Copyright (C) 2007, 2009-2025 Free Software Foundation, Inc. This file is free software: you can redistribute it and/or modify it under the terms of the GNU Lesser General Public License as @@ -20,7 +20,7 @@ #include #include -#include "intprops.h" +#include /* Get lseek. */ #include @@ -34,7 +34,10 @@ ftello (FILE *fp) # undef ftell # define ftello ftell #endif -#if _GL_WINDOWS_64_BIT_OFF_T +#if (defined _WIN32 && !defined __CYGWIN__) \ + /* We need to test _FILE_OFFSET_BITS for mingw-w64 */ \ + /* and _GL_WINDOWS_64_BIT_OFF_T for MSVC. */ \ + && (_FILE_OFFSET_BITS == 64 || _GL_WINDOWS_64_BIT_OFF_T) # undef ftello # if HAVE__FTELLI64 /* msvc, mingw64 */ # define ftello _ftelli64 @@ -97,7 +100,7 @@ ftello (FILE *fp) /* Compute pos + buffered, with overflow check. */ off_t sum; - if (! INT_ADD_OK (pos, buffered, &sum)) + if (ckd_add (&sum, pos, buffered)) { errno = EOVERFLOW; return -1; -- cgit v1.2.3-74-g34f1