FT_USE_MODULE declares things as: extern const FT_Module_Class (or similar for C++). However, the actual types of the variables being declared are often different, e.g., FT_Driver_ClassRec or FT_Renderer_Class. (Some are, indeed, FT_Module_Class.) This works with most C compilers (since those structs begin with an FT_Module_Class struct), but technically it's undefined behavior. To quote the ISO/IEC 9899:TC2 final committee draft, section 6.2.7 paragraph 2: All declarations that refer to the same object or function shall have compatible type; otherwise, the behavior is undefined. (And they are not compatible types.) Most C compilers don't reject (or even detect!) code which has this issue, but the GCC LTO development branch compiler does. (It outputs the types of the objects while generating .o files, along with a bunch of other information, then compares them when doing the final link-time code generation pass.) Patch from Savannah bug #25133. * src/base/ftinit.c (FT_USE_MODULE): Include variable type. * builds/amiga/include/freetype/config/ftmodule.h, include/freetype/config/ftmodule.h, */module.mk: Updated to declare pass correct types to FT_USE_MODULE.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 212 213 214 215 216 217 218 219 220 221 222 223 224 225 226 227 228 229 230 231 232 233 234 235 236 237 238 239 240 241 242 243 244 245 246 247 248 249 250 251 252 253 254 255 256 257 258 259 260 261 262 263 264 265 266 267 268 269 270 271 272 273 274 275 276 277 278 279 280 281 282 283 284 285 286 287 288 289 290 291 292 293 294 295 296 297 298 299 300 301 302 303 304 305 306 307 308 309 310 311 312 313 314 315 316 317 318 319 320 321 322 323 324 325 326 327 328 329 330 331 332 333 334 335 336 337 338 339 340 341 342 343 344 345 346 347 348 349 350 351 352 353 354 355 356 357 358 359 360 361 362 363 364 365 366 367 368 369 370 371 372 373 374 375 376 377 378 379 380 381 382 383 384 385 386 387 388 389 390 391 392 393 394 395 396 397 398 399 400 401 402 403 404 405 406 407 408 409 410 411 412 413 414 415 416 417 418 419 420 421 422 423 424 425 426 427 428 429 430 431 432 433 434 435 436 437 438 439 440 441 442 443 444 445 446 447 448 449 450 451 452 453 454 455 456 457 458 459 460 461 462 463
diff --git a/ChangeLog b/ChangeLog
index 2336232..7092d84 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,8 +1,44 @@
+2008-12-21 anonymous
+
+ FT_USE_MODULE declares things as:
+
+ extern const FT_Module_Class
+
+ (or similar for C++). However, the actual types of the variables
+ being declared are often different, e.g., FT_Driver_ClassRec or
+ FT_Renderer_Class. (Some are, indeed, FT_Module_Class.)
+
+ This works with most C compilers (since those structs begin with an
+ FT_Module_Class struct), but technically it's undefined behavior.
+
+ To quote the ISO/IEC 9899:TC2 final committee draft, section 6.2.7
+ paragraph 2:
+
+ All declarations that refer to the same object or function shall
+ have compatible type; otherwise, the behavior is undefined.
+
+ (And they are not compatible types.)
+
+ Most C compilers don't reject (or even detect!) code which has this
+ issue, but the GCC LTO development branch compiler does. (It
+ outputs the types of the objects while generating .o files, along
+ with a bunch of other information, then compares them when doing the
+ final link-time code generation pass.)
+
+ Patch from Savannah bug #25133.
+
+ * src/base/ftinit.c (FT_USE_MODULE): Include variable type.
+
+ * builds/amiga/include/freetype/config/ftmodule.h,
+ include/freetype/config/ftmodule.h, */module.mk: Updated to declare
+ pass correct types to FT_USE_MODULE.
+
2008-12-21 Hongbo Ni <hongbo@njstar.com>
* src/autofit/aflatin.c (af_latin_hint_edges),
src/autofit/aflatin2.c (af_latin2_hint_edges), src/autofit/afcjk.c
- (af_cjk_hint_edges): Protect against division by zero.
+ (af_cjk_hint_edges): Protect against division by zero. This fixes
+ Savannah bug #25124.
2008-12-18 Werner Lemberg <wl@gnu.org>
diff --git a/builds/amiga/include/freetype/config/ftmodule.h b/builds/amiga/include/freetype/config/ftmodule.h
index c8a5bee..5873bab 100644
--- a/builds/amiga/include/freetype/config/ftmodule.h
+++ b/builds/amiga/include/freetype/config/ftmodule.h
@@ -80,77 +80,77 @@
/* Now include the modules */
#ifdef FT_USE_AUTOFIT
-FT_USE_MODULE(autofit_module_class)
+FT_USE_MODULE( FT_Module_Class, autofit_module_class )
#endif
#ifdef FT_USE_TT
-FT_USE_MODULE(tt_driver_class)
+FT_USE_MODULE( FT_Driver_ClassRec, tt_driver_class )
#endif
#ifdef FT_USE_T1
-FT_USE_MODULE(t1_driver_class)
+FT_USE_MODULE( FT_Driver_ClassRec, t1_driver_class )
#endif
#ifdef FT_USE_CFF
-FT_USE_MODULE(cff_driver_class)
+FT_USE_MODULE( FT_Driver_ClassRec, cff_driver_class )
#endif
#ifdef FT_USE_T1CID
-FT_USE_MODULE(t1cid_driver_class)
+FT_USE_MODULE( FT_Driver_ClassRec, t1cid_driver_class )
#endif
#ifdef FT_USE_PFR
-FT_USE_MODULE(pfr_driver_class)
+FT_USE_MODULE( FT_Driver_ClassRec, pfr_driver_class )
#endif
#ifdef FT_USE_T42
-FT_USE_MODULE(t42_driver_class)
+FT_USE_MODULE( FT_Driver_ClassRec, t42_driver_class )
#endif
#ifdef FT_USE_WINFNT
-FT_USE_MODULE(winfnt_driver_class)
+FT_USE_MODULE( FT_Driver_ClassRec, winfnt_driver_class )
#endif
#ifdef FT_USE_PCF
-FT_USE_MODULE(pcf_driver_class)
+FT_USE_MODULE( FT_Driver_ClassRec, pcf_driver_class )
#endif
#ifdef FT_USE_PSAUX
-FT_USE_MODULE(psaux_module_class)
+FT_USE_MODULE( FT_Module_Class, psaux_module_class )
#endif
#ifdef FT_USE_PSNAMES
-FT_USE_MODULE(psnames_module_class)
+FT_USE_MODULE( FT_Module_Class, psnames_module_class )
#endif
#ifdef FT_USE_PSHINT
-FT_USE_MODULE(pshinter_module_class)
+FT_USE_MODULE( FT_Module_Class, pshinter_module_class )
#endif
#ifdef FT_USE_RASTER
-FT_USE_MODULE(ft_raster1_renderer_class)
+FT_USE_MODULE( FT_Renderer_Class, ft_raster1_renderer_class )
#endif
#ifdef FT_USE_SFNT
-FT_USE_MODULE(sfnt_module_class)
+FT_USE_MODULE( FT_Module_Class, sfnt_module_class )
#endif
#ifdef FT_USE_SMOOTH
-FT_USE_MODULE(ft_smooth_renderer_class)
-FT_USE_MODULE(ft_smooth_lcd_renderer_class)
-FT_USE_MODULE(ft_smooth_lcdv_renderer_class)
+FT_USE_MODULE( FT_Renderer_Class, ft_smooth_renderer_class )
+FT_USE_MODULE( FT_Renderer_Class, ft_smooth_lcd_renderer_class )
+FT_USE_MODULE( FT_Renderer_Class, ft_smooth_lcdv_renderer_class )
#endif
#ifdef FT_USE_OTV
-FT_USE_MODULE(otv_module_class)
+FT_USE_MODULE( FT_Module_Class, otv_module_class )
#endif
#ifdef FT_USE_BDF
-FT_USE_MODULE(bdf_driver_class)
+FT_USE_MODULE( FT_Driver_ClassRec, bdf_driver_class )
#endif
#ifdef FT_USE_GXV
-FT_USE_MODULE(gxv_module_class)
+FT_USE_MODULE( FT_Module_Class, gxv_module_class )
#endif
/*
diff --git a/include/freetype/config/ftmodule.h b/include/freetype/config/ftmodule.h
index d92b0ee..76d271a 100644
--- a/include/freetype/config/ftmodule.h
+++ b/include/freetype/config/ftmodule.h
@@ -10,23 +10,23 @@
*
*/
-FT_USE_MODULE(autofit_module_class)
-FT_USE_MODULE(tt_driver_class)
-FT_USE_MODULE(t1_driver_class)
-FT_USE_MODULE(cff_driver_class)
-FT_USE_MODULE(t1cid_driver_class)
-FT_USE_MODULE(pfr_driver_class)
-FT_USE_MODULE(t42_driver_class)
-FT_USE_MODULE(winfnt_driver_class)
-FT_USE_MODULE(pcf_driver_class)
-FT_USE_MODULE(psaux_module_class)
-FT_USE_MODULE(psnames_module_class)
-FT_USE_MODULE(pshinter_module_class)
-FT_USE_MODULE(ft_raster1_renderer_class)
-FT_USE_MODULE(sfnt_module_class)
-FT_USE_MODULE(ft_smooth_renderer_class)
-FT_USE_MODULE(ft_smooth_lcd_renderer_class)
-FT_USE_MODULE(ft_smooth_lcdv_renderer_class)
-FT_USE_MODULE(bdf_driver_class)
+FT_USE_MODULE( FT_Module_Class, autofit_module_class )
+FT_USE_MODULE( FT_Driver_ClassRec, tt_driver_class )
+FT_USE_MODULE( FT_Driver_ClassRec, t1_driver_class )
+FT_USE_MODULE( FT_Driver_ClassRec, cff_driver_class )
+FT_USE_MODULE( FT_Driver_ClassRec, t1cid_driver_class )
+FT_USE_MODULE( FT_Driver_ClassRec, pfr_driver_class )
+FT_USE_MODULE( FT_Driver_ClassRec, t42_driver_class )
+FT_USE_MODULE( FT_Driver_ClassRec, winfnt_driver_class )
+FT_USE_MODULE( FT_Driver_ClassRec, pcf_driver_class )
+FT_USE_MODULE( FT_Module_Class, psaux_module_class )
+FT_USE_MODULE( FT_Module_Class, psnames_module_class )
+FT_USE_MODULE( FT_Module_Class, pshinter_module_class )
+FT_USE_MODULE( FT_Renderer_Class, ft_raster1_renderer_class )
+FT_USE_MODULE( FT_Module_Class, sfnt_module_class )
+FT_USE_MODULE( FT_Renderer_Class, ft_smooth_renderer_class )
+FT_USE_MODULE( FT_Renderer_Class, ft_smooth_lcd_renderer_class )
+FT_USE_MODULE( FT_Renderer_Class, ft_smooth_lcdv_renderer_class )
+FT_USE_MODULE( FT_Driver_ClassRec, bdf_driver_class )
/* EOF */
diff --git a/src/autofit/module.mk b/src/autofit/module.mk
index 4a386ce..6ec6091 100644
--- a/src/autofit/module.mk
+++ b/src/autofit/module.mk
@@ -16,7 +16,7 @@
FTMODULE_H_COMMANDS += AUTOFIT_MODULE
define AUTOFIT_MODULE
-$(OPEN_DRIVER)autofit_module_class$(CLOSE_DRIVER)
+$(OPEN_DRIVER) FT_Module_Class, autofit_module_class $(CLOSE_DRIVER)
$(ECHO_DRIVER)autofit $(ECHO_DRIVER_DESC)automatic hinting module$(ECHO_DRIVER_DONE)
endef
diff --git a/src/base/ftinit.c b/src/base/ftinit.c
index 7af19c3..dac30b0 100644
--- a/src/base/ftinit.c
+++ b/src/base/ftinit.c
@@ -55,9 +55,9 @@
#undef FT_USE_MODULE
#ifdef __cplusplus
-#define FT_USE_MODULE( x ) extern "C" const FT_Module_Class x;
+#define FT_USE_MODULE( type, x ) extern "C" const type x;
#else
-#define FT_USE_MODULE( x ) extern const FT_Module_Class x;
+#define FT_USE_MODULE( type, x ) extern const type x;
#endif
@@ -65,7 +65,7 @@
#undef FT_USE_MODULE
-#define FT_USE_MODULE( x ) (const FT_Module_Class*)&(x),
+#define FT_USE_MODULE( type, x ) (const FT_Module_Class*)&(x),
static
const FT_Module_Class* const ft_default_modules[] =
diff --git a/src/bdf/module.mk b/src/bdf/module.mk
index dfaa274..fe06ae8 100644
--- a/src/bdf/module.mk
+++ b/src/bdf/module.mk
@@ -27,7 +27,7 @@
FTMODULE_H_COMMANDS += BDF_DRIVER
define BDF_DRIVER
-$(OPEN_DRIVER)bdf_driver_class$(CLOSE_DRIVER)
+$(OPEN_DRIVER) FT_Driver_ClassRec, bdf_driver_class $(CLOSE_DRIVER)
$(ECHO_DRIVER)bdf $(ECHO_DRIVER_DESC)bdf bitmap fonts$(ECHO_DRIVER_DONE)
endef
diff --git a/src/cff/module.mk b/src/cff/module.mk
index 0474e37..ef1391c 100644
--- a/src/cff/module.mk
+++ b/src/cff/module.mk
@@ -16,7 +16,7 @@
FTMODULE_H_COMMANDS += CFF_DRIVER
define CFF_DRIVER
-$(OPEN_DRIVER)cff_driver_class$(CLOSE_DRIVER)
+$(OPEN_DRIVER) FT_Driver_ClassRec, cff_driver_class $(CLOSE_DRIVER)
$(ECHO_DRIVER)cff $(ECHO_DRIVER_DESC)OpenType fonts with extension *.otf$(ECHO_DRIVER_DONE)
endef
diff --git a/src/cid/module.mk b/src/cid/module.mk
index 41e5a68..ce30bfd 100644
--- a/src/cid/module.mk
+++ b/src/cid/module.mk
@@ -16,7 +16,7 @@
FTMODULE_H_COMMANDS += TYPE1CID_DRIVER
define TYPE1CID_DRIVER
-$(OPEN_DRIVER)t1cid_driver_class$(CLOSE_DRIVER)
+$(OPEN_DRIVER) FT_Driver_ClassRec, t1cid_driver_class $(CLOSE_DRIVER)
$(ECHO_DRIVER)cid $(ECHO_DRIVER_DESC)Postscript CID-keyed fonts, no known extension$(ECHO_DRIVER_DONE)
endef
diff --git a/src/gxvalid/module.mk b/src/gxvalid/module.mk
index 44ef94a..9fd098e 100644
--- a/src/gxvalid/module.mk
+++ b/src/gxvalid/module.mk
@@ -16,7 +16,7 @@
FTMODULE_H_COMMANDS += GXVALID_MODULE
define GXVALID_MODULE
-$(OPEN_DRIVER)gxv_module_class$(CLOSE_DRIVER)
+$(OPEN_DRIVER) FT_Module_Class, gxv_module_class $(CLOSE_DRIVER)
$(ECHO_DRIVER)gxvalid $(ECHO_DRIVER_DESC)TrueTypeGX/AAT validation module$(ECHO_DRIVER_DONE)
endef
diff --git a/src/otvalid/module.mk b/src/otvalid/module.mk
index aa4db04..9cadde5 100644
--- a/src/otvalid/module.mk
+++ b/src/otvalid/module.mk
@@ -16,7 +16,7 @@
FTMODULE_H_COMMANDS += OTVALID_MODULE
define OTVALID_MODULE
-$(OPEN_DRIVER)otv_module_class$(CLOSE_DRIVER)
+$(OPEN_DRIVER) FT_Module_Class, otv_module_class $(CLOSE_DRIVER)
$(ECHO_DRIVER)otvalid $(ECHO_DRIVER_DESC)OpenType validation module$(ECHO_DRIVER_DONE)
endef
diff --git a/src/pcf/module.mk b/src/pcf/module.mk
index 0c51cd6..df383ff 100644
--- a/src/pcf/module.mk
+++ b/src/pcf/module.mk
@@ -27,7 +27,7 @@
FTMODULE_H_COMMANDS += PCF_DRIVER
define PCF_DRIVER
-$(OPEN_DRIVER)pcf_driver_class$(CLOSE_DRIVER)
+$(OPEN_DRIVER) FT_Driver_ClassRec, pcf_driver_class $(CLOSE_DRIVER)
$(ECHO_DRIVER)pcf $(ECHO_DRIVER_DESC)pcf bitmap fonts$(ECHO_DRIVER_DONE)
endef
diff --git a/src/pfr/module.mk b/src/pfr/module.mk
index 53ab34a..8d1d28a 100644
--- a/src/pfr/module.mk
+++ b/src/pfr/module.mk
@@ -16,7 +16,7 @@
FTMODULE_H_COMMANDS += PFR_DRIVER
define PFR_DRIVER
-$(OPEN_DRIVER)pfr_driver_class$(CLOSE_DRIVER)
+$(OPEN_DRIVER) FT_Driver_ClassRec, pfr_driver_class $(CLOSE_DRIVER)
$(ECHO_DRIVER)pfr $(ECHO_DRIVER_DESC)PFR/TrueDoc font files with extension *.pfr$(ECHO_DRIVER_DONE)
endef
diff --git a/src/psaux/module.mk b/src/psaux/module.mk
index 5431522..42bf6f5 100644
--- a/src/psaux/module.mk
+++ b/src/psaux/module.mk
@@ -16,7 +16,7 @@
FTMODULE_H_COMMANDS += PSAUX_MODULE
define PSAUX_MODULE
-$(OPEN_DRIVER)psaux_module_class$(CLOSE_DRIVER)
+$(OPEN_DRIVER) FT_Module_Class, psaux_module_class $(CLOSE_DRIVER)
$(ECHO_DRIVER)psaux $(ECHO_DRIVER_DESC)Postscript Type 1 & Type 2 helper module$(ECHO_DRIVER_DONE)
endef
diff --git a/src/pshinter/module.mk b/src/pshinter/module.mk
index cd171d0..ed24eb7 100644
--- a/src/pshinter/module.mk
+++ b/src/pshinter/module.mk
@@ -16,7 +16,7 @@
FTMODULE_H_COMMANDS += PSHINTER_MODULE
define PSHINTER_MODULE
-$(OPEN_DRIVER)pshinter_module_class$(CLOSE_DRIVER)
+$(OPEN_DRIVER) FT_Module_Class, pshinter_module_class $(CLOSE_DRIVER)
$(ECHO_DRIVER)pshinter $(ECHO_DRIVER_DESC)Postscript hinter module$(ECHO_DRIVER_DONE)
endef
diff --git a/src/psnames/module.mk b/src/psnames/module.mk
index a93063b..a6e9082 100644
--- a/src/psnames/module.mk
+++ b/src/psnames/module.mk
@@ -16,7 +16,7 @@
FTMODULE_H_COMMANDS += PSNAMES_MODULE
define PSNAMES_MODULE
-$(OPEN_DRIVER)psnames_module_class$(CLOSE_DRIVER)
+$(OPEN_DRIVER) FT_Module_Class, psnames_module_class $(CLOSE_DRIVER)
$(ECHO_DRIVER)psnames $(ECHO_DRIVER_DESC)Postscript & Unicode Glyph name handling$(ECHO_DRIVER_DONE)
endef
diff --git a/src/raster/module.mk b/src/raster/module.mk
index 59c737b..cbff5df 100644
--- a/src/raster/module.mk
+++ b/src/raster/module.mk
@@ -16,7 +16,7 @@
FTMODULE_H_COMMANDS += RASTER_MODULE
define RASTER_MODULE
-$(OPEN_DRIVER)ft_raster1_renderer_class$(CLOSE_DRIVER)
+$(OPEN_DRIVER) FT_Renderer_Class, ft_raster1_renderer_class $(CLOSE_DRIVER)
$(ECHO_DRIVER)raster $(ECHO_DRIVER_DESC)monochrome bitmap renderer$(ECHO_DRIVER_DONE)
endef
diff --git a/src/sfnt/module.mk b/src/sfnt/module.mk
index d339138..95fd6a3 100644
--- a/src/sfnt/module.mk
+++ b/src/sfnt/module.mk
@@ -16,7 +16,7 @@
FTMODULE_H_COMMANDS += SFNT_MODULE
define SFNT_MODULE
-$(OPEN_DRIVER)sfnt_module_class$(CLOSE_DRIVER)
+$(OPEN_DRIVER) FT_Module_Class, sfnt_module_class $(CLOSE_DRIVER)
$(ECHO_DRIVER)sfnt $(ECHO_DRIVER_DESC)helper module for TrueType & OpenType formats$(ECHO_DRIVER_DONE)
endef
diff --git a/src/smooth/module.mk b/src/smooth/module.mk
index 05ad4ba..47f6c04 100644
--- a/src/smooth/module.mk
+++ b/src/smooth/module.mk
@@ -16,11 +16,11 @@
FTMODULE_H_COMMANDS += SMOOTH_RENDERER
define SMOOTH_RENDERER
-$(OPEN_DRIVER)ft_smooth_renderer_class$(CLOSE_DRIVER)
+$(OPEN_DRIVER) FT_Renderer_Class, ft_smooth_renderer_class $(CLOSE_DRIVER)
$(ECHO_DRIVER)smooth $(ECHO_DRIVER_DESC)anti-aliased bitmap renderer$(ECHO_DRIVER_DONE)
-$(OPEN_DRIVER)ft_smooth_lcd_renderer_class$(CLOSE_DRIVER)
+$(OPEN_DRIVER) FT_Renderer_Class, ft_smooth_lcd_renderer_class $(CLOSE_DRIVER)
$(ECHO_DRIVER)smooth $(ECHO_DRIVER_DESC)anti-aliased bitmap renderer for LCDs$(ECHO_DRIVER_DONE)
-$(OPEN_DRIVER)ft_smooth_lcdv_renderer_class$(CLOSE_DRIVER)
+$(OPEN_DRIVER) FT_Renderer_Class, ft_smooth_lcdv_renderer_class $(CLOSE_DRIVER)
$(ECHO_DRIVER)smooth $(ECHO_DRIVER_DESC)anti-aliased bitmap renderer for vertical LCDs$(ECHO_DRIVER_DONE)
endef
diff --git a/src/truetype/module.mk b/src/truetype/module.mk
index 3b05afc..baee81a 100644
--- a/src/truetype/module.mk
+++ b/src/truetype/module.mk
@@ -16,7 +16,7 @@
FTMODULE_H_COMMANDS += TRUETYPE_DRIVER
define TRUETYPE_DRIVER
-$(OPEN_DRIVER)tt_driver_class$(CLOSE_DRIVER)
+$(OPEN_DRIVER) FT_Driver_ClassRec, tt_driver_class $(CLOSE_DRIVER)
$(ECHO_DRIVER)truetype $(ECHO_DRIVER_DESC)Windows/Mac font files with extension *.ttf or *.ttc$(ECHO_DRIVER_DONE)
endef
diff --git a/src/type1/module.mk b/src/type1/module.mk
index baf98c0..ade0210 100644
--- a/src/type1/module.mk
+++ b/src/type1/module.mk
@@ -16,7 +16,7 @@
FTMODULE_H_COMMANDS += TYPE1_DRIVER
define TYPE1_DRIVER
-$(OPEN_DRIVER)t1_driver_class$(CLOSE_DRIVER)
+$(OPEN_DRIVER) FT_Driver_ClassRec, t1_driver_class $(CLOSE_DRIVER)
$(ECHO_DRIVER)type1 $(ECHO_DRIVER_DESC)Postscript font files with extension *.pfa or *.pfb$(ECHO_DRIVER_DONE)
endef
diff --git a/src/type42/module.mk b/src/type42/module.mk
index 8bd40a5..b3f10a8 100644
--- a/src/type42/module.mk
+++ b/src/type42/module.mk
@@ -16,7 +16,7 @@
FTMODULE_H_COMMANDS += TYPE42_DRIVER
define TYPE42_DRIVER
-$(OPEN_DRIVER)t42_driver_class$(CLOSE_DRIVER)
+$(OPEN_DRIVER) FT_Driver_ClassRec, t42_driver_class $(CLOSE_DRIVER)
$(ECHO_DRIVER)type42 $(ECHO_DRIVER_DESC)Type 42 font files with no known extension$(ECHO_DRIVER_DONE)
endef
diff --git a/src/winfonts/module.mk b/src/winfonts/module.mk
index 0ace3ae..b44d7f0 100644
--- a/src/winfonts/module.mk
+++ b/src/winfonts/module.mk
@@ -16,7 +16,7 @@
FTMODULE_H_COMMANDS += WINDOWS_DRIVER
define WINDOWS_DRIVER
-$(OPEN_DRIVER)winfnt_driver_class$(CLOSE_DRIVER)
+$(OPEN_DRIVER) FT_Driver_ClassRec, winfnt_driver_class $(CLOSE_DRIVER)
$(ECHO_DRIVER)winfnt $(ECHO_DRIVER_DESC)Windows bitmap fonts with extension *.fnt or *.fon$(ECHO_DRIVER_DONE)
endef