Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add public compile definition for zlib-ng API #1292

Merged
merged 1 commit into from
Jun 17, 2022

Conversation

nmoinvaz
Copy link
Member

@nmoinvaz nmoinvaz commented Jun 12, 2022

This is so that other projects that use CMake and link against the zlib project can easily determine whether or not to include "zlib-ng.h" or "zlib.h". They would do this in order to support zlib compatibility.I am open to the different naming.

Any consumer project that uses target_link_libraries(${PROJECT_NAME} zlibstatic) (zlib or zlibstatic) can use:

#ifdef ZLIBNG_NATIVE_API
#  include "zlib-ng.h"
#  define ZLIB_PREFIX(x) zng_ ## x
   typedef zng_stream zlib_stream;
#else
#  include "zlib.h"
#  define ZLIB_PREFIX(x) x
   typedef z_stream zlib_stream;
#endif

They would do this in order to also support zlib compatibility. https://github.com/zlib-ng/minizip-ng/blob/47b8449fec2c7a575a506ecbe6399ad0603b5992/mz_strm_zlib.c#L16

@codecov
Copy link

codecov bot commented Jun 12, 2022

Codecov Report

Merging #1292 (289a2b1) into develop (413bbfa) will increase coverage by 0.00%.
The diff coverage is n/a.

@@           Coverage Diff            @@
##           develop    #1292   +/-   ##
========================================
  Coverage    86.57%   86.58%           
========================================
  Files          124      124           
  Lines        10533    10537    +4     
  Branches      2622     2624    +2     
========================================
+ Hits          9119     9123    +4     
+ Misses        1059     1058    -1     
- Partials       355      356    +1     
Flag Coverage Δ
macos_clang 33.33% <ø> (ø)
macos_gcc 73.80% <ø> (-0.02%) ⬇️
ubuntu_clang 85.26% <ø> (-0.16%) ⬇️
ubuntu_clang_debug 85.04% <ø> (-0.02%) ⬇️
ubuntu_clang_inflate_allow_invalid_dist 85.11% <ø> (-0.03%) ⬇️
ubuntu_clang_inflate_strict 85.35% <ø> (-0.03%) ⬇️
ubuntu_clang_mmap 85.54% <ø> (-0.03%) ⬇️
ubuntu_clang_pigz 40.21% <ø> (-0.04%) ⬇️
ubuntu_clang_pigz_no_optim 41.66% <ø> (-0.05%) ⬇️
ubuntu_clang_pigz_no_threads 39.80% <ø> (-0.04%) ⬇️
ubuntu_clang_reduced_mem 85.65% <ø> (-0.16%) ⬇️
ubuntu_gcc 75.65% <ø> (-0.02%) ⬇️
ubuntu_gcc_aarch64 77.50% <ø> (-0.03%) ⬇️
ubuntu_gcc_aarch64_compat_no_opt 75.62% <ø> (-0.03%) ⬇️
ubuntu_gcc_aarch64_no_acle 76.30% <ø> (-0.03%) ⬇️
ubuntu_gcc_aarch64_no_neon 76.20% <ø> (-0.03%) ⬇️
ubuntu_gcc_armhf 77.52% <ø> (-0.03%) ⬇️
ubuntu_gcc_armhf_compat_no_opt 75.60% <ø> (-0.03%) ⬇️
ubuntu_gcc_armhf_no_acle 77.52% <ø> (-0.03%) ⬇️
ubuntu_gcc_armhf_no_neon 77.30% <ø> (-0.03%) ⬇️
ubuntu_gcc_armsf 77.17% <ø> (-0.03%) ⬇️
ubuntu_gcc_armsf_compat_no_opt 75.27% <ø> (-0.03%) ⬇️
ubuntu_gcc_benchmark 73.86% <ø> (-0.22%) ⬇️
ubuntu_gcc_compat_no_opt 76.83% <ø> (-0.03%) ⬇️
ubuntu_gcc_compat_sprefix 73.98% <ø> (-0.18%) ⬇️
ubuntu_gcc_m32 73.60% <ø> (-0.02%) ⬇️
ubuntu_gcc_mingw_i686 0.00% <ø> (ø)
ubuntu_gcc_mingw_x86_64 0.00% <ø> (ø)
ubuntu_gcc_no_avx2 74.80% <ø> (-0.02%) ⬇️
ubuntu_gcc_no_ctz 74.86% <ø> (-0.03%) ⬇️
ubuntu_gcc_no_ctzll 74.89% <ø> (-0.03%) ⬇️
ubuntu_gcc_no_pclmulqdq 74.06% <ø> (-0.02%) ⬇️
ubuntu_gcc_no_sse2 75.01% <ø> (+0.03%) ⬆️
ubuntu_gcc_no_sse4 74.70% <ø> (+0.03%) ⬆️
ubuntu_gcc_o1 74.33% <ø> (-0.07%) ⬇️
ubuntu_gcc_osb ∅ <ø> (∅)
ubuntu_gcc_pigz 38.14% <ø> (+0.03%) ⬆️
ubuntu_gcc_pigz_aarch64 39.22% <ø> (-0.06%) ⬇️
ubuntu_gcc_ppc 73.66% <ø> (-0.03%) ⬇️
ubuntu_gcc_ppc64 74.43% <ø> (-0.03%) ⬇️
ubuntu_gcc_ppc64le 74.41% <ø> (-0.03%) ⬇️
ubuntu_gcc_ppc_no_power8 74.61% <ø> (-0.03%) ⬇️
ubuntu_gcc_s390x 74.82% <ø> (-0.03%) ⬇️
ubuntu_gcc_s390x_dfltcc 72.21% <ø> (-0.03%) ⬇️
ubuntu_gcc_s390x_dfltcc_compat 73.75% <ø> (-0.02%) ⬇️
ubuntu_gcc_s390x_no_crc32 74.60% <ø> (-0.03%) ⬇️
ubuntu_gcc_sparc64 74.71% <ø> (-0.03%) ⬇️
ubuntu_gcc_sprefix 73.64% <ø> (-0.17%) ⬇️
win64_gcc 73.84% <ø> (-0.03%) ⬇️
win64_gcc_compat_no_opt 74.35% <ø> (-0.03%) ⬇️

