Freetype portability fix for older versions - improved

Rein Klazes rklazes at xs4all.nl
Sun Oct 17 10:27:13 CDT 2004


On 15 Sep 2004 11:17:10 -0400, you wrote:

> Tested on both freetype 2.1.2 and freetype 2.1.4.
> 
> Changelog:
> Use the preferred FT_ENCODING values rather than ft_encoding.
> 

> +#ifndef FT_ENCODING_NONE
> +#define FT_ENCODING_NONE ft_encoding_none
> +#endif
> +#ifndef FT_ENCODING_MS_SYMBOL
> +#define FT_ENCODING_MS_SYMBOL ft_encoding_symbol
> +#endif
> +#ifndef FT_ENCODING_UNICODE
> +#define FT_ENCODING_UNICODE ft_encoding_unicode
> +#endif
> +#ifndef FT_ENCODING_APPLE_ROMAN
> +#define FT_ENCODING_APPLE_ROMAN ft_encoding_apple_roman
> +#endif

The patch works, but is not quite correct and doing the opposite of what
you claim: the FT_ENCODING's are never defined but are enums. Therefore
"ifndef FT_ENCODING_XYZ" is always true and you always use the
depreciated ft_encodings.

On old freetype2:

  enum FT_Encoding { ft_encoding_xyz, ...

On Newer freetype2:

  enum FT_Encoding { FT_ENCODING_XYZ, ...

  #define ft_encoding_xyz FT_ENCODING_XYZ

So to use FT_ENCODING_XYZ in the code and still compile with older
freetype2's, we need to test:

#ifndef ft_encoding_xyz

Patch attached, tested to compile with freetype 2.0.9 and 2.1.7.

Changelog:
	dlls/gdi : freetype.c
	Test whether the ft_encoding's are defined, not the
	FT_ENCODING's.

Rein.
-- 
Rein Klazes
rklazes at xs4all.nl
-------------- next part --------------
--- wine/dlls/gdi/freetype.c	2004-09-17 12:07:14.000000000 +0200
+++ mywine/dlls/gdi/freetype.c	2004-10-17 17:04:51.000000000 +0200
@@ -139,16 +139,16 @@
 
 #undef MAKE_FUNCPTR
 
-#ifndef FT_ENCODING_NONE
+#ifndef ft_encoding_none
 #define FT_ENCODING_NONE ft_encoding_none
 #endif
-#ifndef FT_ENCODING_MS_SYMBOL
+#ifndef ft_encoding_ms_symbol
 #define FT_ENCODING_MS_SYMBOL ft_encoding_symbol
 #endif
-#ifndef FT_ENCODING_UNICODE
+#ifndef ft_encoding_unicode
 #define FT_ENCODING_UNICODE ft_encoding_unicode
 #endif
-#ifndef FT_ENCODING_APPLE_ROMAN
+#ifndef ft_encoding_apple_roman
 #define FT_ENCODING_APPLE_ROMAN ft_encoding_apple_roman
 #endif
 


More information about the wine-patches mailing list