Skip to content

config-win32: define HAVE__FSEEKI64 - #11944

Closed
jay wants to merge 1 commit into
curl:masterfrom
jay:win32_fseeki64
Closed

jay wants to merge 1 commit into
curl:masterfrom
jay:win32_fseeki64

Conversation

@jay

@jay jay commented Sep 25, 2023 •

Copy link
Copy Markdown
Member

Follow-up to 9c7165e which added an fseeko wrapper to the lib that calls _fseeki64 if it is available.

Closes #xxxx


Follow up to #11918. I'm not entirely sure about the logic here but I think we need to do something for builds that use the pre-generated win32 configuration file config-win32.h.

/cc @ncopa

Follow-up to 9c7165e which added an fseeko wrapper to the lib that
calls _fseeki64 if it is available.

Closes #xxxx
@jay jay added the build label Sep 25, 2023
@jay
jay requested review from MarcelRaad and vszakats September 25, 2023 22:26
@github-actions github-actions Bot added the Windows Windows-specific label Sep 25, 2023

@MarcelRaad MarcelRaad left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Makes sense to me!

@vszakats

vszakats commented Sep 25, 2023 •

Copy link
Copy Markdown
Member

Agreed, and we should also pre-cache this detection via CMake/Platforms/WindowsCache.cmake.

Shouldn't we check for USE_WIN32_LARGE_FILES on use (in lib/formdata.c), rather than in lib/config-win32.h, to make it behave the same with all build systems? (CMake and autotools enables HAVE__FSEEKI64 regardless of the USE_WIN32_LARGE_FILES setting.)

@ncopa

ncopa commented Sep 26, 2023

Copy link
Copy Markdown
Contributor

I was not aware that curl supported pre-generated configs. cmake and autotools will detect if the function(s) are available regardless of platform and version. I think its better to run those tests instead of making assuptions based on OS/platform etc. But ofc, if you do support build with pre-generated configs (without running the tests), then sure.

@jay

jay commented Sep 26, 2023

Copy link
Copy Markdown
Member Author

Shouldn't we check for USE_WIN32_LARGE_FILES on use (in lib/formdata.c), rather than in lib/config-win32.h, to make it behave the same with all build systems? (CMake and autotools enables HAVE__FSEEKI64 regardless of the USE_WIN32_LARGE_FILES setting.)

That's probably not necessary. If _fseeki64 is available then it can be used even if large file support is not enabled, but on any modern system I don't know where that would happen. config-win32 supports some older systems that (I guess?) would not have _fseeki64 so I'm ok with it as is. I just compiled a test program in Visual Studio 2008 that calls _fseeki64 and it's available there, so I think we'd have to go really far back to find some time that it is not supported.

@jay jay closed this in aa6c94c Sep 26, 2023
@jay
jay deleted the win32_fseeki64 branch September 26, 2023 07:47
vszakats added a commit to vszakats/curl that referenced this pull request Sep 26, 2023
`_fseeki64` is present in mingw-w64 1.0 (2011-09-26) headers, and
at least Watcom C 1.9 (2010) headers and MSVS 2008 [1].

`fseeko` is not present in any of these.

(mingw-w64 1.0 also offers `fseeko64`.)

[1] curl#11944 (comment)

Follow-up to 9c7165e curl#11918

Closes curl#11950
vszakats added a commit that referenced this pull request Sep 26, 2023
`_fseeki64` is present in mingw-w64 1.0 (2011-09-26) headers, and
at least Watcom C 1.9 (2010) headers and MSVS 2008 [1].

`fseeko` is not present in any of these.

(mingw-w64 1.0 also offers `fseeko64`.)

[1] #11944 (comment)

Follow-up to 9c7165e #11918

Closes #11950
vszakats added a commit that referenced this pull request Nov 11, 2024
A recent update caused CMake builds to mis-detect this symbol on iOS.
Auto-detection also seems redundant given that it's a Windows-only
function and most Windows builds were already opted-in.

Drop detections and use it in all Windows builds with large file support
enabled.

Feature history:
- pririotizing for Windows: aaacd02 #14678
- Windows opt-in cmake: 8e74c07 #11950
- Windows opt-in: aa6c94c #11944
- use in libcurl: 9c7165e #11918
- use in example: 817d1c0

Regression from 8e34505 #15164

Reported-by: Maarten Billemont
Fixes #15525
Closes #15526
pps83 pushed a commit to pps83/curl that referenced this pull request Apr 26, 2025
A recent update caused CMake builds to mis-detect this symbol on iOS.
Auto-detection also seems redundant given that it's a Windows-only
function and most Windows builds were already opted-in.

Drop detections and use it in all Windows builds with large file support
enabled.

Feature history:
- pririotizing for Windows: aaacd02 curl#14678
- Windows opt-in cmake: 8e74c07 curl#11950
- Windows opt-in: aa6c94c curl#11944
- use in libcurl: 9c7165e curl#11918
- use in example: 817d1c0

Regression from 8e34505 curl#15164

Reported-by: Maarten Billemont
Fixes curl#15525
Closes curl#15526
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

build Windows Windows-specific

Development

Successfully merging this pull request may close these issues.

4 participants