mirror of
https://github.com/fltk/fltk.git
synced 2026-05-29 20:45:33 +08:00
Fix name clash with zlib gzopen on (64-bit) Linux.
Compilation error message:
src/Fl_SVG_Image.cxx:80:21: error: out-of-line definition of 'gzopen64' does
not match any declaration in 'Fl_SVG_Image'; did you mean 'gzopen'?
void* Fl_SVG_Image::gzopen(const char *fname) {
^~~~~~
gzopen
/usr/include/zlib.h:1709:20: note: expanded from macro 'gzopen'
# define gzopen gzopen64
^
The culprit was the macro defined in zlib.h (above).
git-svn-id: file:///fltk/svn/fltk/branches/branch-1.4@12479 ea41ed52-d2ee-0310-a9c1-e6b18d33e121
This commit is contained in:
+1
-1
@@ -74,7 +74,7 @@ public:
|
|||||||
virtual void color_average(Fl_Color c, float i);
|
virtual void color_average(Fl_Color c, float i);
|
||||||
virtual void draw(int X, int Y, int W, int H, int cx = 0, int cy = 0);
|
virtual void draw(int X, int Y, int W, int H, int cx = 0, int cy = 0);
|
||||||
void draw(int X, int Y) { draw(X, Y, w(), h(), 0, 0); }
|
void draw(int X, int Y) { draw(X, Y, w(), h(), 0, 0); }
|
||||||
static void* gzopen(const char *fname);
|
static void* fl_gzopen(const char *fname);
|
||||||
};
|
};
|
||||||
|
|
||||||
#endif // FL_SVG_IMAGE_H
|
#endif // FL_SVG_IMAGE_H
|
||||||
|
|||||||
@@ -77,7 +77,7 @@ float Fl_SVG_Image::svg_scaling_(int W, int H) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
/** Opens for reading a potentially gzip'ed file identified by a UTF-8 encoded filename. */
|
/** Opens for reading a potentially gzip'ed file identified by a UTF-8 encoded filename. */
|
||||||
void* Fl_SVG_Image::gzopen(const char *fname) {
|
void* Fl_SVG_Image::fl_gzopen(const char *fname) {
|
||||||
#if defined(HAVE_LIBZ)
|
#if defined(HAVE_LIBZ)
|
||||||
# ifdef _WIN32
|
# ifdef _WIN32
|
||||||
unsigned wl = fl_utf8towc(fname, strlen(fname), NULL, 0) + 1;
|
unsigned wl = fl_utf8towc(fname, strlen(fname), NULL, 0) + 1;
|
||||||
@@ -102,7 +102,7 @@ static char *svg_inflate(const char *fname) {
|
|||||||
struct stat b;
|
struct stat b;
|
||||||
fl_stat(fname, &b);
|
fl_stat(fname, &b);
|
||||||
long size = b.st_size;
|
long size = b.st_size;
|
||||||
gzFile gzf = (gzFile)Fl_SVG_Image::gzopen(fname);
|
gzFile gzf = (gzFile)Fl_SVG_Image::fl_gzopen(fname);
|
||||||
if (!gzf) return NULL;
|
if (!gzf) return NULL;
|
||||||
int l;
|
int l;
|
||||||
bool direct = gzdirect(gzf);
|
bool direct = gzdirect(gzf);
|
||||||
|
|||||||
@@ -94,7 +94,7 @@ fl_check_images(const char *name, // I - Filename
|
|||||||
#ifdef FLTK_USE_NANOSVG
|
#ifdef FLTK_USE_NANOSVG
|
||||||
# if defined(HAVE_LIBZ)
|
# if defined(HAVE_LIBZ)
|
||||||
if (header[0] == 0x1f && header[1] == 0x8b) { // denotes gzip'ed data
|
if (header[0] == 0x1f && header[1] == 0x8b) { // denotes gzip'ed data
|
||||||
gzFile gzf = (gzFile)Fl_SVG_Image::gzopen(name);
|
gzFile gzf = (gzFile)Fl_SVG_Image::fl_gzopen(name);
|
||||||
if (gzf) {
|
if (gzf) {
|
||||||
gzread(gzf, header, headerlen);
|
gzread(gzf, header, headerlen);
|
||||||
gzclose(gzf);
|
gzclose(gzf);
|
||||||
|
|||||||
Reference in New Issue
Block a user