Skip to content

Comments

More stable workaround for MinGW fseek() workaround#1759

Merged
derselbst merged 4 commits intorelease/2.5from
mingw-workaround
Feb 21, 2026
Merged

More stable workaround for MinGW fseek() workaround#1759
derselbst merged 4 commits intorelease/2.5from
mingw-workaround

Conversation

@derselbst
Copy link
Member

This makes the fseek() workaround for MinGW more stable, as per related discussion.

Addresses #1755

#if (defined(__MINGW32__) || defined(__MINGW64__)) && defined(__GNUC__) && (__GNUC__ < 15)
// Some older versions of MinGW report incorrect values for _ftelli64(). This is problematic,
// See here for the macro definitions: https://github.com/mingw-w64/mingw-w64/blob/a125b9ec1d96ff282155f2344f7d6eb50bf43c02/mingw-w64-headers/crt/_mingw_mac.h#L50-L61
#if defined(__MINGW32__) && defined(_M_IX86)
Copy link

Choose a reason for hiding this comment

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

Why are you torturing yourself with _M_IX86 instead of simply using __i386__ ?

Copy link
Member Author

Choose a reason for hiding this comment

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

That's what written in the _mingw.h header. I thought it would be appropriate to reuse that logic for x86 detection. Is __i386__ always defined for x86? I mean even then when e.g. __i686__ is defined?

Copy link

Choose a reason for hiding this comment

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

Is __i386__ always defined for x86? I mean even then when e.g. __i686__ is defined?

Yes and yes

Copy link
Member Author

Choose a reason for hiding this comment

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

Ok then, CI build passed, thanks for your perseverance.

Copy link

Choose a reason for hiding this comment

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

You're welcome

@sonarqubecloud
Copy link

@derselbst derselbst merged commit 55e1795 into release/2.5 Feb 21, 2026
116 of 120 checks passed
@derselbst derselbst deleted the mingw-workaround branch February 21, 2026 11:36
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants