diff --git a/ChangeLog b/ChangeLog index 5783d4350..9954def25 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,21 @@ +2013-12-20 Werner Lemberg + + [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 [autofit] Introduce `styles'. diff --git a/src/autofit/afcjk.c b/src/autofit/afcjk.c index 38d83af50..4cc01b6e1 100644 --- 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]; diff --git a/src/autofit/afglobal.c b/src/autofit/afglobal.c index d19ce8884..1b4721c08 100644 --- 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 @@ -44,17 +67,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, @@ -69,18 +81,6 @@ }; -#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 #define STYLE( s, S, d, ws, sc, ss ) \ &af_ ## s ## _style_class, diff --git a/src/autofit/afglobal.h b/src/autofit/afglobal.h index c4fcc54d4..b0316e67e 100644 --- a/src/autofit/afglobal.h +++ b/src/autofit/afglobal.h @@ -31,6 +31,7 @@ FT_BEGIN_HEADER 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 ) diff --git a/src/autofit/aflatin.c b/src/autofit/aflatin.c index ae20f7b87..518ceeb5d 100644 --- 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]; diff --git a/src/autofit/afpic.c b/src/autofit/afpic.c index 2d66d76ca..1806895cd 100644 --- 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++] ); diff --git a/src/autofit/aftypes.h b/src/autofit/aftypes.h index b913ee174..70ddc7fff 100644 --- a/src/autofit/aftypes.h +++ b/src/autofit/aftypes.h @@ -513,13 +513,13 @@ extern void* _af_debug_hints; #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 @@ extern void* _af_debug_hints; #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 */