1 /***************************************************************************/
5 /* ANSI-specific library and header configuration file (specification */
8 /* Copyright 2002-2007, 2009, 2011-2012 by */
9 /* David Turner, Robert Wilhelm, and Werner Lemberg. */
11 /* This file is part of the FreeType project, and may only be used, */
12 /* modified, and distributed under the terms of the FreeType project */
13 /* license, LICENSE.TXT. By continuing to use, modify, or distribute */
14 /* this file you indicate that you have read the license and */
15 /* understand and accept it fully. */
17 /***************************************************************************/
20 /*************************************************************************/
22 /* This file is used to group all #includes to the ANSI C library that */
23 /* FreeType normally requires. It also defines macros to rename the */
24 /* standard functions within the FreeType source code. */
26 /* Load a file which defines __FTSTDLIB_H__ before this one to override */
29 /*************************************************************************/
32 #ifndef __FTSTDLIB_H__
33 #define __FTSTDLIB_H__
38 #define ft_ptrdiff_t ptrdiff_t
41 /**********************************************************************/
45 /* UINT_MAX and ULONG_MAX are used to automatically compute the size */
46 /* of `int' and `long' in bytes at compile-time. So far, this works */
47 /* for all platforms the library has been tested on. */
49 /* Note that on the extremely rare platforms that do not provide */
50 /* integer types that are _exactly_ 16 and 32 bits wide (e.g. some */
51 /* old Crays where `int' is 36 bits), we do not make any guarantee */
52 /* about the correct behaviour of FT2 with all fonts. */
54 /* In these case, `ftconfig.h' will refuse to compile anyway with a */
55 /* message like `couldn't find 32-bit type' or something similar. */
57 /**********************************************************************/
62 #define FT_CHAR_BIT CHAR_BIT
63 #define FT_USHORT_MAX USHRT_MAX
64 #define FT_INT_MAX INT_MAX
65 #define FT_INT_MIN INT_MIN
66 #define FT_UINT_MAX UINT_MAX
67 #define FT_ULONG_MAX ULONG_MAX
70 /**********************************************************************/
72 /* character and string processing */
74 /**********************************************************************/
79 #define ft_memchr memchr
80 #define ft_memcmp memcmp
81 #define ft_memcpy memcpy
82 #define ft_memmove memmove
83 #define ft_memset memset
84 #define ft_strcat strcat
85 #define ft_strcmp strcmp
86 #define ft_strcpy strcpy
87 #define ft_strlen strlen
88 #define ft_strncmp strncmp
89 #define ft_strncpy strncpy
90 #define ft_strrchr strrchr
91 #define ft_strstr strstr
94 /**********************************************************************/
98 /**********************************************************************/
104 #define ft_fclose fclose
105 #define ft_fopen fopen
106 #define ft_fread fread
107 #define ft_fseek fseek
108 #define ft_ftell ftell
109 #define ft_sprintf sprintf
112 /**********************************************************************/
116 /**********************************************************************/
121 #define ft_qsort qsort
124 /**********************************************************************/
126 /* memory allocation */
128 /**********************************************************************/
131 #define ft_scalloc calloc
132 #define ft_sfree free
133 #define ft_smalloc malloc
134 #define ft_srealloc realloc
137 /**********************************************************************/
141 /**********************************************************************/
148 /**********************************************************************/
150 /* execution control */
152 /**********************************************************************/
157 #define ft_jmp_buf jmp_buf /* note: this cannot be a typedef since */
158 /* jmp_buf is defined as a macro */
159 /* on certain platforms */
161 #define ft_longjmp longjmp
162 #define ft_setjmp( b ) setjmp( *(ft_jmp_buf*) &(b) ) /* same thing here */
165 /* the following is only used for debugging purposes, i.e., if */
166 /* FT_DEBUG_LEVEL_ERROR or FT_DEBUG_LEVEL_TRACE are defined */
171 #endif /* __FTSTDLIB_H__ */