Thread

Commits

  1. Improve const use in zlib-using code

  2. Remove configure check for z_streamp

  1. Improve const use in zlib-using code

    Peter Eisentraut <peter@eisentraut.org> — 2023-08-02T09:50:57Z

    Now that we have effectively de-supported CentOS 6, by removing support 
    for its OpenSSL version, I think we could also modernize the use of some 
    other libraries, such as zlib.
    
    If we define ZLIB_CONST before including zlib.h, zlib augments some
    interfaces with const decorations.  By doing that we can keep our own
    interfaces cleaner and can remove some unconstify calls.
    
    ZLIB_CONST was introduced in zlib 1.2.5.2 (17 Dec 2011); CentOS 6 has 
    zlib-1.2.3-29.el6.x86_64.
    
    Note that if you use this patch and compile on CentOS 6, it still works, 
    you just get a few compiler warnings about discarding qualifiers.  Old 
    environments tend to produce more compiler warnings anyway, so this 
    doesn't seem so bad.
  2. Re: Improve const use in zlib-using code

    Tristan Partin <tristan@neon.tech> — 2023-08-02T14:39:00Z

    Peter,
    
    I like the idea. Though the way you have it implemented at the moment 
    seems like a trap in that any time zlib.h is included someone also has 
    to remember to add this define. I would recommend adding the define to 
    the build systems instead.
    
    Since you put in the work to find the version of zlib that added this, 
    You might also want to add `required: '>= 1.2.5.2'` to the 
    `dependency('zlib')` call in the main meson.build. I am wondering if we 
    could remove the `z_streamp` check too. The version that it was added 
    isn't obvious.
    
    -- 
    Tristan Partin
    Neon (https://neon.tech)
    
    
    
    
  3. Re: Improve const use in zlib-using code

    Peter Eisentraut <peter@eisentraut.org> — 2023-08-03T07:08:13Z

    On 02.08.23 16:39, Tristan Partin wrote:
    > I like the idea. Though the way you have it implemented at the moment 
    > seems like a trap in that any time zlib.h is included someone also has 
    > to remember to add this define. I would recommend adding the define to 
    > the build systems instead.
    
    Ok, moved to c.h.
    
    > Since you put in the work to find the version of zlib that added this, 
    > You might also want to add `required: '>= 1.2.5.2'` to the 
    > `dependency('zlib')` call in the main meson.build.
    
    Well, it's not a hard requirement, so I think this is not necessary.
    
    > I am wondering if we 
    > could remove the `z_streamp` check too. The version that it was added 
    > isn't obvious.
    
    Yeah, that appears to be very obsolete.  I have made an additional patch 
    to remove that.
    
  4. Re: Improve const use in zlib-using code

    Tristan Partin <tristan@neon.tech> — 2023-08-03T14:30:10Z

    Both patches look good to me.
    
    -- 
    Tristan Partin
    Neon (https://neon.tech)
    
    
    
    
  5. Re: Improve const use in zlib-using code

    Peter Eisentraut <peter@eisentraut.org> — 2023-08-07T07:42:04Z

    On 03.08.23 16:30, Tristan Partin wrote:
    > Both patches look good to me.
    
    committed, thanks