Skip to content

fileio: use the prefixed lz4frame type LZ4F_contentChecksum_t #4897

Open

Description

@Cyan4973

programs/fileio.c defines LZ4F_ENABLE_OBSOLETE_ENUMS and employs contentChecksum_t, an unprefixed name obsolete since lz4 v1.7.0.

Suggested fix :

  • (LZ4F_contentChecksum_t)checksumFlag
  • drop #define LZ4F_ENABLE_OBSOLETE_ENUMS
  • in the LZ4_VERSION_NUMBER <= 10600 block, add #define LZ4F_contentChecksum_t contentChecksum_t

Activity

  1. 0-wiz-0 commented on Nov 9, 2026

    @0-wiz-0
    Contributor

    In the hope of reducing work for others, I followed this advice when fixing pkgsrc and here's the patch:

    --- programs/fileio.c.orig      2026-11-09 15:52:03.790967007 +0000
    +++ programs/fileio.c
    @@ -65,7 +65,6 @@ UTIL_time_t g_displayClock = UTIL_TIME_INITIALIZER;
    
     #define LZ4_MAGICNUMBER 0x184D2204
     #if defined(ZSTD_LZ4COMPRESS) || defined(ZSTD_LZ4DECOMPRESS)
    -#  define LZ4F_ENABLE_OBSOLETE_ENUMS
     #  include <lz4frame.h>
     #  include <lz4.h>
     #endif
    @@ -1389,6 +1388,7 @@ FIO_compressLzmaFrame(cRess_t* ress,
    
     #if LZ4_VERSION_NUMBER <= 10600
     #define LZ4F_blockLinked blockLinked
    +#define LZ4F_contentChecksum_t contentChecksum_t
     #define LZ4F_max64KB max64KB
     #endif
    
    @@ -1421,7 +1421,7 @@ FIO_compressLz4Frame(cRess_t* ress,
         prefs.compressionLevel = compressionLevel;
         prefs.frameInfo.blockMode = LZ4F_blockLinked;
         prefs.frameInfo.blockSizeID = LZ4F_max64KB;
    -    prefs.frameInfo.contentChecksumFlag = (contentChecksum_t)checksumFlag;
    +    prefs.frameInfo.contentChecksumFlag = (LZ4F_contentChecksum_t)checksumFlag;
     #if LZ4_VERSION_NUMBER >= 10600
         prefs.frameInfo.contentSize = (srcFileSize==UTIL_FILESIZE_UNKNOWN) ? 0 : srcFileSize;
     #endif
    
  2. added a commit that references this issue on Nov 9, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions