Fix building with zlib < 1.2.4 on win32

The gzip header processing functions were only exported
since 1.2.4 on win32, so #ifdef this code accordingly.

Bug #628505.
This commit is contained in:
Christian Persch
2010-09-01 15:05:59 +02:00
committed by Ryan Lortie
parent ed72dcdd45
commit db0eaa299c
2 changed files with 8 additions and 0 deletions

View File

@@ -72,6 +72,8 @@ struct _GZlibCompressor
static void
g_zlib_compressor_set_gzheader (GZlibCompressor *compressor)
{
/* On win32, these functions were not exported before 1.2.4 */
#if !defined (G_OS_WIN32) || ZLIB_VERNUM >= 0x1240
const gchar *filename;
if (compressor->format != G_ZLIB_COMPRESSOR_FORMAT_GZIP ||
@@ -91,6 +93,7 @@ g_zlib_compressor_set_gzheader (GZlibCompressor *compressor)
if (deflateSetHeader (&compressor->zstream, &compressor->gzheader) != Z_OK)
g_warning ("unexpected zlib error: %s\n", compressor->zstream.msg);
#endif /* !G_OS_WIN32 || ZLIB >= 1.2.4 */
}
G_DEFINE_TYPE_WITH_CODE (GZlibCompressor, g_zlib_compressor, G_TYPE_OBJECT,