OLD | NEW |
1 /***************************************************************************/ | 1 /***************************************************************************/ |
2 /* */ | 2 /* */ |
3 /* fterrors.h */ | 3 /* fterrors.h */ |
4 /* */ | 4 /* */ |
5 /* FreeType error code handling (specification). */ | 5 /* FreeType error code handling (specification). */ |
6 /* */ | 6 /* */ |
7 /* Copyright 1996-2001, 2002, 2004, 2007 by */ | 7 /* Copyright 1996-2002, 2004, 2007, 2013 by */ |
8 /* David Turner, Robert Wilhelm, and Werner Lemberg. */ | 8 /* David Turner, Robert Wilhelm, and Werner Lemberg. */ |
9 /* */ | 9 /* */ |
10 /* This file is part of the FreeType project, and may only be used, */ | 10 /* This file is part of the FreeType project, and may only be used, */ |
11 /* modified, and distributed under the terms of the FreeType project */ | 11 /* modified, and distributed under the terms of the FreeType project */ |
12 /* license, LICENSE.TXT. By continuing to use, modify, or distribute */ | 12 /* license, LICENSE.TXT. By continuing to use, modify, or distribute */ |
13 /* this file you indicate that you have read the license and */ | 13 /* this file you indicate that you have read the license and */ |
14 /* understand and accept it fully. */ | 14 /* understand and accept it fully. */ |
15 /* */ | 15 /* */ |
16 /***************************************************************************/ | 16 /***************************************************************************/ |
17 | 17 |
18 | 18 |
19 /*************************************************************************/ | 19 /*************************************************************************/ |
20 /* */ | 20 /* */ |
21 /* This special header file is used to define the handling of FT2 */ | 21 /* This special header file is used to define the handling of FT2 */ |
22 /* enumeration constants. It can also be used to generate error message */ | 22 /* enumeration constants. It can also be used to generate error message */ |
23 /* strings with a small macro trick explained below. */ | 23 /* strings with a small macro trick explained below. */ |
24 /* */ | 24 /* */ |
25 /* I - Error Formats */ | 25 /* I - Error Formats */ |
26 /* ----------------- */ | 26 /* ----------------- */ |
27 /* */ | 27 /* */ |
28 /* The configuration macro FT_CONFIG_OPTION_USE_MODULE_ERRORS can be */ | 28 /* The configuration macro FT_CONFIG_OPTION_USE_MODULE_ERRORS can be */ |
29 /* defined in ftoption.h in order to make the higher byte indicate */ | 29 /* defined in ftoption.h in order to make the higher byte indicate */ |
30 /* the module where the error has happened (this is not compatible */ | 30 /* the module where the error has happened (this is not compatible */ |
31 /* with standard builds of FreeType 2). You can then use the macro */ | 31 /* with standard builds of FreeType 2). See the file `ftmoderr.h' for */ |
32 /* FT_ERROR_BASE macro to extract the generic error code from an */ | 32 /* more details. */ |
33 /* FT_Error value. */ | |
34 /* */ | 33 /* */ |
35 /* */ | 34 /* */ |
36 /* II - Error Message strings */ | 35 /* II - Error Message strings */ |
37 /* -------------------------- */ | 36 /* -------------------------- */ |
38 /* */ | 37 /* */ |
39 /* The error definitions below are made through special macros that */ | 38 /* The error definitions below are made through special macros that */ |
40 /* allow client applications to build a table of error message strings */ | 39 /* allow client applications to build a table of error message strings */ |
41 /* if they need it. The strings are not included in a normal build of */ | 40 /* if they need it. The strings are not included in a normal build of */ |
42 /* FreeType 2 to save space (most client applications do not use */ | 41 /* FreeType 2 to save space (most client applications do not use */ |
43 /* them). */ | 42 /* them). */ |
(...skipping 50 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
94 /*******************************************************************/ | 93 /*******************************************************************/ |
95 /***** *****/ | 94 /***** *****/ |
96 /***** SETUP MACROS *****/ | 95 /***** SETUP MACROS *****/ |
97 /***** *****/ | 96 /***** *****/ |
98 /*******************************************************************/ | 97 /*******************************************************************/ |
99 /*******************************************************************/ | 98 /*******************************************************************/ |
100 | 99 |
101 | 100 |
102 #undef FT_NEED_EXTERN_C | 101 #undef FT_NEED_EXTERN_C |
103 | 102 |
104 #undef FT_ERR_XCAT | |
105 #undef FT_ERR_CAT | |
106 | |
107 #define FT_ERR_XCAT( x, y ) x ## y | |
108 #define FT_ERR_CAT( x, y ) FT_ERR_XCAT( x, y ) | |
109 | |
110 | 103 |
111 /* FT_ERR_PREFIX is used as a prefix for error identifiers. */ | 104 /* FT_ERR_PREFIX is used as a prefix for error identifiers. */ |
112 /* By default, we use `FT_Err_'. */ | 105 /* By default, we use `FT_Err_'. */ |
113 /* */ | 106 /* */ |
114 #ifndef FT_ERR_PREFIX | 107 #ifndef FT_ERR_PREFIX |
115 #define FT_ERR_PREFIX FT_Err_ | 108 #define FT_ERR_PREFIX FT_Err_ |
116 #endif | 109 #endif |
117 | 110 |
118 | 111 |
119 /* FT_ERR_BASE is used as the base for module-specific errors. */ | 112 /* FT_ERR_BASE is used as the base for module-specific errors. */ |
(...skipping 23 matching lines...) Expand all Loading... |
143 | 136 |
144 #ifdef __cplusplus | 137 #ifdef __cplusplus |
145 #define FT_NEED_EXTERN_C | 138 #define FT_NEED_EXTERN_C |
146 extern "C" { | 139 extern "C" { |
147 #endif | 140 #endif |
148 | 141 |
149 #endif /* !FT_ERRORDEF */ | 142 #endif /* !FT_ERRORDEF */ |
150 | 143 |
151 | 144 |
152 /* this macro is used to define an error */ | 145 /* this macro is used to define an error */ |
153 #define FT_ERRORDEF_( e, v, s ) \ | 146 #define FT_ERRORDEF_( e, v, s ) \ |
154 FT_ERRORDEF( FT_ERR_CAT( FT_ERR_PREFIX, e ), v + FT_ERR_BASE, s ) | 147 FT_ERRORDEF( FT_ERR_CAT( FT_ERR_PREFIX, e ), v + FT_ERR_BASE, s ) |
155 | 148 |
156 /* this is only used for <module>_Err_Ok, which must be 0! */ | 149 /* this is only used for <module>_Err_Ok, which must be 0! */ |
157 #define FT_NOERRORDEF_( e, v, s ) \ | 150 #define FT_NOERRORDEF_( e, v, s ) \ |
158 FT_ERRORDEF( FT_ERR_CAT( FT_ERR_PREFIX, e ), v, s ) | 151 FT_ERRORDEF( FT_ERR_CAT( FT_ERR_PREFIX, e ), v, s ) |
159 | 152 |
160 | 153 |
161 #ifdef FT_ERROR_START_LIST | 154 #ifdef FT_ERROR_START_LIST |
162 FT_ERROR_START_LIST | 155 FT_ERROR_START_LIST |
163 #endif | 156 #endif |
164 | 157 |
165 | 158 |
166 /* now include the error codes */ | 159 /* now include the error codes */ |
167 #include FT_ERROR_DEFINITIONS_H | 160 #include FT_ERROR_DEFINITIONS_H |
(...skipping 19 matching lines...) Expand all Loading... |
187 #undef FT_ERROR_START_LIST | 180 #undef FT_ERROR_START_LIST |
188 #undef FT_ERROR_END_LIST | 181 #undef FT_ERROR_END_LIST |
189 | 182 |
190 #undef FT_ERRORDEF | 183 #undef FT_ERRORDEF |
191 #undef FT_ERRORDEF_ | 184 #undef FT_ERRORDEF_ |
192 #undef FT_NOERRORDEF_ | 185 #undef FT_NOERRORDEF_ |
193 | 186 |
194 #undef FT_NEED_EXTERN_C | 187 #undef FT_NEED_EXTERN_C |
195 #undef FT_ERR_BASE | 188 #undef FT_ERR_BASE |
196 | 189 |
197 /* FT_KEEP_ERR_PREFIX is needed for ftvalid.h */ | 190 /* FT_ERR_PREFIX is needed internally */ |
198 #ifndef FT_KEEP_ERR_PREFIX | 191 #ifndef FT2_BUILD_LIBRARY |
199 #undef FT_ERR_PREFIX | 192 #undef FT_ERR_PREFIX |
200 #else | |
201 #undef FT_KEEP_ERR_PREFIX | |
202 #endif | 193 #endif |
203 | 194 |
204 #endif /* __FTERRORS_H__ */ | 195 #endif /* __FTERRORS_H__ */ |
205 | 196 |
206 | 197 |
207 /* END */ | 198 /* END */ |
OLD | NEW |