shithub: freetype+ttf2subf

Download patch

ref: 8a8f3758f1d1ed83c66aee2b3b20491ca71bd7ad
parent: 974b193bcc6f9ca10097a646fdea7d26cd95c830
author: Werner Lemberg <[email protected]>
date: Fri Dec 20 13:35:35 EST 2013

[autofit] Fix PIC compilation.

* src/autofit/afcjk.c (af_cjk_metrics_init_widths),
src/autofit/aflatin.c (af_latin_metrics_init_widths)
[FT_CONFIG_OPTION_PIC]: Declare `globals'.

* src/autofit/afglobal.c: Always call AF_DEFINE_SCRIPT_CLASS, and
AF_DEFINE_STYLE_CLASS.

* src/autofit/afpic.c: Include `afglobal.h'.
(autofit_module_class_pic_init): Typo.

* src/autofit/aftypes.h (AF_DEFINE_SCRIPT_CLASS,
AF_DEFINE_STYLE_CLASS): Don't use the same identifier for macro
parameter and structure member.

git/fs: mount .git/fs: mount/attach disallowed
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,5 +1,23 @@
 2013-12-20  Werner Lemberg  <[email protected]>
 
+	[autofit] Fix PIC compilation.
+
+	* src/autofit/afcjk.c (af_cjk_metrics_init_widths),
+	src/autofit/aflatin.c (af_latin_metrics_init_widths)
+	[FT_CONFIG_OPTION_PIC]: Declare `globals'.
+
+	* src/autofit/afglobal.c: Always call AF_DEFINE_SCRIPT_CLASS, and
+	AF_DEFINE_STYLE_CLASS.
+
+	* src/autofit/afpic.c: Include `afglobal.h'.
+	(autofit_module_class_pic_init): Typo.
+
+	* src/autofit/aftypes.h (AF_DEFINE_SCRIPT_CLASS,
+	AF_DEFINE_STYLE_CLASS): Don't use the same identifier for macro
+	parameter and structure member.
+
+2013-12-20  Werner Lemberg  <[email protected]>
+
 	[autofit] Introduce `styles'.
 
 	This is the new top-level structure for handling glyph input data;
--- a/src/autofit/afcjk.c
+++ b/src/autofit/afcjk.c
@@ -92,6 +92,10 @@
       AF_CJKMetricsRec  dummy[1];
       AF_Scaler         scaler = &dummy->root.scaler;
 
+#ifdef FT_CONFIG_OPTION_PIC
+      AF_FaceGlobals  globals = metrics->root.globals;
+#endif
+
       AF_StyleClass   style_class  = metrics->root.style_class;
       AF_ScriptClass  script_class = AF_SCRIPT_CLASSES_GET
                                        [style_class->script];
--- a/src/autofit/afglobal.c
+++ b/src/autofit/afglobal.c
@@ -28,6 +28,29 @@
 #include "afpic.h"
 
 
+#undef  SCRIPT
+#define SCRIPT( s, S, d, dc )          \
+          AF_DEFINE_SCRIPT_CLASS(      \
+            af_ ## s ## _script_class, \
+            AF_SCRIPT_ ## S,           \
+            af_ ## s ## _uniranges,    \
+            dc )
+
+#include "afscript.h"
+
+
+#undef  STYLE
+#define STYLE( s, S, d, ws, sc, ss )  \
+          AF_DEFINE_STYLE_CLASS(      \
+            af_ ## s ## _style_class, \
+            AF_STYLE_ ## S,           \
+            ws,                       \
+            sc,                       \
+            ss )
+
+#include "afstyles.h"
+
+
 #ifndef FT_CONFIG_OPTION_PIC
 
 #undef  WRITING_SYSTEM
@@ -45,17 +68,6 @@
 
 
 #undef  SCRIPT
-#define SCRIPT( s, S, d, dc )          \
-          AF_DEFINE_SCRIPT_CLASS(      \
-            af_ ## s ## _script_class, \
-            AF_SCRIPT_ ## S,           \
-            af_ ## s ## _uniranges,    \
-            dc )
-
-#include "afscript.h"
-
-
-#undef  SCRIPT
 #define SCRIPT( s, S, d, dc )         \
           &af_ ## s ## _script_class,
 
@@ -67,18 +79,6 @@
 
     NULL  /* do not remove */
   };
-
-
-#undef  STYLE
-#define STYLE( s, S, d, ws, sc, ss )  \
-          AF_DEFINE_STYLE_CLASS(      \
-            af_ ## s ## _style_class, \
-            AF_STYLE_ ## S,           \
-            ws,                       \
-            sc,                       \
-            ss )
-
-#include "afstyles.h"
 
 
 #undef  STYLE
--- a/src/autofit/afglobal.h
+++ b/src/autofit/afglobal.h
@@ -31,6 +31,7 @@
   FT_LOCAL_ARRAY( AF_WritingSystemClass )
   af_writing_system_classes[];
 
+
 #undef  SCRIPT
 #define SCRIPT( s, S, d, dc )                                  \
           AF_DECLARE_SCRIPT_CLASS( af_ ## s ## _script_class )
--- a/src/autofit/aflatin.c
+++ b/src/autofit/aflatin.c
@@ -79,6 +79,10 @@
       AF_LatinMetricsRec  dummy[1];
       AF_Scaler           scaler = &dummy->root.scaler;
 
+#ifdef FT_CONFIG_OPTION_PIC
+      AF_FaceGlobals  globals = metrics->root.globals;
+#endif
+
       AF_StyleClass   style_class  = metrics->root.style_class;
       AF_ScriptClass  script_class = AF_SCRIPT_CLASSES_GET
                                        [style_class->script];
--- a/src/autofit/afpic.c
+++ b/src/autofit/afpic.c
@@ -20,6 +20,7 @@
 #include FT_FREETYPE_H
 #include FT_INTERNAL_OBJECTS_H
 #include "afpic.h"
+#include "afglobal.h"
 #include "aferrors.h"
 
 
@@ -129,7 +130,7 @@
 #include "afscript.h"
 
 #undef  STYLE
-#define STYLE( s, S, d, ws, sc, ss )                \
+#define STYLE( s, S, d, ws, sc, bss )               \
         FT_Init_Class_af_ ## s ## _style_class(     \
           &container->af_style_classes_rec[ss++] );
 
--- a/src/autofit/aftypes.h
+++ b/src/autofit/aftypes.h
@@ -513,13 +513,13 @@
 
 #define AF_DEFINE_SCRIPT_CLASS(                            \
           script_class,                                    \
-          script,                                          \
+          script_,                                         \
           ranges,                                          \
           std_char )                                       \
   FT_LOCAL_DEF( void )                                     \
   FT_Init_Class_ ## script_class( AF_ScriptClassRec*  ac ) \
   {                                                        \
-    ac->script            = script;                        \
+    ac->script            = script_;                       \
     ac->script_uni_ranges = ranges;                        \
     ac->standard_char     = std_char;                      \
   }
@@ -531,17 +531,17 @@
 
 #define AF_DEFINE_STYLE_CLASS(                           \
           style_class,                                   \
-          style,                                         \
-          writing_system,                                \
-          script,                                        \
-          blue_stringset )                               \
+          style_,                                        \
+          writing_system_,                               \
+          script_,                                       \
+          blue_stringset_ )                              \
   FT_LOCAL_DEF( void )                                   \
   FT_Init_Class_ ## style_class( AF_StyleClassRec*  ac ) \
   {                                                      \
-    ac->style          = style;                          \
-    ac->writing_system = writing_system;                 \
-    ac->script         = script;                         \
-    ac->blue_stringset = blue_stringset;                 \
+    ac->style          = style_;                         \
+    ac->writing_system = writing_system_;                \
+    ac->script         = script_;                        \
+    ac->blue_stringset = blue_stringset_;                \
   }
 
 #endif /* FT_CONFIG_OPTION_PIC */