From c32019b64af395d3d0ff6b8763d14cd24b96142a Mon Sep 17 00:00:00 2001 From: Werner Lemberg Date: Thu, 28 May 2009 06:56:26 +0200 Subject: [PATCH] Make compilation work with FT_CONFIG_OPTION_USE_ZLIB not defined. Reported by Krzysztof Kowalczyk . * src/pcf/pcfdrivr.c (PCF_Face_Init) [!FT_CONFIG_OPTION_USE_ZLIB]: Make it work. Simplify #ifdef logic. --- ChangeLog | 9 +++++++ src/pcf/pcfdrivr.c | 66 ++++++++++++++++++++++++---------------------- 2 files changed, 43 insertions(+), 32 deletions(-) diff --git a/ChangeLog b/ChangeLog index 2776d70f2..1b9159ae3 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,12 @@ +2009-05-28 Werner Lemberg + + Make compilation work with FT_CONFIG_OPTION_USE_ZLIB not defined. + Reported by Krzysztof Kowalczyk . + + * src/pcf/pcfdrivr.c (PCF_Face_Init) [!FT_CONFIG_OPTION_USE_ZLIB]: + Make it work. + Simplify #ifdef logic. + 2009-05-22 Werner Lemberg Improve b/w rasterizer. diff --git a/src/pcf/pcfdrivr.c b/src/pcf/pcfdrivr.c index e2d4d3d87..245de8acf 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 ); - /* 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; +#if defined( FT_CONFIG_OPTION_USE_ZLIB ) || \ + defined( FT_CONFIG_OPTION_USE_LZW ) + +#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; + } +#endif /* FT_CONFIG_OPTION_USE_ZLIB */ - error = error2; - if ( error ) #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; - - face->gzip_source = stream; - pcfface->stream = &face->gzip_stream; - - stream = pcfface->stream; - - error = pcf_load_font( stream, face ); - if ( error ) - goto Fail; } -#else +#endif /* FT_CONFIG_OPTION_USE_LZW */ + + if ( error ) goto Fail; + + face->gzip_source = stream; + pcfface->stream = &face->gzip_stream; + + stream = pcfface->stream; + + error = pcf_load_font( stream, face ); + if ( error ) + goto Fail; + +#else /* !(FT_CONFIG_OPTION_USE_ZLIB || FT_CONFIG_OPTION_USE_LZW) */ + + goto Fail; + #endif - else - { - face->gzip_source = stream; - pcfface->stream = &face->gzip_stream; - - stream = pcfface->stream; - - error = pcf_load_font( stream, face ); - if ( error ) - goto Fail; - } } /* set up charmap */