[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.
This commit is contained in:
Werner Lemberg 2013-12-20 18:35:35 +01:00
parent 974b193bcc
commit 8a8f3758f1
7 changed files with 62 additions and 34 deletions

View File

@ -1,3 +1,21 @@
2013-12-20 Werner Lemberg <wl@gnu.org>
[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 <wl@gnu.org>
[autofit] Introduce `styles'.

View File

@ -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];

View File

@ -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,

View File

@ -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 )

View File

@ -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];

View File

@ -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++] );

View File

@ -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 */