* Lesser General Public License for more details.
*
* You should have received a copy of the GNU Lesser General
- * Public License along with this library; if not, write to the
- * Free Software Foundation, Inc., 59 Temple Place, Suite 330,
- * Boston, MA 02111-1307, USA.
+ * Public License along with this library; if not, see <http://www.gnu.org/licenses/>.
*
* Author: Alexander Larsson <alexl@redhat.com>
*/
static void
g_zlib_decompressor_set_gzheader (GZlibDecompressor *decompressor)
{
+ /* On win32, these functions were not exported before 1.2.4 */
+#if !defined (G_OS_WIN32) || ZLIB_VERNUM >= 0x1240
if (decompressor->format != G_ZLIB_COMPRESSOR_FORMAT_GZIP)
return;
if (inflateGetHeader (&decompressor->zstream, &decompressor->header_data->gzheader) != Z_OK)
g_warning ("unexpected zlib error: %s\n", decompressor->zstream.msg);
+#endif /* !G_OS_WIN32 || ZLIB >= 1.2.4 */
}
G_DEFINE_TYPE_WITH_CODE (GZlibDecompressor, g_zlib_decompressor, G_TYPE_OBJECT,
}
else if (decompressor->format == G_ZLIB_COMPRESSOR_FORMAT_RAW)
{
- /* Negative for gzip */
+ /* Negative for raw */
res = inflateInit2 (&decompressor->zstream, -MAX_WBITS);
}
else /* ZLIB */
*bytes_read = inbuf_size - decompressor->zstream.avail_in;
*bytes_written = outbuf_size - decompressor->zstream.avail_out;
+#if !defined (G_OS_WIN32) || ZLIB_VERNUM >= 0x1240
if (decompressor->header_data != NULL &&
decompressor->header_data->gzheader.done == 1)
{
g_object_notify (G_OBJECT (decompressor), "file-info");
}
+#endif /* !G_OS_WIN32 || ZLIB >= 1.2.4 */
if (res == Z_STREAM_END)
return G_CONVERTER_FINISHED;