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.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104
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 */