@@ -50,27 +50,38 @@ impl Default for StreamWrapper {
50
50
reserved : 0 ,
51
51
opaque : ptr:: null_mut ( ) ,
52
52
state : ptr:: null_mut ( ) ,
53
- #[ cfg( all(
54
- feature = "any_zlib" ,
55
- not( any( feature = "cloudflare-zlib-sys" , feature = "libz-rs-sys" ) )
53
+
54
+ #[ cfg( any(
55
+ // zlib-ng
56
+ feature = "zlib-ng" ,
57
+ // libz-sys
58
+ all( not( feature = "cloudflare_zlib" ) , not( feature = "zlib-ng" ) , not( feature = "zlib-rs" ) )
56
59
) ) ]
57
60
zalloc : allocator:: zalloc,
58
- #[ cfg( all(
59
- feature = "any_zlib" ,
60
- not( any( feature = "cloudflare-zlib-sys" , feature = "libz-rs-sys" ) )
61
+ #[ cfg( any(
62
+ // zlib-ng
63
+ feature = "zlib-ng" ,
64
+ // libz-sys
65
+ all( not( feature = "cloudflare_zlib" ) , not( feature = "zlib-ng" ) , not( feature = "zlib-rs" ) )
61
66
) ) ]
62
67
zfree : allocator:: zfree,
63
68
64
- #[ cfg( all( feature = "any_zlib" , feature = "cloudflare-zlib-sys" ) ) ]
69
+ #[ cfg(
70
+ // cloudflare-zlib
71
+ all( feature = "cloudflare_zlib" , not( feature = "zlib-rs" ) , not( feature = "zlib-ng" ) ) ,
72
+ ) ]
65
73
zalloc : Some ( allocator:: zalloc) ,
66
- #[ cfg( all( feature = "any_zlib" , feature = "cloudflare-zlib-sys" ) ) ]
74
+ #[ cfg(
75
+ // cloudflare-zlib
76
+ all( feature = "cloudflare_zlib" , not( feature = "zlib-rs" ) , not( feature = "zlib-ng" ) ) ,
77
+ ) ]
67
78
zfree : Some ( allocator:: zfree) ,
68
79
69
80
// for zlib-rs, it is most efficient to have it provide the allocator.
70
81
// The libz-rs-sys dependency is configured to use the rust system allocator
71
- #[ cfg( all( feature = "any_zlib " , feature = "libz-rs-sys" ) ) ]
82
+ #[ cfg( all( feature = "zlib-rs " , not ( feature = "zlib-ng" ) ) ) ]
72
83
zalloc : None ,
73
- #[ cfg( all( feature = "any_zlib " , feature = "libz-rs-sys" ) ) ]
84
+ #[ cfg( all( feature = "zlib-rs " , not ( feature = "zlib-ng" ) ) ) ]
74
85
zfree : None ,
75
86
} ) ) ,
76
87
}
@@ -87,7 +98,14 @@ impl Drop for StreamWrapper {
87
98
}
88
99
}
89
100
90
- #[ cfg( all( feature = "any_zlib" , not( feature = "libz-rs-sys" ) ) ) ]
101
+ #[ cfg( any(
102
+ // zlib-ng
103
+ feature = "zlib-ng" ,
104
+ // cloudflare-zlib
105
+ all( feature = "cloudflare_zlib" , not( feature = "zlib-rs" ) , not( feature = "zlib-ng" ) ) ,
106
+ // libz-sys
107
+ all( not( feature = "cloudflare_zlib" ) , not( feature = "zlib-ng" ) , not( feature = "zlib-rs" ) ) ,
108
+ ) ) ]
91
109
mod allocator {
92
110
use super :: * ;
93
111
@@ -405,17 +423,19 @@ mod c_backend {
405
423
#[ cfg( feature = "zlib-ng" ) ]
406
424
use libz_ng_sys as libz;
407
425
408
- #[ cfg( all( not ( feature = "zlib-ng" ) , feature = "zlib-rs" ) ) ]
426
+ #[ cfg( all( feature = "zlib-rs" , not ( feature = "zlib-ng" ) ) ) ]
409
427
use libz_rs_sys as libz;
410
428
411
- #[ cfg( all( not( feature = "zlib-ng" ) , feature = "cloudflare_zlib" ) ) ]
429
+ #[ cfg(
430
+ // cloudflare-zlib
431
+ all( feature = "cloudflare_zlib" , not( feature = "zlib-rs" ) , not( feature = "zlib-ng" ) ) ,
432
+ ) ]
412
433
use cloudflare_zlib_sys as libz;
413
434
414
- #[ cfg( all(
415
- not( feature = "cloudflare_zlib" ) ,
416
- not( feature = "zlib-ng" ) ,
417
- not( feature = "zlib-rs" )
418
- ) ) ]
435
+ #[ cfg(
436
+ // libz-sys
437
+ all( not( feature = "cloudflare_zlib" ) , not( feature = "zlib-ng" ) , not( feature = "zlib-rs" ) ) ,
438
+ ) ]
419
439
use libz_sys as libz;
420
440
421
441
pub use libz:: deflate as mz_deflate;
0 commit comments