Commit 9c8ee920508f75de91172a3321cd6763d8426b3f

Werner Lemberg 2002-01-19T02:20:45

* builds/win32/ftdebug.c: New file. * builds/win32/visualc/freetype.dsp: Updated. * builds/amiga/src/base/ftsystem.c: Updated for AmigaOS 3.9. * builds/amiga/README: Updated.

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
diff --git a/ChangeLog b/ChangeLog
index f79cb35..89eb2e0 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,4 +1,14 @@
-2001-01-18  Ian Brown  <ian.brown@printsoft.de>
+2002-01-18  Ian Brown  <ian.brown@printsoft.de>
+
+	* builds/win32/ftdebug.c: New file.
+	* builds/win32/visualc/freetype.dsp: Updated.
+
+2002-01-18  Detlef Würkner  <TetiSoft@apg.lahn.de>
+
+	* builds/amiga/src/base/ftsystem.c: Updated for AmigaOS 3.9.
+	* builds/amiga/README: Updated.
+
+2002-01-18  Ian Brown  <ian.brown@printsoft.de>
 
 	* builds/win32/visualc/freetype.dsp: Updated.
 
diff --git a/builds/amiga/README b/builds/amiga/README
index 17c4499..1611666 100644
--- a/builds/amiga/README
+++ b/builds/amiga/README
@@ -1,9 +1,8 @@
-The makefile is for ppc-morphos-gcc-2.95.3-bin.tgz (gcc 2.95.3 hosted
-on 68k-Amiga producing MorphOS-PPC-binaries from
-http://www.morphos.de). To use it, type "make assign", then "make",
+The makefile is  for ppc-morphos-gcc-2.95.3-bin.tgz (gcc 2.95.3 hosted
+on       68k-Amiga      producing       MorphOS-PPC-binaries      from
+http://www.morphos.de).  To  use it, type "make  assign", then "make";
 it produces a link library libft2_ppc.a.
 
-
 The smakefile is a makefile for Amiga SAS/C 6.58 (no longer available,
 latest sold version was 6.50, updates  can be found in Aminet).  It is
 based on the version found  in the sourcecode of ttf.library 0.83b for
@@ -11,8 +10,8 @@ FreeType   1.3.1    from   Richard   Griffith   (ragriffi@sprynet.com,
 http://ragriffi.home.sprynet.com).
 
 You will  also need  the latest include  files and amiga.lib  from the
-Amiga Developer  CD V2.1  (or newer, I  hope...) for AmigaOS  3.5, the
-generated code should work under AmigaOS 2.04 (V37) and up.
+Amiga  web   site  (http://www.amiga.com/3.9/download/NDK3.9.lha)  for
+AmigaOS 3.9; the generated code should work under AmigaOS 2.04 and up.
 
 To use it, call "smake  assign" and then "smake" from the builds/amiga
 directory.  The results are:
@@ -72,7 +71,7 @@ To use in your own programs:
   ft2_680x0.lib as link library.
 
 
-To adopt to other compilers:
+To adapt to other compilers:
 
 - The standard ANSI  C maximum length of 31  significant characters in
   identifiers is not enough for FreeType2.  Check if your compiler has
diff --git a/builds/amiga/src/base/ftdebug.c b/builds/amiga/src/base/ftdebug.c
index 3e16337..db0d36f 100644
--- a/builds/amiga/src/base/ftdebug.c
+++ b/builds/amiga/src/base/ftdebug.c
@@ -1,11 +1,8 @@
-// TetiSoft: replaced vprintf() with KVPrintF() and commented out exit()
-extern void __stdargs KVPrintF( const char *formatString, const void *values );
-
 /***************************************************************************/
 /*                                                                         */
 /*  ftdebug.c                                                              */
 /*                                                                         */
-/*    Debugging and logging component (body).                              */
+/*    Debugging and logging component for Win32 (body).                    */
 /*                                                                         */
 /*  Copyright 1996-2001 by                                                 */
 /*  David Turner, Robert Wilhelm, and Werner Lemberg.                      */
@@ -60,16 +57,19 @@ extern void __stdargs KVPrintF( const char *formatString, const void *values );
 #include <stdlib.h>
 #include <string.h>
 
+#include <windows.h>
+
 
   FT_EXPORT_DEF( void )
   FT_Message( const char*  fmt, ... )
   {
-    va_list  ap;
+    static char buf[8192];
+    va_list     ap;
 
 
     va_start( ap, fmt );
-//  vprintf( fmt, ap );
-    KVPrintF( fmt, ap );
+    vsprintf( buf, fmt, ap );
+    OutputDebugStringA( buf );
     va_end( ap );
   }
 
@@ -77,15 +77,16 @@ extern void __stdargs KVPrintF( const char *formatString, const void *values );
   FT_EXPORT_DEF( void )
   FT_Panic( const char*  fmt, ... )
   {
-    va_list  ap;
+    static char buf[8192];
+    va_list     ap;
 
 
     va_start( ap, fmt );
-//  vprintf( fmt, ap );
-    KVPrintF( fmt, ap );
+    vsprintf( buf, fmt, ap );
+    OutputDebugStringA( buf );
     va_end( ap );
 
-//  exit( EXIT_FAILURE );
+    exit( EXIT_FAILURE );
   }
 
 
diff --git a/builds/amiga/src/base/ftsystem.c b/builds/amiga/src/base/ftsystem.c
index 70fea79..a1a5802 100644
--- a/builds/amiga/src/base/ftsystem.c
+++ b/builds/amiga/src/base/ftsystem.c
@@ -2,15 +2,19 @@
 // malloc() realloc() and free() which can't be used in an amiga
 // shared run-time library linked with libinit.o
 
+#include <exec/memory.h>
+
 #ifdef __GNUC__
 // Avoid warnings "struct X declared inside parameter list"
-#include <exec/memory.h>
 #include <exec/devices.h>
 #include <exec/io.h>
 #include <exec/semaphores.h>
 #include <dos/exall.h>
 #endif
 
+// Necessary with OS3.9 includes
+#define __USE_SYSBASE
+
 #include <proto/exec.h>
 #include <proto/dos.h>
 
diff --git a/builds/win32/ftdebug.c b/builds/win32/ftdebug.c
new file mode 100644
index 0000000..db0d36f
--- /dev/null
+++ b/builds/win32/ftdebug.c
@@ -0,0 +1,124 @@
+/***************************************************************************/
+/*                                                                         */
+/*  ftdebug.c                                                              */
+/*                                                                         */
+/*    Debugging and logging component for Win32 (body).                    */
+/*                                                                         */
+/*  Copyright 1996-2001 by                                                 */
+/*  David Turner, Robert Wilhelm, and Werner Lemberg.                      */
+/*                                                                         */
+/*  This file is part of the FreeType project, and may only be used,       */
+/*  modified, and distributed under the terms of the FreeType project      */
+/*  license, LICENSE.TXT.  By continuing to use, modify, or distribute     */
+/*  this file you indicate that you have read the license and              */
+/*  understand and accept it fully.                                        */
+/*                                                                         */
+/***************************************************************************/
+
+
+  /*************************************************************************/
+  /*                                                                       */
+  /* This component contains various macros and functions used to ease the */
+  /* debugging of the FreeType engine.  Its main purpose is in assertion   */
+  /* checking, tracing, and error detection.                               */
+  /*                                                                       */
+  /* There are now three debugging modes:                                  */
+  /*                                                                       */
+  /* - trace mode                                                          */
+  /*                                                                       */
+  /*   Error and trace messages are sent to the log file (which can be the */
+  /*   standard error output).                                             */
+  /*                                                                       */
+  /* - error mode                                                          */
+  /*                                                                       */
+  /*   Only error messages are generated.                                  */
+  /*                                                                       */
+  /* - release mode:                                                       */
+  /*                                                                       */
+  /*   No error message is sent or generated.  The code is free from any   */
+  /*   debugging parts.                                                    */
+  /*                                                                       */
+  /*************************************************************************/
+
+
+#include <ft2build.h>
+#include FT_INTERNAL_DEBUG_H
+
+
+#ifdef FT_DEBUG_LEVEL_TRACE
+  char  ft_trace_levels[trace_max];
+#endif
+
+
+#if defined( FT_DEBUG_LEVEL_ERROR ) || defined( FT_DEBUG_LEVEL_TRACE )
+
+
+#include <stdarg.h>
+#include <stdlib.h>
+#include <string.h>
+
+#include <windows.h>
+
+
+  FT_EXPORT_DEF( void )
+  FT_Message( const char*  fmt, ... )
+  {
+    static char buf[8192];
+    va_list     ap;
+
+
+    va_start( ap, fmt );
+    vsprintf( buf, fmt, ap );
+    OutputDebugStringA( buf );
+    va_end( ap );
+  }
+
+
+  FT_EXPORT_DEF( void )
+  FT_Panic( const char*  fmt, ... )
+  {
+    static char buf[8192];
+    va_list     ap;
+
+
+    va_start( ap, fmt );
+    vsprintf( buf, fmt, ap );
+    OutputDebugStringA( buf );
+    va_end( ap );
+
+    exit( EXIT_FAILURE );
+  }
+
+
+#ifdef FT_DEBUG_LEVEL_TRACE
+
+  FT_EXPORT_DEF( void )
+  FT_SetTraceLevel( FT_Trace  component,
+                    char      level )
+  {
+    if ( component >= trace_max )
+      return;
+
+    /* if component is `trace_any', change _all_ levels at once */
+    if ( component == trace_any )
+    {
+      int  n;
+
+
+      for ( n = trace_any; n < trace_max; n++ )
+        ft_trace_levels[n] = level;
+    }
+    else        /* otherwise, only change individual component */
+      ft_trace_levels[component] = level;
+  }
+
+#endif /* FT_DEBUG_LEVEL_TRACE */
+
+#endif /* FT_DEBUG_LEVEL_TRACE || FT_DEBUG_LEVEL_ERROR */
+
+
+  /* ANSI C doesn't allow empty files, so we insert a dummy symbol */
+  extern const int  ft_debug_dummy;
+
+
+/* END */
diff --git a/builds/win32/visualc/freetype.dsp b/builds/win32/visualc/freetype.dsp
index 3beaa3e..7ffd164 100644
--- a/builds/win32/visualc/freetype.dsp
+++ b/builds/win32/visualc/freetype.dsp
@@ -4,7 +4,7 @@
 
 # TARGTYPE "Win32 (x86) Static Library" 0x0104
 
-CFG=freetype - Win32 Debug Multithreaded
+CFG=freetype - Win32 Debug Singlethreaded
 !MESSAGE This is not a valid makefile. To build this project using NMAKE,
 !MESSAGE use the Export Makefile command and run
 !MESSAGE 
@@ -13,7 +13,7 @@ CFG=freetype - Win32 Debug Multithreaded
 !MESSAGE You can specify a configuration when running NMAKE
 !MESSAGE by defining the macro CFG on the command line. For example:
 !MESSAGE 
-!MESSAGE NMAKE /f "freetype.mak" CFG="freetype - Win32 Debug Multithreaded"
+!MESSAGE NMAKE /f "freetype.mak" CFG="freetype - Win32 Debug Singlethreaded"
 !MESSAGE 
 !MESSAGE Possible choices for configuration are:
 !MESSAGE 
@@ -21,6 +21,8 @@ CFG=freetype - Win32 Debug Multithreaded
 !MESSAGE "freetype - Win32 Debug" (based on "Win32 (x86) Static Library")
 !MESSAGE "freetype - Win32 Debug Multithreaded" (based on "Win32 (x86) Static Library")
 !MESSAGE "freetype - Win32 Release Multithreaded" (based on "Win32 (x86) Static Library")
+!MESSAGE "freetype - Win32 Release Singlethreaded" (based on "Win32 (x86) Static Library")
+!MESSAGE "freetype - Win32 Debug Singlethreaded" (based on "Win32 (x86) Static Library")
 !MESSAGE 
 
 # Begin Project
@@ -43,8 +45,8 @@ RSC=rc.exe
 # PROP Intermediate_Dir "..\..\..\objs\release"
 # PROP Target_Dir ""
 # ADD BASE CPP /nologo /W3 /GX /O2 /D "WIN32" /D "NDEBUG" /D "_MBCS" /D "_LIB" /YX /FD /c
-# ADD CPP /nologo /MD /Za /W4 /GX /Zi /O2 /I "..\..\..\include" /D "NDEBUG" /D "WIN32" /D "_MBCS" /D "_LIB" /FD /c
-# SUBTRACT CPP /YX
+# ADD CPP /MD /Za /W4 /Gm- /GX /Zi /O2 /I "..\..\..\include" /D "NDEBUG" /D "WIN32" /D "_MBCS" /D "_LIB" /FD /c
+# SUBTRACT CPP /nologo /YX
 # ADD BASE RSC /l 0x409 /d "NDEBUG"
 # ADD RSC /l 0x409 /d "NDEBUG"
 BSC32=bscmake.exe
@@ -67,8 +69,8 @@ LIB32=link.exe -lib
 # PROP Intermediate_Dir "..\..\..\objs\debug"
 # PROP Target_Dir ""
 # ADD BASE CPP /nologo /W3 /Gm /GX /ZI /Od /D "WIN32" /D "_DEBUG" /D "_MBCS" /D "_LIB" /YX /FD /GZ /c
-# ADD CPP /nologo /MDd /Za /W4 /Gm /GX /Zi /Od /I "..\..\..\include" /D "_DEBUG" /D "WIN32" /D "_MBCS" /D "_LIB" /D "FT_DEBUG_LEVEL_ERROR" /D "FT_DEBUG_LEVEL_TRACE" /FD /GZ /c
-# SUBTRACT CPP /X /YX
+# ADD CPP /MDd /Za /W4 /Gm- /GX /Zi /Od /I "..\..\..\include" /D "_DEBUG" /D "WIN32" /D "_MBCS" /D "_LIB" /D "FT_DEBUG_LEVEL_ERROR" /D "FT_DEBUG_LEVEL_TRACE" /FD /GZ /c
+# SUBTRACT CPP /nologo /X /YX
 # ADD BASE RSC /l 0x409 /d "_DEBUG"
 # ADD RSC /l 0x409 /d "_DEBUG"
 BSC32=bscmake.exe
@@ -92,8 +94,8 @@ LIB32=link.exe -lib
 # PROP Target_Dir ""
 # ADD BASE CPP /nologo /Za /W3 /Gm /GX /ZI /Od /I "..\freetype\include\\" /D "_DEBUG" /D "WIN32" /D "_MBCS" /D "_LIB" /D "FT_FLAT_COMPILE" /YX /FD /GZ /c
 # SUBTRACT BASE CPP /X
-# ADD CPP /nologo /MTd /Za /W4 /Gm /GX /ZI /Od /I "..\..\..\include" /D "_DEBUG" /D "WIN32" /D "_MBCS" /D "_LIB" /D "FT_DEBUG_LEVEL_ERROR" /D "FT_DEBUG_LEVEL_TRACE" /FD /GZ /c
-# SUBTRACT CPP /X /YX
+# ADD CPP /MTd /Za /W4 /Gm- /GX /Zi /Od /I "..\..\..\include" /D "_DEBUG" /D "WIN32" /D "_MBCS" /D "_LIB" /D "FT_DEBUG_LEVEL_ERROR" /D "FT_DEBUG_LEVEL_TRACE" /FD /GZ /c
+# SUBTRACT CPP /nologo /X /YX
 # ADD BASE RSC /l 0x409 /d "_DEBUG"
 # ADD RSC /l 0x409 /d "_DEBUG"
 BSC32=bscmake.exe
@@ -116,8 +118,8 @@ LIB32=link.exe -lib
 # PROP Intermediate_Dir "..\..\..\objs\release_mt"
 # PROP Target_Dir ""
 # ADD BASE CPP /nologo /Za /W3 /GX /O2 /I "..\freetype\include\\" /D "NDEBUG" /D "WIN32" /D "_MBCS" /D "_LIB" /D "FT_FLAT_COMPILE" /YX /FD /c
-# ADD CPP /nologo /MT /Za /W4 /GX /O2 /I "..\..\..\include" /D "NDEBUG" /D "WIN32" /D "_MBCS" /D "_LIB" /FD /c
-# SUBTRACT CPP /YX
+# ADD CPP /MT /Za /W4 /Gm- /GX /Zi /O2 /I "..\..\..\include" /D "NDEBUG" /D "WIN32" /D "_MBCS" /D "_LIB" /FD /c
+# SUBTRACT CPP /nologo /YX
 # ADD BASE RSC /l 0x409 /d "NDEBUG"
 # ADD RSC /l 0x409 /d "NDEBUG"
 BSC32=bscmake.exe
@@ -127,6 +129,57 @@ LIB32=link.exe -lib
 # ADD BASE LIB32 /nologo /out:"lib\freetype200b8.lib"
 # ADD LIB32 /nologo /out:"..\..\..\objs\freetype206MT.lib"
 
+!ELSEIF  "$(CFG)" == "freetype - Win32 Release Singlethreaded"
+
+# PROP BASE Use_MFC 0
+# PROP BASE Use_Debug_Libraries 0
+# PROP BASE Output_Dir "freetype___Win32_Release_Singlethreaded"
+# PROP BASE Intermediate_Dir "freetype___Win32_Release_Singlethreaded"
+# PROP BASE Target_Dir ""
+# PROP Use_MFC 0
+# PROP Use_Debug_Libraries 0
+# PROP Output_Dir "..\..\..\objs\release_st"
+# PROP Intermediate_Dir "..\..\..\objs\release_st"
+# PROP Target_Dir ""
+# ADD BASE CPP /nologo /MD /Za /W4 /GX /Zi /O2 /I "..\..\..\include" /D "NDEBUG" /D "WIN32" /D "_MBCS" /D "_LIB" /FD /c
+# SUBTRACT BASE CPP /YX
+# ADD CPP /Za /W4 /Gm- /GX /Zi /O2 /I "..\..\..\include" /D "NDEBUG" /D "WIN32" /D "_MBCS" /D "_LIB" /FD /c
+# SUBTRACT CPP /nologo /YX
+# ADD BASE RSC /l 0x409 /d "NDEBUG"
+# ADD RSC /l 0x409 /d "NDEBUG"
+BSC32=bscmake.exe
+# ADD BASE BSC32 /nologo
+# ADD BSC32 /nologo
+LIB32=link.exe -lib
+# ADD BASE LIB32 /nologo /out:"..\..\..\objs\freetype206.lib"
+# ADD LIB32 /out:"..\..\..\objs\freetype206ST.lib"
+# SUBTRACT LIB32 /nologo
+
+!ELSEIF  "$(CFG)" == "freetype - Win32 Debug Singlethreaded"
+
+# PROP BASE Use_MFC 0
+# PROP BASE Use_Debug_Libraries 1
+# PROP BASE Output_Dir "freetype___Win32_Debug_Singlethreaded"
+# PROP BASE Intermediate_Dir "freetype___Win32_Debug_Singlethreaded"
+# PROP BASE Target_Dir ""
+# PROP Use_MFC 0
+# PROP Use_Debug_Libraries 1
+# PROP Output_Dir "..\..\..\objs\debug_st"
+# PROP Intermediate_Dir "..\..\..\objs\debug_st"
+# PROP Target_Dir ""
+# ADD BASE CPP /nologo /MDd /Za /W4 /Gm /GX /Zi /Od /I "..\..\..\include" /D "_DEBUG" /D "WIN32" /D "_MBCS" /D "_LIB" /D "FT_DEBUG_LEVEL_ERROR" /D "FT_DEBUG_LEVEL_TRACE" /FD /GZ /c
+# SUBTRACT BASE CPP /X /YX
+# ADD CPP /Za /W4 /Gm- /GX /Zi /Od /I "..\..\..\include" /D "_DEBUG" /D "WIN32" /D "_MBCS" /D "_LIB" /D "FT_DEBUG_LEVEL_ERROR" /D "FT_DEBUG_LEVEL_TRACE" /FD /GZ /c
+# SUBTRACT CPP /nologo /X /YX
+# ADD BASE RSC /l 0x409 /d "_DEBUG"
+# ADD RSC /l 0x409 /d "_DEBUG"
+BSC32=bscmake.exe
+# ADD BASE BSC32 /nologo
+# ADD BSC32 /nologo
+LIB32=link.exe -lib
+# ADD BASE LIB32 /nologo /out:"..\..\..\objs\freetype206_D.lib"
+# ADD LIB32 /nologo /out:"..\..\..\objs\freetype206ST_D.lib"
+
 !ENDIF 
 
 # Begin Target
@@ -135,6 +188,8 @@ LIB32=link.exe -lib
 # Name "freetype - Win32 Debug"
 # Name "freetype - Win32 Debug Multithreaded"
 # Name "freetype - Win32 Release Multithreaded"
+# Name "freetype - Win32 Release Singlethreaded"
+# Name "freetype - Win32 Debug Singlethreaded"
 # Begin Group "Source Files"
 
 # PROP Default_Filter "cpp;c;cxx;rc;def;r;odl;idl;hpj;bat"
@@ -152,20 +207,8 @@ SOURCE=..\..\..\src\base\ftbase.c
 # End Source File
 # Begin Source File
 
-SOURCE=..\..\..\src\base\ftdebug.c
-
-!IF  "$(CFG)" == "freetype - Win32 Release"
-
-!ELSEIF  "$(CFG)" == "freetype - Win32 Debug"
-
+SOURCE=..\ftdebug.c
 # ADD CPP /Ze
-
-!ELSEIF  "$(CFG)" == "freetype - Win32 Debug Multithreaded"
-
-!ELSEIF  "$(CFG)" == "freetype - Win32 Release Multithreaded"
-
-!ENDIF 
-
 # End Source File
 # Begin Source File