Commit c32019b64af395d3d0ff6b8763d14cd24b96142a

Werner Lemberg 2009-05-28T06:56:26

Make compilation work with FT_CONFIG_OPTION_USE_ZLIB not defined. Reported by Krzysztof Kowalczyk <kkowalczyk@gmail.com>. * src/pcf/pcfdrivr.c (PCF_Face_Init) [!FT_CONFIG_OPTION_USE_ZLIB]: Make it work. Simplify #ifdef logic.

diff --git a/ChangeLog b/ChangeLog
index 2776d70..1b9159a 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,12 @@
+2009-05-28  Werner Lemberg  <wl@gnu.org>
+
+	Make compilation work with FT_CONFIG_OPTION_USE_ZLIB not defined.
+	Reported by Krzysztof Kowalczyk <kkowalczyk@gmail.com>.
+
+	* src/pcf/pcfdrivr.c (PCF_Face_Init) [!FT_CONFIG_OPTION_USE_ZLIB]:
+	Make it work.
+	Simplify #ifdef logic.
+
 2009-05-22  Werner Lemberg  <wl@gnu.org>
 
 	Improve b/w rasterizer.
diff --git a/src/pcf/pcfdrivr.c b/src/pcf/pcfdrivr.c
index e2d4d3d..245de8a 100644
--- a/src/pcf/pcfdrivr.c
+++ b/src/pcf/pcfdrivr.c
@@ -266,19 +266,27 @@ THE SOFTWARE.
     error = pcf_load_font( stream, face );
     if ( error )
     {
-      FT_Error  error2;
+      PCF_Face_Done( pcfface );
 
+#if defined( FT_CONFIG_OPTION_USE_ZLIB ) || \
+    defined( FT_CONFIG_OPTION_USE_LZW )
 
-      PCF_Face_Done( pcfface );
+#ifdef FT_CONFIG_OPTION_USE_ZLIB
+      {
+        FT_Error  error2;
 
-      /* this didn't work, try gzip support! */
-      error2 = FT_Stream_OpenGzip( &face->gzip_stream, stream );
-      if ( FT_ERROR_BASE( error2 ) == FT_Err_Unimplemented_Feature )
-        goto Fail;
 
-      error = error2;
-      if ( error )
+        /* this didn't work, try gzip support! */
+        error2 = FT_Stream_OpenGzip( &face->gzip_stream, stream );
+        if ( FT_ERROR_BASE( error2 ) == FT_Err_Unimplemented_Feature )
+          goto Fail;
+
+        error = error2;
+      }
+#endif /* FT_CONFIG_OPTION_USE_ZLIB */
+
 #ifdef FT_CONFIG_OPTION_USE_LZW
+      if ( error )
       {
         FT_Error  error3;
 
@@ -289,32 +297,26 @@ THE SOFTWARE.
           goto Fail;
 
         error = error3;
-        if ( error )
-          goto Fail;
+      }
+#endif /* FT_CONFIG_OPTION_USE_LZW */
 
-        face->gzip_source = stream;
-        pcfface->stream   = &face->gzip_stream;
+      if ( error )
+        goto Fail;
 
-        stream = pcfface->stream;
+      face->gzip_source = stream;
+      pcfface->stream   = &face->gzip_stream;
 
-        error = pcf_load_font( stream, face );
-        if ( error )
-          goto Fail;
-      }
-#else
+      stream = pcfface->stream;
+
+      error = pcf_load_font( stream, face );
+      if ( error )
         goto Fail;
-#endif
-      else
-      {
-        face->gzip_source = stream;
-        pcfface->stream   = &face->gzip_stream;
 
-        stream = pcfface->stream;
+#else /* !(FT_CONFIG_OPTION_USE_ZLIB || FT_CONFIG_OPTION_USE_LZW) */
 
-        error = pcf_load_font( stream, face );
-        if ( error )
-          goto Fail;
-      }
+      goto Fail;
+
+#endif
     }
 
     /* set up charmap */