Flags with carried forward coverage won't be shown. Click here to find out more.

Impacted Files Coverage Δ
inflate.c 93.58% <0.00%> (-0.10%) ⬇️
deflate.c 83.20% <0.00%> (-0.09%) ⬇️
gzlib.c 71.10% <0.00%> (ø)
arch/arm/chunkset_neon.c 100.00% <0.00%> (ø)
arch/power/chunkset_power8.c 100.00% <0.00%> (ø)
arch/x86/adler32_sse42.c 100.00% <0.00%> (+1.53%) ⬆️
adler32_p.h 100.00% <0.00%> (+3.57%) ⬆️

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update 413bbfa...289a2b1. Read the comment docs.

@nmoinvaz
Copy link
Member Author

@Dead2 any thoughts on the #define naming?

@Dead2
Copy link
Member

Dead2 commented Jun 15, 2022

ZLIBNG_MODERN_API or ZLIBNG_NATIVE_API would work.

…that use CMake and link against the zlib project can easily determine whether or not to include "zlib-ng.h" or "zlib.h".
@nmoinvaz nmoinvaz force-pushed the improvements/modern-api-public-def branch from 5268063 to 289a2b1 Compare June 16, 2022 15:47
@nmoinvaz
Copy link
Member Author

nmoinvaz commented Jun 16, 2022

I perfer ZLIBNG_NATIVE_API so I have changed it.

@Dead2 Dead2 merged commit 54ea239 into zlib-ng:develop Jun 17, 2022
@Dead2 Dead2 mentioned this pull request Dec 27, 2022
Dead2 added a commit that referenced this pull request Mar 7, 2023
Changes since 2.0.6:
- Fix CVE-2022-37434 #1328
- Fix chunkmemset #1196
- Fix deflateBound too small #1236
- Fix Z_SOLO #1263
- Fix ACLE variant of crc32 #1274
- Fix inflateBack #1311
- Fix deflate_quick windowsize #1431
- Fix DFLTCC bugs related to adler32 #1349 and #1390
- Fix warnings #1194 #1312 #1362
- MacOS build fix #1198
- Add invalid windowBits handling #1293
- Support for Force TZCNT #1186
- Support for aligned_alloc() #1360
- Minideflate improvements #1175 #1238
- Dont use unaligned access for memcpy #1309
- Build system #1209 #1233 #1267 #1273 #1278 #1292 #1316 #1318 #1365
- Test improvements #1208 #1227 #1241 #1353
- Cleanup #1266
- Documentation #1205 #1359
- Misc improvements #1294 #1297 #1306 #1344 #1348
- Backported zlib fixes
- Backported CI workflows from Develop branch
Dead2 added a commit that referenced this pull request Mar 17, 2023
Changes since 2.0.6:
- Fix CVE-2022-37434 #1328
- Fix chunkmemset #1196
- Fix deflateBound too small #1236
- Fix Z_SOLO #1263
- Fix ACLE variant of crc32 #1274
- Fix inflateBack #1311
- Fix deflate_quick windowsize #1431
- Fix DFLTCC bugs related to adler32 #1349 and #1390
- Fix warnings #1194 #1312 #1362
- MacOS build fix #1198
- Add invalid windowBits handling #1293
- Support for Force TZCNT #1186
- Support for aligned_alloc() #1360
- Minideflate improvements #1175 #1238
- Dont use unaligned access for memcpy #1309
- Build system #1209 #1233 #1267 #1273 #1278 #1292 #1316 #1318 #1365
- Test improvements #1208 #1227 #1241 #1353
- Cleanup #1266
- Documentation #1205 #1359
- Misc improvements #1294 #1297 #1306 #1344 #1348
- Backported zlib fixes
- Backported CI workflows from Develop branch
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants