~sbeattie/ubuntu/lucid/vnc4/lp556147

« back to all changes in this revision

Viewing changes to unix/xc/lib/font/FreeType/ftconfig.h

  • Committer: Bazaar Package Importer
  • Author(s): Ola Lundqvist
  • Date: 2006-05-15 20:35:17 UTC
  • mfrom: (1.1.2 upstream)
  • Revision ID: james.westby@ubuntu.com-20060515203517-l4lre1ku942mn26k
Tags: 4.1.1+X4.3.0-10
* Correction of critical security issue. Thanks to Martin Kogler
  <e9925248@student.tuwien.ac.at> that informed me about the issue,
  and provided the patch.
  This flaw was originally found by Steve Wiseman of intelliadmin.com.
* Applied patch from Javier Kohen <jkohen@users.sourceforge.net> that
  inform the user that only 8 first characters of the password will
  actually be used when typing more than 8 characters, closes:
  #355619.

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
/***************************************************************************/
 
2
/*                                                                         */
 
3
/*  ftconfig.h                                                             */
 
4
/*                                                                         */
 
5
/*    ANSI-specific configuration file (specification only).               */
 
6
/*                                                                         */
 
7
/*  Copyright 1996-2001, 2002 by                                           */
 
8
/*  David Turner, Robert Wilhelm, and Werner Lemberg.                      */
 
9
/*                                                                         */
 
10
/*  Modified for XFree86.                                                  */
 
11
/*                                                                         */
 
12
/*  This file is part of the FreeType project, and may only be used,       */
 
13
/*  modified, and distributed under the terms of the FreeType project      */
 
14
/*  license, LICENSE.TXT.  By continuing to use, modify, or distribute     */
 
15
/*  this file you indicate that you have read the license and              */
 
16
/*  understand and accept it fully.                                        */
 
17
/*                                                                         */
 
18
/***************************************************************************/
 
19
 
 
20
/* $XFree86: xc/lib/font/FreeType/ftconfig.h,v 1.5 2002/10/10 01:18:31 tsi Exp $ */
 
21
 
 
22
  /*************************************************************************/
 
23
  /*                                                                       */
 
24
  /* This header file contains a number of macro definitions that are used */
 
25
  /* by the rest of the engine.  Most of the macros here are automatically */
 
26
  /* determined at compile time, and you should not need to change it to   */
 
27
  /* port FreeType, except to compile the library with a non-ANSI          */
 
28
  /* compiler.                                                             */
 
29
  /*                                                                       */
 
30
  /* Note however that if some specific modifications are needed, we       */
 
31
  /* advise you to place a modified copy in your build directory.          */
 
32
  /*                                                                       */
 
33
  /* The build directory is usually `freetype/builds/<system>', and        */
 
34
  /* contains system-specific files that are always included first when    */
 
35
  /* building the library.                                                 */
 
36
  /*                                                                       */
 
37
  /* This ANSI version should stay in `include/freetype/config'.           */
 
38
  /*                                                                       */
 
39
  /*************************************************************************/
 
40
 
 
41
 
 
42
#ifndef __FTCONFIG_H__
 
43
#define __FTCONFIG_H__
 
44
 
 
45
#include <ft2build.h>
 
46
#include FT_CONFIG_OPTIONS_H
 
47
#include FT_CONFIG_STANDARD_LIBRARY_H
 
48
 
 
49
FT_BEGIN_HEADER
 
50
 
 
51
 
 
52
  /*************************************************************************/
 
53
  /*                                                                       */
 
54
  /*               PLATFORM-SPECIFIC CONFIGURATION MACROS                  */
 
55
  /*                                                                       */
 
56
  /* These macros can be toggled to suit a specific system.  The current   */
 
57
  /* ones are defaults used to compile FreeType in an ANSI C environment   */
 
58
  /* (16bit compilers are also supported).  Copy this file to your own     */
 
59
  /* `freetype/builds/<system>' directory, and edit it to port the engine. */
 
