summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMark Adler <madler@alumni.caltech.edu>2012-03-18 09:29:44 -0700
committerMark Adler <madler@alumni.caltech.edu>2012-03-18 09:29:44 -0700
commit8e16df2c3f0dbe0f8a819e1913562073cf721636 (patch)
tree1c91e0b2ccc16ad31c941f5ecfd063776a1bf30d
parenta1af6e96e35dfc3adfa2acba01883c14115f1090 (diff)
downloadProject-Tick-8e16df2c3f0dbe0f8a819e1913562073cf721636.tar.gz
Project-Tick-8e16df2c3f0dbe0f8a819e1913562073cf721636.zip
More fixes for gzopen_w().
Also need to #include <stddef.h> for zlib.h, and need to workaround the inability to use wide characters in constructed error messages with zlib's interface.
-rw-r--r--gzlib.c5
-rw-r--r--zconf.h4
-rw-r--r--zconf.h.cmakein4
-rw-r--r--zconf.h.in4
4 files changed, 15 insertions, 2 deletions
diff --git a/gzlib.c b/gzlib.c
index b99c26c7b5..e31533b749 100644
--- a/gzlib.c
+++ b/gzlib.c
@@ -185,12 +185,13 @@ local gzFile gz_open(path, fd, mode)
}
/* save the path name for error messages */
- state->path = malloc(strlen(path) + 1);
+# define WPATH "<widepath>"
+ state->path = malloc(strlen(fd == -2 ? WPATH : (path) + 1);
if (state->path == NULL) {
free(state);
return NULL;
}
- strcpy(state->path, path);
+ strcpy(state->path, fd == -2 ? WPATH : path);
/* compute the flags for open() */
oflag =
diff --git a/zconf.h b/zconf.h
index f9a5fa7d67..8c6f945e38 100644
--- a/zconf.h
+++ b/zconf.h
@@ -402,6 +402,10 @@ typedef uLong FAR uLongf;
# endif
#endif
+#ifdef _WIN32
+# include <stddef.h> /* for wchar_t */
+#endif
+
/* a little trick to accommodate both "#define _LARGEFILE64_SOURCE" and
* "#define _LARGEFILE64_SOURCE 1" as requesting 64-bit operations, (even
* though the former does not conform to the LFS document), but considering
diff --git a/zconf.h.cmakein b/zconf.h.cmakein
index 66368adf9d..4ade48745f 100644
--- a/zconf.h.cmakein
+++ b/zconf.h.cmakein
@@ -404,6 +404,10 @@ typedef uLong FAR uLongf;
# endif
#endif
+#ifdef _WIN32
+# include <stddef.h> /* for wchar_t */
+#endif
+
/* a little trick to accommodate both "#define _LARGEFILE64_SOURCE" and
* "#define _LARGEFILE64_SOURCE 1" as requesting 64-bit operations, (even
* though the former does not conform to the LFS document), but considering
diff --git a/zconf.h.in b/zconf.h.in
index f9a5fa7d67..8c6f945e38 100644
--- a/zconf.h.in
+++ b/zconf.h.in
@@ -402,6 +402,10 @@ typedef uLong FAR uLongf;
# endif
#endif
+#ifdef _WIN32
+# include <stddef.h> /* for wchar_t */
+#endif
+
/* a little trick to accommodate both "#define _LARGEFILE64_SOURCE" and
* "#define _LARGEFILE64_SOURCE 1" as requesting 64-bit operations, (even
* though the former does not conform to the LFS document), but considering