| Index: include/freetype/internal/ftserv.h
|
| diff --git a/include/freetype/internal/ftserv.h b/include/freetype/internal/ftserv.h
|
| index 4f481db02de31baaafaab6ca95515bd780e6eead..4ac988bd2a38f4621d93445f970709c5c78fceed 100644
|
| --- a/include/freetype/internal/ftserv.h
|
| +++ b/include/freetype/internal/ftserv.h
|
| @@ -4,7 +4,7 @@
|
| /* */
|
| /* The FreeType services (specification only). */
|
| /* */
|
| -/* Copyright 2003-2007, 2009, 2012 by */
|
| +/* Copyright 2003-2007, 2009, 2012, 2013 by */
|
| /* David Turner, Robert Wilhelm, and Werner Lemberg. */
|
| /* */
|
| /* This file is part of the FreeType project, and may only be used, */
|
| @@ -34,12 +34,12 @@
|
|
|
| FT_BEGIN_HEADER
|
|
|
| -#if defined( _MSC_VER ) /* Visual C++ (and Intel C++) */
|
| -
|
| - /* we disable the warning `conditional expression is constant' here */
|
| - /* in order to compile cleanly with the maximum level of warnings */
|
| +#if defined( _MSC_VER ) /* Visual C++ (and Intel C++) */
|
| + /* We disable the warning `conditional expression is */
|
| + /* constant' in order to compile cleanly with the maximum */
|
| + /* level of warnings. */
|
| +#pragma warning( push )
|
| #pragma warning( disable : 4127 )
|
| -
|
| #endif /* _MSC_VER */
|
|
|
| /*
|
| @@ -92,6 +92,7 @@ FT_BEGIN_HEADER
|
|
|
| #endif /* !C++ */
|
|
|
| +
|
| /*
|
| * @macro:
|
| * FT_FACE_FIND_GLOBAL_SERVICE
|
| @@ -167,7 +168,13 @@ FT_BEGIN_HEADER
|
| /*************************************************************************/
|
| /* */
|
| /* <Macro> */
|
| - /* FT_DEFINE_SERVICEDESCREC1 .. FT_DEFINE_SERVICEDESCREC6 */
|
| + /* FT_DEFINE_SERVICEDESCREC1 */
|
| + /* FT_DEFINE_SERVICEDESCREC2 */
|
| + /* FT_DEFINE_SERVICEDESCREC3 */
|
| + /* FT_DEFINE_SERVICEDESCREC4 */
|
| + /* FT_DEFINE_SERVICEDESCREC5 */
|
| + /* FT_DEFINE_SERVICEDESCREC6 */
|
| + /* FT_DEFINE_SERVICEDESCREC7 */
|
| /* */
|
| /* <Description> */
|
| /* Used to initialize an array of FT_ServiceDescRec structures. */
|
| @@ -264,6 +271,26 @@ FT_BEGIN_HEADER
|
| { NULL, NULL } \
|
| };
|
|
|
| +#define FT_DEFINE_SERVICEDESCREC7( class_, \
|
| + serv_id_1, serv_data_1, \
|
| + serv_id_2, serv_data_2, \
|
| + serv_id_3, serv_data_3, \
|
| + serv_id_4, serv_data_4, \
|
| + serv_id_5, serv_data_5, \
|
| + serv_id_6, serv_data_6, \
|
| + serv_id_7, serv_data_7 ) \
|
| + static const FT_ServiceDescRec class_[] = \
|
| + { \
|
| + { serv_id_1, serv_data_1 }, \
|
| + { serv_id_2, serv_data_2 }, \
|
| + { serv_id_3, serv_data_3 }, \
|
| + { serv_id_4, serv_data_4 }, \
|
| + { serv_id_5, serv_data_5 }, \
|
| + { serv_id_6, serv_data_6 }, \
|
| + { serv_id_7, serv_data_7 }, \
|
| + { NULL, NULL } \
|
| + };
|
| +
|
| #else /* FT_CONFIG_OPTION_PIC */
|
|
|
| #define FT_DEFINE_SERVICEDESCREC1( class_, \
|
| @@ -283,7 +310,7 @@ FT_BEGIN_HEADER
|
| FT_Create_Class_ ## class_( FT_Library library, \
|
| FT_ServiceDescRec** output_class ) \
|
| { \
|
| - FT_ServiceDescRec* clazz; \
|
| + FT_ServiceDescRec* clazz = NULL; \
|
| FT_Error error; \
|
| FT_Memory memory = library->memory; \
|
| \
|
| @@ -319,7 +346,7 @@ FT_BEGIN_HEADER
|
| FT_Create_Class_ ## class_( FT_Library library, \
|
| FT_ServiceDescRec** output_class ) \
|
| { \
|
| - FT_ServiceDescRec* clazz; \
|
| + FT_ServiceDescRec* clazz = NULL; \
|
| FT_Error error; \
|
| FT_Memory memory = library->memory; \
|
| \
|
| @@ -358,7 +385,7 @@ FT_BEGIN_HEADER
|
| FT_Create_Class_ ## class_( FT_Library library, \
|
| FT_ServiceDescRec** output_class ) \
|
| { \
|
| - FT_ServiceDescRec* clazz; \
|
| + FT_ServiceDescRec* clazz = NULL; \
|
| FT_Error error; \
|
| FT_Memory memory = library->memory; \
|
| \
|
| @@ -400,7 +427,7 @@ FT_BEGIN_HEADER
|
| FT_Create_Class_ ## class_( FT_Library library, \
|
| FT_ServiceDescRec** output_class ) \
|
| { \
|
| - FT_ServiceDescRec* clazz; \
|
| + FT_ServiceDescRec* clazz = NULL; \
|
| FT_Error error; \
|
| FT_Memory memory = library->memory; \
|
| \
|
| @@ -445,7 +472,7 @@ FT_BEGIN_HEADER
|
| FT_Create_Class_ ## class_( FT_Library library, \
|
| FT_ServiceDescRec** output_class ) \
|
| { \
|
| - FT_ServiceDescRec* clazz; \
|
| + FT_ServiceDescRec* clazz = NULL; \
|
| FT_Error error; \
|
| FT_Memory memory = library->memory; \
|
| \
|
| @@ -493,7 +520,7 @@ FT_BEGIN_HEADER
|
| FT_Create_Class_ ## class_( FT_Library library, \
|
| FT_ServiceDescRec** output_class) \
|
| { \
|
| - FT_ServiceDescRec* clazz; \
|
| + FT_ServiceDescRec* clazz = NULL; \
|
| FT_Error error; \
|
| FT_Memory memory = library->memory; \
|
| \
|
| @@ -521,6 +548,59 @@ FT_BEGIN_HEADER
|
| return FT_Err_Ok; \
|
| }
|
|
|
| +#define FT_DEFINE_SERVICEDESCREC7( class_, \
|
| + serv_id_1, serv_data_1, \
|
| + serv_id_2, serv_data_2, \
|
| + serv_id_3, serv_data_3, \
|
| + serv_id_4, serv_data_4, \
|
| + serv_id_5, serv_data_5, \
|
| + serv_id_6, serv_data_6, \
|
| + serv_id_7, serv_data_7 ) \
|
| + void \
|
| + FT_Destroy_Class_ ## class_( FT_Library library, \
|
| + FT_ServiceDescRec* clazz ) \
|
| + { \
|
| + FT_Memory memory = library->memory; \
|
| + \
|
| + \
|
| + if ( clazz ) \
|
| + FT_FREE( clazz ); \
|
| + } \
|
| + \
|
| + FT_Error \
|
| + FT_Create_Class_ ## class_( FT_Library library, \
|
| + FT_ServiceDescRec** output_class) \
|
| + { \
|
| + FT_ServiceDescRec* clazz = NULL; \
|
| + FT_Error error; \
|
| + FT_Memory memory = library->memory; \
|
| + \
|
| + \
|
| + if ( FT_ALLOC( clazz, sizeof ( *clazz ) * 8 ) ) \
|
| + return error; \
|
| + \
|
| + clazz[0].serv_id = serv_id_1; \
|
| + clazz[0].serv_data = serv_data_1; \
|
| + clazz[1].serv_id = serv_id_2; \
|
| + clazz[1].serv_data = serv_data_2; \
|
| + clazz[2].serv_id = serv_id_3; \
|
| + clazz[2].serv_data = serv_data_3; \
|
| + clazz[3].serv_id = serv_id_4; \
|
| + clazz[3].serv_data = serv_data_4; \
|
| + clazz[4].serv_id = serv_id_5; \
|
| + clazz[4].serv_data = serv_data_5; \
|
| + clazz[5].serv_id = serv_id_6; \
|
| + clazz[5].serv_data = serv_data_6; \
|
| + clazz[6].serv_id = serv_id_7; \
|
| + clazz[6].serv_data = serv_data_7; \
|
| + clazz[7].serv_id = NULL; \
|
| + clazz[7].serv_data = NULL; \
|
| + \
|
| + *output_class = clazz; \
|
| + \
|
| + return FT_Err_Ok; \
|
| + }
|
| +
|
| #endif /* FT_CONFIG_OPTION_PIC */
|
|
|
|
|
| @@ -573,7 +653,9 @@ FT_BEGIN_HEADER
|
| /*
|
| * A magic number used within the services cache.
|
| */
|
| -#define FT_SERVICE_UNAVAILABLE ((FT_Pointer)-2) /* magic number */
|
| +
|
| + /* ensure that value `1' has the same width as a pointer */
|
| +#define FT_SERVICE_UNAVAILABLE ((FT_Pointer)~(FT_PtrDist)1)
|
|
|
|
|
| /*
|
| @@ -671,6 +753,7 @@ FT_BEGIN_HEADER
|
| #define FT_SERVICE_POSTSCRIPT_CMAPS_H <freetype/internal/services/svpscmap.h>
|
| #define FT_SERVICE_POSTSCRIPT_INFO_H <freetype/internal/services/svpsinfo.h>
|
| #define FT_SERVICE_POSTSCRIPT_NAME_H <freetype/internal/services/svpostnm.h>
|
| +#define FT_SERVICE_PROPERTIES_H <freetype/internal/services/svprop.h>
|
| #define FT_SERVICE_SFNT_H <freetype/internal/services/svsfnt.h>
|
| #define FT_SERVICE_TRUETYPE_ENGINE_H <freetype/internal/services/svtteng.h>
|
| #define FT_SERVICE_TT_CMAP_H <freetype/internal/services/svttcmap.h>
|
| @@ -680,6 +763,10 @@ FT_BEGIN_HEADER
|
|
|
| /* */
|
|
|
| +#if defined( _MSC_VER )
|
| +#pragma warning( pop )
|
| +#endif
|
| +
|
| FT_END_HEADER
|
|
|
| #endif /* __FTSERV_H__ */
|
|
|