Skip to content

Commit 260c8f5

Browse files
author
Tor Didriksen
committed
Bug#36664672 Build break on Fedora 40 with debug and system libs
Use MY_Z_NULL in our own source code, to avoid macro redefinition: In file included from <...>/mysql/storage/archive/ha_archive.h:32, from <...>/mysql/storage/archive/ha_archive.cc:26: <...>/mysql/storage/archive/azlib.h:198:9: error: "Z_NULL" redefined [-Werror] 198 | #define Z_NULL 0 /* for initializing zalloc, zfree, opaque */ | ^~~~~~ In file included from <...>/mysql/storage/archive/ha_archive.h:25: /usr/include/zlib.h:223:9: note: this is the location of the previous definition 223 | #define Z_NULL NULL /* for compatibility with zlib, was for initializing zalloc, zfree, opaque */ | ^~~~~~ Change-Id: Ie333897dea2a8f29a07b3e8e90441396c19ed8f2
1 parent be04be8 commit 260c8f5

File tree

2 files changed

+4
-4
lines changed

2 files changed

+4
-4
lines changed

storage/archive/azio.cc

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -95,7 +95,7 @@ int az_open(azio_stream *s, const char *path, int Flags, File fd) {
9595
s->stream.next_out = s->outbuf;
9696
if (err != Z_OK) {
9797
destroy(s);
98-
return Z_NULL;
98+
return MY_Z_NULL;
9999
}
100100
} else {
101101
s->stream.next_in = s->inbuf;
@@ -109,7 +109,7 @@ int az_open(azio_stream *s, const char *path, int Flags, File fd) {
109109
*/
110110
if (err != Z_OK) {
111111
destroy(s);
112-
return Z_NULL;
112+
return MY_Z_NULL;
113113
}
114114
}
115115
s->stream.avail_out = AZ_BUFSIZE_WRITE;
@@ -127,7 +127,7 @@ int az_open(azio_stream *s, const char *path, int Flags, File fd) {
127127

128128
if (s->file < 0) {
129129
destroy(s);
130-
return Z_NULL;
130+
return MY_Z_NULL;
131131
}
132132

133133
if (Flags & O_CREAT || Flags & O_TRUNC) {

storage/archive/azlib.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -195,7 +195,7 @@ extern "C" {
195195
#define Z_DEFLATED 8
196196
/* The deflate compression method (the only one supported in this version) */
197197

198-
#define Z_NULL 0 /* for initializing zalloc, zfree, opaque */
198+
#define MY_Z_NULL 0 /* for initializing zalloc, zfree, opaque */
199199
#define AZ_BUFSIZE_READ 32768
200200
#define AZ_BUFSIZE_WRITE 16384
201201

0 commit comments

Comments
 (0)