summaryrefslogtreecommitdiff
path: root/src/psnames/psmodule.c
diff options
context:
space:
mode:
authorsuzuki toshiya <mpsuzuki@hiroshima-u.ac.jp>2012-01-14 06:40:03 +0900
committersuzuki toshiya <mpsuzuki@hiroshima-u.ac.jp>2012-01-14 06:40:03 +0900
commit226f3619750ff34ca698304f1d009d0abdcf720e (patch)
tree82f98cdd89ce36b79e48c2299949ea529d47d024 /src/psnames/psmodule.c
parent4b733517d77856d192c5929dbbff449b813dc23a (diff)
downloadfreetype2-226f3619750ff34ca698304f1d009d0abdcf720e.tar.gz
Fix PIC build broken by d9145241fe378104ba4c12a42534549faacc92e6.
Under PIC configuration, FT_{CFF,PSCMAPS,SFNT,TT}_SERVICES_GET take no arguments but derefer the variable named `library' internally. * src/cff/cffdrivr.c (cff_get_interface): Declare `library' and set it if non-NULL driver is passed. * src/truetype/ttdriver.c (tt_get_interface): Ditto. * src/sfnt/sfdriver.c (sfnt_get_interface): Declare `library' under PIC configuration, and set it if non-NULL module is given. * src/psnames/psmodule.c (psnames_get_interface): Ditto.
Diffstat (limited to 'src/psnames/psmodule.c')
-rw-r--r--src/psnames/psmodule.c12
1 files changed, 12 insertions, 0 deletions
diff --git a/src/psnames/psmodule.c b/src/psnames/psmodule.c
index 752869693..2577382ec 100644
--- a/src/psnames/psmodule.c
+++ b/src/psnames/psmodule.c
@@ -563,7 +563,19 @@
psnames_get_service( FT_Module module,
const char* service_id )
{
+ /* FT_PSCMAPS_SERVICES_GET derefers `library' in PIC mode */
+#ifdef FT_CONFIG_OPTION_PIC
+ FT_Library library;
+
+
+ if ( !module )
+ return NULL;
+ library = module->library;
+ if ( !library )
+ return NULL;
+#else
FT_UNUSED( module );
+#endif
return ft_service_list_lookup( FT_PSCMAPS_SERVICES_GET, service_id );
}