Commit dee781342b932b60c0c885d4f493b8246710a34c

David Turner 2001-06-27T09:26:46

* include/freetype/ftconfig.h, src/*/*.c: changed the definition and uses of the FT_CALLBACK_DEF macro in order to support 16-bit compilers

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
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
799
800
801
802
803
804
805
806
807
808
809
810
811
812
813
814
815
816
817
818
819
820
821
822
823
824
825
826
827
828
829
830
831
832
833
834
835
836
837
838
839
840
841
842
843
844
845
846
847
848
849
850
851
852
853
854
855
856
857
858
859
860
861
862
863
864
865
866
867
868
869
870
871
872
873
874
875
876
877
878
879
880
881
882
883
884
885
886
887
888
889
890
891
892
893
894
895
896
897
898
899
900
901
902
903
904
905
906
907
908
909
910
911
912
913
914
915
916
917
918
919
920
921
922
923
924
925
926
927
928
929
930
931
932
933
934
935
936
937
938
939
940
941
942
943
944
945
946
947
948
949
950
951
952
953
954
955
956
957
958
959
960
961
962
963
964
965
966
967
968
969
970
971
972
973
974
975
976
977
978
979
980
981
982
983
984
985
986
987
988
989
990
991
992
993
994
995
996
997
998
999
1000
1001
1002
1003
1004
1005
1006
1007
1008
1009
1010
1011
1012
1013
1014
1015
diff --git a/ChangeLog b/ChangeLog
index 116fa53..6c79678 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,8 @@
+2001-06-27  David Turner <david@freetype.org>
+
+	* include/freetype/ftconfig.h, src/*/*.c: changed the definition and
+	uses of the FT_CALLBACK_DEF macro in order to support 16-bit compilers
+
 2001-06-26  Wolfgang Domröse  <porthos.domroese@harz.de>
 
 	* include/freetype/internal/ftstream.h (FT_GET_OFF3_LE): Fix typo.
diff --git a/builds/unix/ftsystem.c b/builds/unix/ftsystem.c
index da36b2b..95def64 100644
--- a/builds/unix/ftsystem.c
+++ b/builds/unix/ftsystem.c
@@ -91,9 +91,9 @@
   /* <Return>                                                              */
   /*    The address of newly allocated block.                              */
   /*                                                                       */