60
  /*                                                                       */
 
61
  /*************************************************************************/
 
62
 
 
63
 
 
64
  /* The number of bytes in an `int' type.  */
 
65
 
 
66
#include "Xmd.h"
 
67
 
 
68
#define FT_SIZEOF_INT 4
 
69
#ifdef LONG64
 
70
#define FT_SIZEOF_LONG 8
 
71
#else
 
72
#define FT_SIZEOF_LONG 4
 
73
#endif
 
74
 
 
75
#if 0   /* ?!?!?!?! */
 
76
  /* The number of bytes in a `long' type.  */
 
77
#if FT_ULONG_MAX == 0x0FFFFFFFFUL
 
78
#define FT_SIZEOF_LONG  4
 
79
#elif FT_ULONG_MAX > 0x0FFFFFFFFU && FT_ULONG_MAX == 0x0FFFFFFFFFFFFFFFFU
 
80
#define FT_SIZEOF_LONG  8
 
81
#else
 
82
#error "Unsupported number of bytes in `long' type!"
 
83
#endif
 
84
#endif
 
85
 
 
86
 
 
87
  /* Preferred alignment of data */
 
88
#define FT_ALIGNMENT  8
 
89
 
 
90
 
 
91
  /* FT_UNUSED is a macro used to indicate that a given parameter is not  */
 
92
  /* used -- this is only used to get rid of unpleasant compiler warnings */
 
93
#ifndef FT_UNUSED
 
94
#define FT_UNUSED( arg )  ( (arg) = (arg) )
 
95
#endif
 
96
 
 
97
 
 
98
  /*************************************************************************/
 
99
  /*                                                                       */
 
100
  /*                     AUTOMATIC CONFIGURATION MACROS                    */
 
101
  /*                                                                       */
 
102
  /* These macros are computed from the ones defined above.  Don't touch   */
 
103
  /* their definition, unless you know precisely what you are doing.  No   */
 
104
  /* porter should need to mess with them.                                 */
 
105
  /*                                                                       */
 
106
  /*************************************************************************/
 
107
 
 
108
 
 
109
  /*************************************************************************/
 
110
  /*                                                                       */
 
111
  /* Mac support                                                           */
 
112
  /*                                                                       */
 
113
  /*   This is the only necessary change, so it is defined here instead    */
 
114
  /*   providing a new configuration file.                                 */
 
115
  /*                                                                       */
 
116
#if ( defined( __APPLE__ ) && !defined ( DARWIN_NO_CARBON ) ) || \
 
117
    ( defined( __MWERKS__ ) && defined( macintosh ) )
 
118
#define FT_MACINTOSH 1
 
119
#endif
 
120
 
 
121
 
 
122
  /*************************************************************************/
 
123
  /*                                                                       */
 
124
  /* IntN types                                                            */
 
125
  /*                                                                       */
 
126
  /*   Used to guarantee the size of some specific integers.               */
 
127
  /*                                                                       */
 
128
  typedef signed short    FT_Int16;
 
129
  typedef unsigned short  FT_UInt16;
 
130
 
 
131
#if FT_SIZEOF_INT == 4
 
132
 
 
133
  typedef signed int      FT_Int32;
 
134
  typedef unsigned int    FT_UInt32;
 
135
 
 
136
#elif FT_SIZEOF_LONG == 4
 
137
 
 
138
  typedef signed long     FT_Int32;
 
139
  typedef unsigned long   FT_UInt32;
 
140
 
 
141
#else
 
142
#error "no 32bit type found -- please check your configuration files"
 
143
#endif
 
144
 
 
145
  /* now, lookup for an integer type that is at least 32 bits */
 
146
#if FT_SIZEOF_INT >= 4
 
147
 
 
148
  typedef int            FT_Fast;
 
149
  typedef unsigned int   FT_UFast;
 
150
 
 
151
#elif FT_SIZEOF_LONG >= 4
 
