Skip to content

Conversation

@caomengxuan666
Copy link

@caomengxuan666 caomengxuan666 commented Aug 22, 2025

This commit modifies the file I/O configuration in miniz_zip.c to automatically enable large file support on Linux systems. The changes include:

  1. Added proper Linux platform detection using standard macros: linux, __linux, linux, and gnu_linux
  2. Removed the warning message about potential lack of large file support on Linux
  3. Used standard file functions (fopen, ftello, fseeko, stat) instead of *64 variants since _FILE_OFFSET_BITS=64 is defined during compilation
  4. Maintained backward compatibility with other platforms

When _FILE_OFFSET_BITS=64 is defined (which it is in our build configuration), the standard file functions automatically become 64-bit capable on Linux systems. This eliminates the need for explicit *64 function variants and ensures transparent large file support.

The modification ensures that miniz can handle files larger than 2GB on Linux systems without any code changes or special configuration, providing better out-of-the-box experience for Linux users.

This commit modifies the file I/O configuration in miniz_zip.c to automatically enable large file support on Linux systems. The changes include:

1. Added proper Linux platform detection using standard macros: __linux__, __linux, linux, and __gnu_linux__
2. Removed the warning message about potential lack of large file support on Linux
3. Used standard file functions (fopen, ftello, fseeko, stat) instead of *64 variants since _FILE_OFFSET_BITS=64 is defined during compilation
4. Added necessary header includes (<sys/stat.h> and <stdio.h>) for proper function declarations
5. Maintained backward compatibility with other platforms

When _FILE_OFFSET_BITS=64 is defined (which it is in our build configuration), the standard file functions automatically become 64-bit capable on Linux systems. This eliminates the need for explicit *64 function variants and ensures transparent large file support.

The modification ensures that miniz can handle files larger than 2GB on Linux systems without any code changes or special configuration, providing better out-of-the-box experience for Linux users.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant