* include/freetype/fterrors.h (FT_Error_String), src/base/fterrors.c (FT_Error_String): Implement `FT_Error_String'. * src/base/ftbase.c, src/base/Jamfile (_source), src/base/rules.mk (BASE_SRC): Add `fterrors.c' to the build logic. * src/base/ftdebug.c (FT_Throw): Use `FT_Error_String'.color
parent
c0ccf75012
commit
d20dc3928b
7 changed files with 104 additions and 3 deletions
@ -0,0 +1,45 @@ |
||||
/****************************************************************************
|
||||
* |
||||
* fterrors.c |
||||
* |
||||
* FreeType API for error code handling. |
||||
* |
||||
* Copyright 2018 by |
||||
* Armin Hasitzka, 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. |
||||
* |
||||
*/ |
||||
|
||||
|
||||
#include <ft2build.h> |
||||
#include FT_ERRORS_H |
||||
|
||||
|
||||
/* documentation is in fterrors.h */ |
||||
|
||||
FT_EXPORT_DEF( const char* ) |
||||
FT_Error_String( FT_Error error_code ) |
||||
{ |
||||
if ( error_code < 0 || |
||||
error_code >= FT_ERR_CAT( FT_ERR_PREFIX, Max ) ) |
||||
return NULL; |
||||
|
||||
#if defined( FT_CONFIG_OPTION_ERROR_STRINGS ) || \ |
||||
defined( FT_DEBUG_LEVEL_ERROR ) |
||||
|
||||
#undef FTERRORS_H_ |
||||
#define FT_ERROR_START_LIST switch ( FT_ERROR_BASE( error_code ) ) { |
||||
#define FT_ERRORDEF( e, v, s ) case v: return s; |
||||
#define FT_ERROR_END_LIST } |
||||
|
||||
#include FT_ERRORS_H |
||||
|
||||
#endif /* defined( FT_CONFIG_OPTION_ERROR_STRINGS ) || ... */ |
||||
|
||||
return NULL; |
||||
} |
Loading…
Reference in new issue