152
 
 
153
  typedef long           FT_Fast;
 
154
  typedef unsigned long  FT_UFast;
 
155
 
 
156
#endif
 
157
 
 
158
 
 
159
  /* determine whether we have a 64-bit int type for platforms without */
 
160
  /* Autoconf                                                          */
 
161
#if FT_SIZEOF_LONG == 8
 
162
 
 
163
  /* FT_LONG64 must be defined if a 64-bit type is available */
 
164
#define FT_LONG64
 
165
#define FT_INT64  long
 
166
 
 
167
#elif defined( _MSC_VER ) && _MSC_VER >= 900  /* Visual C++ (and Intel C++) */
 
168
 
 
169
  /* this compiler provides the __int64 type */
 
170
#define FT_LONG64
 
171
#define FT_INT64  __int64
 
172
 
 
173
#elif defined( __BORLANDC__ )  /* Borland C++ */
 
174
 
 
175
  /* XXXX: We should probably check the value of __BORLANDC__ in order */
 
176
  /*       to test the compiler version.                               */
 
177
 
 
178
  /* this compiler provides the __int64 type */
 
179
#define FT_LONG64
 
180
#define FT_INT64  __int64
 
181
 
 
182
#elif defined( __WATCOMC__ )   /* Watcom C++ */
 
183
 
 
184
  /* Watcom doesn't provide 64-bit data types */
 
185
 
 
186
#elif defined( __MWKS__ )      /* Metrowerks CodeWarrior */
 
187
 
 
188
  /* I don't know if it provides 64-bit data types, any suggestion */
 
189
  /* is welcome.                                                   */
 
190
 
 
191
#elif defined( __GNUC__ )
 
192
 
 
193
  /* GCC provides the "long long" type */
 
194
#define FT_LONG64
 
195
#define FT_INT64  long long int
 
196
 
 
197
#endif /* FT_SIZEOF_LONG == 8 */
 
198
 
 
199
 
 
200
  /*************************************************************************/
 
201
  /*                                                                       */
 
202
  /* A 64-bit data type will create compilation problems if you compile    */
 
203
  /* in strict ANSI mode.  To avoid them, we disable their use if          */
 
204
  /* __STDC__ is defined.  You can however ignore this rule by             */
 
205
  /* defining the FT_CONFIG_OPTION_FORCE_INT64 configuration macro.        */
 
206
  /*                                                                       */
 
207
#if defined( FT_LONG64 ) && !defined( FT_CONFIG_OPTION_FORCE_INT64 )
 
208
 
 
209
#ifdef __STDC__
 
210
 
 
211
  /* undefine the 64-bit macros in strict ANSI compilation mode */
 
212
#undef FT_LONG64
 
213
#undef FT_INT64
 
214
 
 
215
#endif /* __STDC__ */
 
216
 
 
217
#endif /* FT_LONG64 && !FT_CONFIG_OPTION_FORCE_INT64 */
 
218
 
 
219
 
 
220
#ifdef FT_MAKE_OPTION_SINGLE_OBJECT
 
221
 
 
222
#define FT_LOCAL( x )      static  x
 
223
#define FT_LOCAL_DEF( x )  static  x
 
224
 
 
225
#else
 
226
 
 
227
#ifdef __cplusplus
 
228
#define FT_LOCAL( x )      extern "C"  x
 
229
#define FT_LOCAL_DEF( x )  extern "C"  x
 
230
#else
 
231
#define FT_LOCAL( x )      extern  x
 
232
#define FT_LOCAL_DEF( x )  x
 
233
#endif
 
234
 
 
235
#endif /* FT_MAKE_OPTION_SINGLE_OBJECT */
 
236
 
 
237
 
 
238
#ifndef FT_BASE
 
239
 
 
240
#ifdef __cplusplus
 
241
#define FT_BASE( x )  extern "C"  x
 
242
#else
 
243
#define FT_BASE( x )  extern  x
 
244
#endif
 
245
 
 
246
#endif /* !FT_BASE */
 