-  FT_CALLBACK_DEF
-  void*  ft_alloc( FT_Memory  memory,
-                   long       size )
+  FT_CALLBACK_DEF(void*)
+  ft_alloc( FT_Memory  memory,
+            long       size )
   {
     FT_UNUSED( memory );
 
@@ -121,11 +121,11 @@
   /* <Return>                                                              */
   /*    The address of the reallocated memory block.                       */
   /*                                                                       */
-  FT_CALLBACK_DEF
-  void*  ft_realloc( FT_Memory  memory,
-                     long       cur_size,
-                     long       new_size,
-                     void*      block )
+  FT_CALLBACK_DEF(void*)
+  ft_realloc( FT_Memory  memory,
+              long       cur_size,
+              long       new_size,
+              void*      block )
   {
     FT_UNUSED( memory );
     FT_UNUSED( cur_size );
@@ -147,9 +147,9 @@
   /*                                                                       */
   /*    block   :: The address of block in memory to be freed.             */
   /*                                                                       */
-  FT_CALLBACK_DEF
-  void  ft_free( FT_Memory  memory,
-                 void*      block )
+  FT_CALLBACK_DEF(void)
+  ft_free( FT_Memory  memory,
+           void*      block )
   {
     FT_UNUSED( memory );
 
@@ -189,8 +189,8 @@
   /* <Input>                                                               */
   /*    stream :: A pointer to the stream object.                          */
   /*                                                                       */
-  FT_CALLBACK_DEF
-  void  ft_close_stream( FT_Stream  stream )
+  FT_CALLBACK_DEF(void)
+  ft_close_stream( FT_Stream  stream )
   {
     munmap( (MUNMAP_ARG_CAST)stream->descriptor.pointer, stream->size );
 
diff --git a/builds/vms/ftsystem.c b/builds/vms/ftsystem.c
index da36b2b..95def64 100644
--- a/builds/vms/ftsystem.c
+++ b/builds/vms/ftsystem.c
@@ -91,9 +91,9 @@
   /* <Return>                                                              */
   /*    The address of newly allocated block.                              */
   /*                                                                       */
-  FT_CALLBACK_DEF
-  void*  ft_alloc( FT_Memory  memory,
-                   long       size )
+  FT_CALLBACK_DEF(void*)
+  ft_alloc( FT_Memory  memory,
+            long       size )
   {
     FT_UNUSED( memory );
 
@@ -121,11 +121,11 @@
   /* <Return>                                                              */
   /*    The address of the reallocated memory block.                       */
   /*                                                                       */
-  FT_CALLBACK_DEF
-  void*  ft_realloc( FT_Memory  memory,
-                     long       cur_size,
-                     long       new_size,
-                     void*      block )
+  FT_CALLBACK_DEF(void*)
+  ft_realloc( FT_Memory  memory,
+              long       cur_size,
+              long       new_size,
+              void*      block )
   {
     FT_UNUSED( memory );
     FT_UNUSED( cur_size );
@@ -147,9 +147,9 @@
   /*                                                                       */
   /*    block   :: The address of block in memory to be freed.             */
   /*                                                                       */
-  FT_CALLBACK_DEF
-  void  ft_free( FT_Memory  memory,
-                 void*      block )
+  FT_CALLBACK_DEF(void)
+  ft_free( FT_Memory  memory,
+           void*      block )
   {
     FT_UNUSED( memory );
 
@@ -189,8 +189,8 @@
   /* <Input>                                                               */
   /*    stream :: A pointer to the stream object.                          */
   /*                                                                       */
-  FT_CALLBACK_DEF
-  void  ft_close_stream( FT_Stream  stream )
+  FT_CALLBACK_DEF(void)
+  ft_close_stream( FT_Stream  stream )
   {
     munmap( (MUNMAP_ARG_CAST)stream->descriptor.pointer, stream->size );
 
diff --git a/include/freetype/config/ftconfig.h b/include/freetype/config/ftconfig.h
index 8a20a47..14ae88f 100644
--- a/include/freetype/config/ftconfig.h
+++ b/include/freetype/config/ftconfig.h
@@ -295,19 +295,25 @@ FT_BEGIN_HEADER
   /* FT_CALLBACK_TABLE_DEF is used to _define_ a constant variable   */
   /* that contains pointers to callback functions.                   */
   /*                                                                 */
-#ifdef __cplusplus
-
-#define FT_CALLBACK_DEF             extern "C"
-#define FT_CALLBACK_TABLE           extern "C"
-#define FT_CALLBACK_TABLE_DEF       extern "C"
 
-#else
+#ifndef FT_CALLBACK_DEF
+#  ifdef __cplusplus
+#    define FT_CALLBACK_DEF(x)  extern "C" x
+#  else
+#    define FT_CALLBACK_DEF(x)  static x
+#  endif
+#endif
 
-#define FT_CALLBACK_DEF             static
-#define FT_CALLBACK_TABLE           extern
-#define FT_CALLBACK_TABLE_DEF
+#ifndef FT_CALLBACK_TABLE
+#  ifdef __cplusplus
+#    define FT_CALLBACK_TABLE      extern "C"
+#    define FT_CALLBACK_TABLE_DEF  extern "C"
+#  else
+#    define FT_CALLBACK_TABLE      extern
+#    define FT_CALLBACK_TABLE_DEF
+#  endif
+#endif
 
-#endif /* __cplusplus */
 
 FT_END_HEADER
 
diff --git a/src/autohint/ahmodule.c b/src/autohint/ahmodule.c
index 3449752..7b726c7 100644
--- a/src/autohint/ahmodule.c
+++ b/src/autohint/ahmodule.c
@@ -32,35 +32,35 @@
   } FT_AutoHinterRec;
 
 
-  FT_CALLBACK_DEF
-  FT_Error  ft_autohinter_init( FT_AutoHinter  module )
+  FT_CALLBACK_DEF(FT_Error)
+  ft_autohinter_init( FT_AutoHinter  module )
   {
     return ah_hinter_new( module->root.library, &module->hinter );
   }
 
 
-  FT_CALLBACK_DEF
-  void  ft_autohinter_done( FT_AutoHinter  module )
+  FT_CALLBACK_DEF(void)
+  ft_autohinter_done( FT_AutoHinter  module )
   {
     ah_hinter_done( module->hinter );
   }
 
 
-  FT_CALLBACK_DEF
-  FT_Error  ft_autohinter_load( FT_AutoHinter  module,
-                                FT_GlyphSlot   slot,
-                                FT_Size        size,
-                                FT_UInt        glyph_index,
-                                FT_ULong       load_flags )
+  FT_CALLBACK_DEF(FT_Error)
+  ft_autohinter_load( FT_AutoHinter  module,
+                      FT_GlyphSlot   slot,
+                      FT_Size        size,
+                      FT_UInt        glyph_index,
+                      FT_ULong       load_flags )
   {
     return ah_hinter_load_glyph( module->hinter,
                                  slot, size, glyph_index, load_flags );
   }
 
 
-  FT_CALLBACK_DEF
-  void   ft_autohinter_reset( FT_AutoHinter  module,
-                              FT_Face        face )
+  FT_CALLBACK_DEF(void)
+  ft_autohinter_reset( FT_AutoHinter  module,
+                       FT_Face        face )
   {
     UNUSED( module );
 
@@ -69,20 +69,20 @@
   }
 
 
-  FT_CALLBACK_DEF
-  void  ft_autohinter_get_globals( FT_AutoHinter  module,
-                                   FT_Face        face,
-                                   void**         global_hints,
-                                   long*          global_len )
+  FT_CALLBACK_DEF(void)
+  ft_autohinter_get_globals( FT_AutoHinter  module,
+                             FT_Face        face,
+                             void**         global_hints,
+                             long*          global_len )
   {
     ah_hinter_get_global_hints( module->hinter, face,
                                 global_hints, global_len );
   }
 
 
-  FT_CALLBACK_DEF
-  void  ft_autohinter_done_globals( FT_AutoHinter  module,
-                                    void*          global_hints )
+  FT_CALLBACK_DEF(void)
+  ft_autohinter_done_globals( FT_AutoHinter  module,
+                              void*          global_hints )
   {
     ah_hinter_done_global_hints( module->hinter, global_hints );
   }
diff --git a/src/base/ftsystem.c b/src/base/ftsystem.c
index 3de9382..309ec57 100644
--- a/src/base/ftsystem.c
+++ b/src/base/ftsystem.c
@@ -68,9 +68,9 @@
   /* <Return>                                                              */
   /*    The address of newly allocated block.                              */
   /*                                                                       */
-  FT_CALLBACK_DEF
-  void*  ft_alloc( FT_Memory  memory,
-                   long       size )
+  FT_CALLBACK_DEF(void*)
+  ft_alloc( FT_Memory  memory,
+            long       size )
   {
     FT_UNUSED( memory );
 
@@ -98,11 +98,11 @@
   /* <Return>                                                              */
   /*    The address of the reallocated memory block.                       */
   /*                                                                       */
-  FT_CALLBACK_DEF
-  void*  ft_realloc( FT_Memory  memory,
-                     long       cur_size,
-                     long       new_size,
-                     void*      block )
+  FT_CALLBACK_DEF(void*)
+  ft_realloc( FT_Memory  memory,
+              long       cur_size,
+              long       new_size,
+              void*      block )
   {
     FT_UNUSED( memory );
     FT_UNUSED( cur_size );
@@ -124,9 +124,9 @@
   /*                                                                       */
   /*    block   :: The address of block in memory to be freed.             */
   /*                                                                       */
-  FT_CALLBACK_DEF
-  void  ft_free( FT_Memory  memory,
-                 void*      block )
+  FT_CALLBACK_DEF(void)
+  ft_free( FT_Memory  memory,
+           void*      block )
   {
     FT_UNUSED( memory );
 
@@ -166,8 +166,8 @@
   /* <Input>                                                               */
   /*    stream :: A pointer to the stream object.                          */
   /*                                                                       */
-  FT_CALLBACK_DEF
-  void  ft_close_stream( FT_Stream  stream )
+  FT_CALLBACK_DEF(void)
+  ft_close_stream( FT_Stream  stream )
   {
     fclose( STREAM_FILE( stream ) );
 
@@ -197,11 +197,11 @@
   /* <Return>                                                              */
   /*    The number of bytes actually read.                                 */
   /*                                                                       */
-  FT_CALLBACK_DEF
-  unsigned long  ft_io_stream( FT_Stream       stream,
-                               unsigned long   offset,
-                               unsigned char*  buffer,
-                               unsigned long   count )
+  FT_CALLBACK_DEF(unsigned long)
+  ft_io_stream( FT_Stream       stream,
+                unsigned long   offset,
+                unsigned char*  buffer,
+                unsigned long   count )
   {
     FILE*  file;
 
diff --git a/src/cache/ftcchunk.c b/src/cache/ftcchunk.c
index 980636b..b623643 100644
--- a/src/cache/ftcchunk.c
+++ b/src/cache/ftcchunk.c
@@ -288,9 +288,9 @@
           ( (FTC_ChunkSet)(node)->root.data )
 
 
-  FT_CALLBACK_DEF
-  FT_Error  ftc_chunk_set_lru_init( FT_Lru      lru,
-                                    FT_LruNode  node )
+  FT_CALLBACK_DEF(FT_Error)
+  ftc_chunk_set_lru_init( FT_Lru      lru,
+                          FT_LruNode  node )
   {
     FTC_Chunk_Cache  cache = FTC_CSET_LRU_GET_CACHE( lru );
     FT_Error         error;
@@ -311,9 +311,9 @@
   }
 
 
-  FT_CALLBACK_DEF
-  void  ftc_chunk_set_lru_done( FT_Lru      lru,
-                                FT_LruNode  node )
+  FT_CALLBACK_DEF(void)
+  ftc_chunk_set_lru_done( FT_Lru      lru,
+                          FT_LruNode  node )
   {
     FTC_ChunkSet  cset = FTC_LRUNODE_CSET( node );
 
@@ -324,9 +324,9 @@
   }
 
 
-  FT_CALLBACK_DEF
-  FT_Bool  ftc_chunk_set_lru_compare( FT_LruNode  node,
-                                      FT_LruKey   key )
+  FT_CALLBACK_DEF(FT_Bool)
+  ftc_chunk_set_lru_compare( FT_LruNode  node,
+                             FT_LruKey   key )
   {
     FTC_ChunkSet  cset = FTC_LRUNODE_CSET( node );
 
diff --git a/src/cache/ftcglyph.c b/src/cache/ftcglyph.c
index 9af2af9..c2a63cf 100644
--- a/src/cache/ftcglyph.c
+++ b/src/cache/ftcglyph.c
@@ -316,9 +316,9 @@
           ( (FTC_GlyphSet)(node)->root.data )
 
 
-  FT_CALLBACK_DEF
-  FT_Error  ftc_glyph_set_lru_init( FT_Lru      lru,
-                                    FT_LruNode  node )
+  FT_CALLBACK_DEF(FT_Error)
+  ftc_glyph_set_lru_init( FT_Lru      lru,
+                          FT_LruNode  node )
   {
     FTC_Glyph_Cache  cache = FTC_GSET_LRU_GET_CACHE( lru );
     FT_Error         error;
@@ -337,9 +337,9 @@
   }
 
 
-  FT_CALLBACK_DEF
-  void  ftc_glyph_set_lru_done( FT_Lru      lru,
-                                FT_LruNode  node )
+  FT_CALLBACK_DEF(void)
+  ftc_glyph_set_lru_done( FT_Lru      lru,
+                          FT_LruNode  node )
   {
     FTC_GlyphSet  gset = FTC_LRUNODE_GSET( node );
 
@@ -350,9 +350,9 @@
   }
 
 
-  FT_CALLBACK_DEF
-  FT_Bool  ftc_glyph_set_lru_compare( FT_LruNode  node,
-                                      FT_LruKey   key )
+  FT_CALLBACK_DEF(FT_Bool)
+  ftc_glyph_set_lru_compare( FT_LruNode  node,
+                             FT_LruKey   key )
   {
     FTC_GlyphSet  gset = FTC_LRUNODE_GSET( node );
 
diff --git a/src/cache/ftcimage.c b/src/cache/ftcimage.c
index f76643d..0cc259b 100644
--- a/src/cache/ftcimage.c
+++ b/src/cache/ftcimage.c
@@ -62,9 +62,9 @@
   /*************************************************************************/
 
 
-  FT_CALLBACK_DEF
-  void  ftc_glyph_image_node_destroy( FTC_GlyphImage  node,
-                                      FTC_GlyphSet    gset )
+  FT_CALLBACK_DEF(void)
+  ftc_glyph_image_node_destroy( FTC_GlyphImage  node,
+                                FTC_GlyphSet    gset )
   {
     FT_Memory  memory = gset->memory;
 
@@ -74,10 +74,10 @@
   }
 
 
-  FT_CALLBACK_DEF
-  FT_Error  ftc_glyph_image_node_new( FTC_GlyphSet     gset,
-                                      FT_UInt          glyph_index,
-                                      FTC_GlyphImage  *anode )
+  FT_CALLBACK_DEF(FT_Error)
+  ftc_glyph_image_node_new( FTC_GlyphSet     gset,
+                            FT_UInt          glyph_index,
+                            FTC_GlyphImage  *anode )
   {
     FT_Memory       memory   = gset->memory;
     FTC_ImageSet    imageset = (FTC_ImageSet)gset;
@@ -161,8 +161,8 @@
   /* this function is important because it is both part of */
   /* an FTC_GlyphSet_Class and an FTC_CacheNode_Class      */
   /*                                                       */
-  FT_CALLBACK_DEF
-  FT_ULong  ftc_glyph_image_node_size( FTC_GlyphImage  node )
+  FT_CALLBACK_DEF(FT_ULong)
+  ftc_glyph_image_node_size( FTC_GlyphImage  node )
   {
     FT_ULong  size  = 0;
     FT_Glyph  glyph = node->ft_glyph;
@@ -212,18 +212,18 @@
   /*************************************************************************/
 
 
-  FT_CALLBACK_DEF
-  FT_Error  ftc_image_set_init( FTC_ImageSet     iset,
-                                FTC_Image_Desc*  type )
+  FT_CALLBACK_DEF(FT_Error)
+  ftc_image_set_init( FTC_ImageSet     iset,
+                      FTC_Image_Desc*  type )
   {
     iset->description = *type;
     return 0;
   }
 
 
-  FT_CALLBACK_DEF
-  FT_Bool  ftc_image_set_compare( FTC_ImageSet     iset,
-                                  FTC_Image_Desc*  type )
+  FT_CALLBACK_DEF(FT_Bool)
+  ftc_image_set_compare( FTC_ImageSet     iset,
+                         FTC_Image_Desc*  type )
   {
     return FT_BOOL( !memcmp( &iset->description, type, sizeof ( *type ) ) );
   }
diff --git a/src/cache/ftcmanag.c b/src/cache/ftcmanag.c
index 78b1740..64102a2 100644
--- a/src/cache/ftcmanag.c
+++ b/src/cache/ftcmanag.c
@@ -41,9 +41,9 @@
   /*************************************************************************/
 
 
-  FT_CALLBACK_DEF
-  FT_Error  ftc_manager_init_face( FT_Lru      lru,
-                                   FT_LruNode  node )
+  FT_CALLBACK_DEF(FT_Error)
+  ftc_manager_init_face( FT_Lru      lru,
+                         FT_LruNode  node )
   {
     FTC_Manager  manager = FTC_LRU_GET_MANAGER( lru );
     FT_Error     error;
@@ -67,10 +67,10 @@
 
 
   /* helper function for ftc_manager_done_face() */
-  FT_CALLBACK_DEF
-  FT_Bool  ftc_manager_size_selector( FT_Lru      lru,
-                                      FT_LruNode  node,
-                                      FT_Pointer  data )
+  FT_CALLBACK_DEF(FT_Bool)
+  ftc_manager_size_selector( FT_Lru      lru,
+                             FT_LruNode  node,
+                             FT_Pointer  data )
   {
     FT_UNUSED( lru );
 
@@ -78,9 +78,9 @@
   }
 
 
-  FT_CALLBACK_DEF
-  void  ftc_manager_done_face( FT_Lru      lru,
-                               FT_LruNode  node )
+  FT_CALLBACK_DEF(void)
+  ftc_manager_done_face( FT_Lru      lru,
+                         FT_LruNode  node )
   {
     FTC_Manager  manager = FTC_LRU_GET_MANAGER( lru );
     FT_Face      face    = (FT_Face)node->root.data;
@@ -107,9 +107,9 @@
   } FTC_FontRequest;
 
 
-  FT_CALLBACK_DEF
-  FT_Error  ftc_manager_init_size( FT_Lru      lru,
-                                   FT_LruNode  node )
+  FT_CALLBACK_DEF(FT_Error)
+  ftc_manager_init_size( FT_Lru      lru,
+                         FT_LruNode  node )
   {
     FTC_FontRequest*  font_req = (FTC_FontRequest*)node->key;
     FT_Size           size;
@@ -136,9 +136,9 @@
   }
 
 
-  FT_CALLBACK_DEF
-  void  ftc_manager_done_size( FT_Lru      lru,
-                               FT_LruNode  node )
+  FT_CALLBACK_DEF(void)
+  ftc_manager_done_size( FT_Lru      lru,
+                         FT_LruNode  node )
   {
     FT_UNUSED( lru );
 
@@ -147,10 +147,10 @@
   }
 
 
-  FT_CALLBACK_DEF
-  FT_Error  ftc_manager_flush_size( FT_Lru      lru,
-                                    FT_LruNode  node,
-                                    FT_LruKey   key )
+  FT_CALLBACK_DEF(FT_Error)
+  ftc_manager_flush_size( FT_Lru      lru,
+                          FT_LruNode  node,
+                          FT_LruKey   key )
   {
     FTC_FontRequest*  req  = (FTC_FontRequest*)key;
     FT_Size           size = (FT_Size)node->root.data;
@@ -174,9 +174,9 @@
   }
 
 
-  FT_CALLBACK_DEF
-  FT_Bool  ftc_manager_compare_size( FT_LruNode  node,
-                                     FT_LruKey   key )
+  FT_CALLBACK_DEF(FT_Bool)
+  ftc_manager_compare_size( FT_LruNode  node,
+                            FT_LruKey   key )
   {
     FTC_FontRequest*  req  = (FTC_FontRequest*)key;
     FT_Size           size = (FT_Size)node->root.data;
diff --git a/src/cache/ftcsbits.c b/src/cache/ftcsbits.c
index 934d3a9..cf01bd0 100644
--- a/src/cache/ftcsbits.c
+++ b/src/cache/ftcsbits.c
@@ -56,8 +56,8 @@
   /*************************************************************************/
 
 
-  FT_CALLBACK_DEF
-  void  ftc_sbit_chunk_node_destroy( FTC_ChunkNode  node )
+  FT_CALLBACK_DEF(void)
+  ftc_sbit_chunk_node_destroy( FTC_ChunkNode  node )
   {
     FTC_ChunkSet  cset   = node->cset;
     FT_Memory     memory = cset->memory;
@@ -73,10 +73,10 @@
   }
 
 
-  FT_CALLBACK_DEF
-  FT_Error  ftc_bitmap_copy( FT_Memory   memory,
-                             FT_Bitmap*  source,
-                             FTC_SBit    target )
+  FT_CALLBACK_DEF(FT_Error)
+  ftc_bitmap_copy( FT_Memory   memory,
+                   FT_Bitmap*  source,
+                   FTC_SBit    target )
   {
     FT_Error  error;
     FT_Int    pitch = source->pitch;
@@ -95,10 +95,10 @@
   }
 
 
-  FT_CALLBACK_DEF
-  FT_Error  ftc_sbit_chunk_node_new( FTC_ChunkSet    cset,
-                                     FT_UInt         index,
-                                     FTC_ChunkNode  *anode )
+  FT_CALLBACK_DEF(FT_Error)
+  ftc_sbit_chunk_node_new( FTC_ChunkSet    cset,
+                           FT_UInt         index,
+                           FTC_ChunkNode  *anode )
   {
     FT_Error       error;
     FT_Memory      memory  = cset->memory;
@@ -240,8 +240,8 @@
   /* this function is important because it is both part of */
   /* an FTC_ChunkSet_Class and an FTC_CacheNode_Class      */
   /*                                                       */
-  FT_CALLBACK_DEF
-  FT_ULong  ftc_sbit_chunk_node_size( FTC_ChunkNode  node )
+  FT_CALLBACK_DEF(FT_ULong)
+  ftc_sbit_chunk_node_size( FTC_ChunkNode  node )
   {
     FT_ULong      size;
     FTC_ChunkSet  cset  = node->cset;
@@ -282,9 +282,9 @@
   /*************************************************************************/
 
 
-  FT_CALLBACK_DEF
-  FT_Error  ftc_sbit_chunk_set_sizes( FTC_ChunkSet     cset,
-                                      FTC_Image_Desc*  desc )
+  FT_CALLBACK_DEF(FT_Error)
+  ftc_sbit_chunk_set_sizes( FTC_ChunkSet     cset,
+                            FTC_Image_Desc*  desc )
   {
     FT_Error  error;
     FT_Face   face;
@@ -303,9 +303,9 @@
   }
 
 
-  FT_CALLBACK_DEF
-  FT_Error  ftc_sbit_chunk_set_init( FTC_SBitSet      sset,
-                                     FTC_Image_Desc*  type )
+  FT_CALLBACK_DEF(FT_Error)
+  ftc_sbit_chunk_set_init( FTC_SBitSet      sset,
+                           FTC_Image_Desc*  type )
   {
     sset->desc = *type;
 
@@ -313,9 +313,9 @@
   }
 
 
-  FT_CALLBACK_DEF
-  FT_Bool  ftc_sbit_chunk_set_compare( FTC_SBitSet      sset,
-                                       FTC_Image_Desc*  type )
+  FT_CALLBACK_DEF(FT_Bool)
+  ftc_sbit_chunk_set_compare( FTC_SBitSet      sset,
+                              FTC_Image_Desc*  type )
   {
     return FT_BOOL( !memcmp( &sset->desc, type, sizeof ( *type ) ) );
   }
diff --git a/src/cid/cidgload.c b/src/cid/cidgload.c
index 05abd9c..1074d27 100644
--- a/src/cid/cidgload.c
+++ b/src/cid/cidgload.c
@@ -36,9 +36,9 @@
 #define FT_COMPONENT  trace_cidgload
 
 
-  FT_CALLBACK_DEF
-  FT_Error  cid_load_glyph( T1_Decoder*  decoder,
-                            FT_UInt      glyph_index )
+  FT_CALLBACK_DEF(FT_Error)
+  cid_load_glyph( T1_Decoder*  decoder,
+                  FT_UInt      glyph_index )
   {
     CID_Face   face = (CID_Face)decoder->builder.face;
     CID_Info*  cid  = &face->cid;
diff --git a/src/cid/cidload.c b/src/cid/cidload.c
index 1f45fa2..0a07082 100644
--- a/src/cid/cidload.c
+++ b/src/cid/cidload.c
@@ -158,9 +158,9 @@
   }
 
 
-  FT_CALLBACK_DEF
-  FT_Error  parse_font_bbox( CID_Face     face,
-                             CID_Parser*  parser )
+  FT_CALLBACK_DEF(FT_Error)
+  parse_font_bbox( CID_Face     face,
+                   CID_Parser*  parser )
   {
     FT_Fixed  temp[4];
     FT_BBox*  bbox = &face->cid.font_bbox;
@@ -177,9 +177,9 @@
   }
 
 
-  FT_CALLBACK_DEF
-  FT_Error  parse_font_matrix( CID_Face     face,
-                               CID_Parser*  parser )
+  FT_CALLBACK_DEF(FT_Error)
+  parse_font_matrix( CID_Face     face,
+                     CID_Parser*  parser )
   {
     FT_Matrix*     matrix;
     FT_Vector*     offset;
@@ -231,9 +231,9 @@
   }
 
 
-  FT_CALLBACK_DEF
-  FT_Error  parse_fd_array( CID_Face     face,
-                            CID_Parser*  parser )
+  FT_CALLBACK_DEF(FT_Error)
+  parse_fd_array( CID_Face     face,
+                  CID_Parser*  parser )
   {
     CID_Info*  cid    = &face->cid;
     FT_Memory  memory = face->root.memory;
diff --git a/src/psnames/psmodule.c b/src/psnames/psmodule.c
index ec6f5dc..0eb51e0 100644
--- a/src/psnames/psmodule.c
+++ b/src/psnames/psmodule.c
@@ -129,9 +129,9 @@
 
 
   /* qsort callback to sort the unicode map */
-  FT_CALLBACK_DEF
-  int  compare_uni_maps( const void*  a,
-                         const void*  b )
+  FT_CALLBACK_DEF(int)
+  compare_uni_maps( const void*  a,
+                    const void*  b )
   {
     PS_UniMap*  map1 = (PS_UniMap*)a;
     PS_UniMap*  map2 = (PS_UniMap*)b;
diff --git a/src/sfnt/sfdriver.c b/src/sfnt/sfdriver.c
index 1541145..83d6690 100644
--- a/src/sfnt/sfdriver.c
+++ b/src/sfnt/sfdriver.c
@@ -114,9 +114,9 @@
 #endif /* TT_CONFIG_OPTION_POSTSCRIPT_NAMES */
 
 
-  FT_CALLBACK_DEF
-  FT_Module_Interface  SFNT_Get_Interface( FT_Module    module,
-                                           const char*  interface )
+  FT_CALLBACK_DEF(FT_Module_Interface)
+  SFNT_Get_Interface( FT_Module    module,
+                      const char*  interface )
   {
     FT_UNUSED( module );
 
diff --git a/src/sfnt/ttcmap.c b/src/sfnt/ttcmap.c
index 1c0b9f5..9b7658e 100644
--- a/src/sfnt/ttcmap.c
+++ b/src/sfnt/ttcmap.c
@@ -34,19 +34,17 @@
 #define FT_COMPONENT  trace_ttcmap
 
 
-  FT_CALLBACK_DEF
-  FT_UInt  code_to_index0( TT_CMapTable*  charmap,
-                           FT_ULong       char_code );
-  FT_CALLBACK_DEF
-  FT_UInt  code_to_index2( TT_CMapTable*  charmap,
-                           FT_ULong       char_code );
-  FT_CALLBACK_DEF
-  FT_UInt  code_to_index4( TT_CMapTable*  charmap,
-                           FT_ULong       char_code );
-  FT_CALLBACK_DEF
-  FT_UInt  code_to_index6( TT_CMapTable*  charmap,
-                           FT_ULong       char_code );
+  FT_CALLBACK_DEF(FT_UInt)   code_to_index0( TT_CMapTable*  charmap,
+                                             FT_ULong       char_code );
+                                             
+  FT_CALLBACK_DEF(FT_UInt)   code_to_index2( TT_CMapTable*  charmap,
+                                             FT_ULong       char_code );
 
+  FT_CALLBACK_DEF(FT_UInt)   code_to_index4( TT_CMapTable*  charmap,
+                                             FT_ULong       char_code );
+
+  FT_CALLBACK_DEF(FT_UInt)   code_to_index6( TT_CMapTable*  charmap,
+                                             FT_ULong       char_code );
 
   /*************************************************************************/
   /*                                                                       */
@@ -351,9 +349,9 @@
   /* <Return>                                                              */
   /*    Glyph index into the glyphs array.  0 if the glyph does not exist. */
   /*                                                                       */
-  FT_CALLBACK_DEF
-  FT_UInt  code_to_index0( TT_CMapTable*  cmap,
-                           FT_ULong       charCode )
+  FT_CALLBACK_DEF(FT_UInt)
+  code_to_index0( TT_CMapTable*  cmap,
+                  FT_ULong       charCode )
   {
     TT_CMap0*  cmap0 = &cmap->c.cmap0;
 
@@ -377,9 +375,9 @@
   /* <Return>                                                              */
   /*    Glyph index into the glyphs array.  0 if the glyph does not exist. */
   /*                                                                       */
-  FT_CALLBACK_DEF
-  FT_UInt  code_to_index2( TT_CMapTable*  cmap,
-                           FT_ULong       charCode )
+  FT_CALLBACK_DEF(FT_UInt)
+  code_to_index2( TT_CMapTable*  cmap,
+                  FT_ULong       charCode )
   {
     FT_UInt             result, index1, offset;
     FT_UInt             char_lo;
@@ -441,9 +439,9 @@
   /* <Return>                                                              */
   /*    Glyph index into the glyphs array.  0 if the glyph does not exist. */
   /*                                                                       */
-  FT_CALLBACK_DEF
-  FT_UInt  code_to_index4( TT_CMapTable*  cmap,
-                           FT_ULong       charCode )
+  FT_CALLBACK_DEF(FT_UInt)
+  code_to_index4( TT_CMapTable*  cmap,
+                  FT_ULong       charCode )
   {
     FT_UInt          result, index1, segCount;
     TT_CMap4*        cmap4;
@@ -524,9 +522,9 @@
   /* <Return>                                                              */
   /*    Glyph index into the glyphs array.  0 if the glyph does not exist. */
   /*                                                                       */
-  FT_CALLBACK_DEF
-  FT_UInt  code_to_index6( TT_CMapTable*  cmap,
-                           FT_ULong       charCode )
+  FT_CALLBACK_DEF(FT_UInt)
+  code_to_index6( TT_CMapTable*  cmap,
+                  FT_ULong       charCode )
   {
     TT_CMap6*  cmap6;
     FT_UInt    result = 0;
diff --git a/src/truetype/ttgload.c b/src/truetype/ttgload.c
index e64ab9f..522e33b 100644
--- a/src/truetype/ttgload.c
+++ b/src/truetype/ttgload.c
@@ -201,11 +201,11 @@
   /*                                                                       */
   /*************************************************************************/
 
-  FT_CALLBACK_DEF
-  FT_Error  TT_Access_Glyph_Frame( TT_Loader*  loader,
-                                   FT_UInt     glyph_index,
-                                   FT_ULong    offset,
-                                   FT_UInt     byte_count )
+  FT_CALLBACK_DEF(FT_Error)
+  TT_Access_Glyph_Frame( TT_Loader*  loader,
+                         FT_UInt     glyph_index,
+                         FT_ULong    offset,
+                         FT_UInt     byte_count )
   {
     FT_Error   error;
     FT_Stream  stream = loader->stream;
@@ -224,8 +224,8 @@
   }
 
 
-  FT_CALLBACK_DEF
-  void  TT_Forget_Glyph_Frame( TT_Loader*  loader )
+  FT_CALLBACK_DEF(void)
+  TT_Forget_Glyph_Frame( TT_Loader*  loader )
   {
     FT_Stream  stream = loader->stream;
 
@@ -234,8 +234,8 @@
   }
 
 
-  FT_CALLBACK_DEF
-  FT_Error  TT_Load_Glyph_Header( TT_Loader*  loader )
+  FT_CALLBACK_DEF(FT_Error)
+  TT_Load_Glyph_Header( TT_Loader*  loader )
   {
     FT_Stream   stream = loader->stream;
 
@@ -257,8 +257,8 @@
   }
 
 
-  FT_CALLBACK_DEF
-  FT_Error  TT_Load_Simple_Glyph( TT_Loader*  load )
+  FT_CALLBACK_DEF(FT_Error)
+  TT_Load_Simple_Glyph( TT_Loader*  load )
   {
     FT_Error         error;
     FT_Stream        stream     = load->stream;
@@ -416,8 +416,8 @@
   }
 
 
-  FT_CALLBACK_DEF
-  FT_Error  TT_Load_Composite_Glyph( TT_Loader*  loader )
+  FT_CALLBACK_DEF(FT_Error)
+  TT_Load_Composite_Glyph( TT_Loader*  loader )
   {
     FT_Error         error;
     FT_Stream        stream  = loader->stream;
diff --git a/src/truetype/ttinterp.c b/src/truetype/ttinterp.c
index 43f5767..6d4b7f7 100644
--- a/src/truetype/ttinterp.c
+++ b/src/truetype/ttinterp.c
@@ -1249,47 +1249,41 @@
   /*************************************************************************/
 
 
-  FT_CALLBACK_DEF
-  FT_F26Dot6  Read_CVT( EXEC_OP_ FT_ULong  index )
+  FT_CALLBACK_DEF(FT_F26Dot6)  Read_CVT( EXEC_OP_ FT_ULong  index )
   {
     return CUR.cvt[index];
   }
 
 
-  FT_CALLBACK_DEF
-  FT_F26Dot6  Read_CVT_Stretched( EXEC_OP_ FT_ULong  index )
+  FT_CALLBACK_DEF(FT_F26Dot6)  Read_CVT_Stretched( EXEC_OP_ FT_ULong  index )
   {
     return TT_MULFIX( CUR.cvt[index], CURRENT_Ratio() );
   }
 
 
-  FT_CALLBACK_DEF
-  void  Write_CVT( EXEC_OP_ FT_ULong    index,
-                            FT_F26Dot6  value )
+  FT_CALLBACK_DEF(voidà  Write_CVT( EXEC_OP_ FT_ULong    index,
+                                             FT_F26Dot6  value )
   {
     CUR.cvt[index] = value;
   }
 
 
-  FT_CALLBACK_DEF
-  void  Write_CVT_Stretched( EXEC_OP_ FT_ULong    index,
-                                      FT_F26Dot6  value )
+  FT_CALLBACK_DEF(void)  Write_CVT_Stretched( EXEC_OP_ FT_ULong    index,
+                                                       FT_F26Dot6  value )
   {
     CUR.cvt[index] = FT_DivFix( value, CURRENT_Ratio() );
   }
 
 
-  FT_CALLBACK_DEF
-  void  Move_CVT( EXEC_OP_ FT_ULong    index,
-                           FT_F26Dot6  value )
+  FT_CALLBACK_DEF(void)  Move_CVT( EXEC_OP_ FT_ULong    index,
+                                            FT_F26Dot6  value )
   {
     CUR.cvt[index] += value;
   }
 
 
-  FT_CALLBACK_DEF
-  void  Move_CVT_Stretched( EXEC_OP_ FT_ULong    index,
-                                     FT_F26Dot6  value )
+  FT_CALLBACK_DEF(void)  Move_CVT_Stretched( EXEC_OP_ FT_ULong    index,
+                                                      FT_F26Dot6  value )
   {
     CUR.cvt[index] += FT_DivFix( value, CURRENT_Ratio() );
   }
diff --git a/src/type1/t1afm.c b/src/type1/t1afm.c
index 53c6a4b..d68853a 100644
--- a/src/type1/t1afm.c
+++ b/src/type1/t1afm.c
@@ -139,9 +139,9 @@
 
 
   /* compare two kerning pairs */
-  FT_CALLBACK_DEF
-  int  compare_kern_pairs( const void*  a,
-                           const void*  b )
+  FT_CALLBACK_DEF(int)
+  compare_kern_pairs( const void*  a,
+                      const void*  b )
   {
     T1_Kern_Pair*  pair1 = (T1_Kern_Pair*)a;
     T1_Kern_Pair*  pair2 = (T1_Kern_Pair*)b;
diff --git a/src/type1/t1gload.c b/src/type1/t1gload.c
index f6a7c7c..52c9203 100644
--- a/src/type1/t1gload.c
+++ b/src/type1/t1gload.c
@@ -55,9 +55,9 @@
   /*************************************************************************/
 
 
-  FT_CALLBACK_DEF
-  FT_Error  T1_Parse_Glyph( T1_Decoder*  decoder,
-                            FT_UInt      glyph_index )
+  FT_CALLBACK_DEF(FT_Error)
+  T1_Parse_Glyph( T1_Decoder*  decoder,
+                  FT_UInt      glyph_index )
   {
     T1_Face   face  = (T1_Face)decoder->builder.face;
     T1_Font*  type1 = &face->type1;