On Sat, Jul 16, 2011 at 3:24 AM, Werner LEMBERG <w...@gnu.org> wrote: > >> Made this change to save ~3k of codespace in an embedded system by >> using system libraries without stream support. > > Thanks. Please make this a `real' patch, this is, add your macro > (renamed to FT_CONFIG_...) to both ftoption.h files, with proper > documentation comment, and provide a ChangeLog entry. > > > Werner >
Here is an updated version and a changelog entry. I'm not sure if I'm 100% happy with the wording of the option comment though. Please let me know if there are other changes that I should make here. Changelog ---------------------- Chris Morgan <cmor...@cybexintl.com> Add FT_CONFIG_DISABLE_STREAM_SUPPORT that when defined will conditionalize out the use of file stream functions and types, FILE, fopen() etc. Enables the use of smaller system libraries on embedded systems that have multiple system libraries, some with or without file stream support, in the cases where file stream support is not necessary such as memory loading of font files. Chris
Index: include/freetype/config/ftoption.h =================================================================== --- include/freetype/config/ftoption.h (revision 7) +++ include/freetype/config/ftoption.h (working copy) @@ -775,6 +775,15 @@ /* + * Define to disable the use of file stream functions and types, FILE, fopen() etc. Enables the use of + * smaller system libraries on embedded systems that have multiple system libraries, some with or without + * file stream support, in the cases where file stream support is not necessary such as memory loading + * of font files. + */ +/* #define FT_CONFIG_DISABLE_STREAM_SUPPORT */ + + + /* * This macro is defined if either unpatented or native TrueType * hinting is requested by the definitions above. */ Index: src/base/ftsystem.c =================================================================== --- src/base/ftsystem.c (revision 7) +++ src/base/ftsystem.c (working copy) @@ -137,7 +137,7 @@ /* */ /*************************************************************************/ - +#if !defined(FT_CONFIG_DISABLE_STREAM_SUPPORT) /*************************************************************************/ /* */ /* The macro FT_COMPONENT is used in trace mode. It is an implicit */ @@ -266,8 +266,8 @@ return FT_Err_Ok; } +#endif // #if !defined(FT_CONFIG_DISABLE_STREAM_SUPPORT) - #ifdef FT_DEBUG_MEMORY extern FT_Int Index: src/base/ftobjs.c =================================================================== --- src/base/ftobjs.c (revision 7) +++ src/base/ftobjs.c (working copy) @@ -155,6 +155,7 @@ (const FT_Byte*)args->memory_base, args->memory_size ); } +#if !defined(FT_CONFIG_DISABLE_STREAM_SUPPORT) else if ( args->flags & FT_OPEN_PATHNAME ) { /* create a normal system stream */ @@ -170,6 +171,7 @@ FT_FREE( stream ); stream = args->stream; } +#endif else error = FT_Err_Invalid_Argument; Index: devel/ftoption.h =================================================================== --- devel/ftoption.h (revision 7) +++ devel/ftoption.h (working copy) @@ -775,6 +775,15 @@ /* + * Define to disable the use of file stream functions and types, FILE, fopen() etc. Enables the use of + * smaller system libraries on embedded systems that have multiple system libraries, some with or without + * file stream support, in the cases where file stream support is not necessary such as memory loading + * of font files. + */ +/* #define FT_CONFIG_DISABLE_STREAM_SUPPORT */ + + + /* * This macro is defined if either unpatented or native TrueType * hinting is requested by the definitions above. */
_______________________________________________ Freetype-devel mailing list Freetype-devel@nongnu.org https://lists.nongnu.org/mailman/listinfo/freetype-devel