247
 
 
248
 
 
249
#ifndef FT_BASE_DEF
 
250
 
 
251
#ifdef __cplusplus
 
252
#define FT_BASE_DEF( x )  extern "C"  x
 
253
#else
 
254
#define FT_BASE_DEF( x )  extern  x
 
255
#endif
 
256
 
 
257
#endif /* !FT_BASE_DEF */
 
258
 
 
259
 
 
260
#ifndef FT_EXPORT
 
261
 
 
262
#ifdef __cplusplus
 
263
#define FT_EXPORT( x )  extern "C"  x
 
264
#else
 
265
#define FT_EXPORT( x )  extern  x
 
266
#endif
 
267
 
 
268
#endif /* !FT_EXPORT */
 
269
 
 
270
 
 
271
#ifndef FT_EXPORT_DEF
 
272
 
 
273
#ifdef __cplusplus
 
274
#define FT_EXPORT_DEF( x )  extern "C"  x
 
275
#else
 
276
#define FT_EXPORT_DEF( x )  extern  x
 
277
#endif
 
278
 
 
279
#endif /* !FT_EXPORT_DEF */
 
280
 
 
281
 
 
282
#ifndef FT_EXPORT_VAR
 
283
 
 
284
#ifdef __cplusplus
 
285
#define FT_EXPORT_VAR( x )  extern "C"  x
 
286
#else
 
287
#define FT_EXPORT_VAR( x )  extern  x
 
288
#endif
 
289
 
 
290
#endif /* !FT_EXPORT_VAR */
 
291
 
 
292
  /* The following macros are needed to compile the library with a   */
 
293
  /* C++ compiler and with 16bit compilers.                          */
 
294
  /*                                                                 */
 
295
 
 
296
  /* This is special.  Within C++, you must specify `extern "C"' for */
 
297
  /* functions which are used via function pointers, and you also    */
 
298
  /* must do that for structures which contain function pointers to  */
 
299
  /* assure C linkage -- it's not possible to have (local) anonymous */
 
300
  /* functions which are accessed by (global) function pointers.     */
 
301
  /*                                                                 */
 
302
  /*                                                                 */
 
303
  /* FT_CALLBACK_DEF is used to _define_ a callback function.        */
 
304
  /*                                                                 */
 
305
  /* FT_CALLBACK_TABLE is used to _declare_ a constant variable that */
 
306
  /* contains pointers to callback functions.                        */
 
307
  /*                                                                 */
 
308
  /* FT_CALLBACK_TABLE_DEF is used to _define_ a constant variable   */
 
309
  /* that contains pointers to callback functions.                   */
 
310
  /*                                                                 */
 
311
  /*                                                                 */
 
312
  /* Some 16bit compilers have to redefine these macros to insert    */
 
313
  /* the infamous `_cdecl' or `__fastcall' declarations.             */
 
314
  /*                                                                 */
 
315
#ifndef FT_CALLBACK_DEF
 
316
#ifdef __cplusplus
 
317
#define FT_CALLBACK_DEF( x )  extern "C"  x
 
318
#else
 
319
#define FT_CALLBACK_DEF( x )  static  x
 
320
#endif
 
321
#endif /* FT_CALLBACK_DEF */
 
322
 
 
323
#ifndef FT_CALLBACK_TABLE
 
324
#ifdef __cplusplus
 
325
#define FT_CALLBACK_TABLE      extern "C"
 
326
#define FT_CALLBACK_TABLE_DEF  extern "C"
 
327
#else
 
328
#define FT_CALLBACK_TABLE      extern
 
329
#define FT_CALLBACK_TABLE_DEF  /* nothing */
 
330
#endif
 
331
#endif /* FT_CALLBACK_TABLE */
 
332
 
 
333
 
 
334
FT_END_HEADER
 
335
 
 
336
 
 
337
#endif /* __FTCONFIG_H__ */
 
338
 
 
339
 
 
340
/* END */