From f1e1a87d3dede2c0f6d424328c726db6d63f11ab Mon Sep 17 00:00:00 2001 From: UnknownShadow200 Date: Thu, 14 Jul 2022 22:03:53 +1000 Subject: [PATCH] Use better method of disabling freetype engine than just checking if __EMSCRIPTEN__ is defined --- src/String.h | 2 +- src/_autofit.c | 3 ++- src/_cff.c | 3 ++- src/_ftbase.c | 3 ++- src/_ftbitmap.c | 5 +++-- src/_ftglyph.c | 5 +++-- src/_ftinit.c | 4 +++- src/_ftsynth.c | 5 +++-- src/_psaux.c | 3 ++- src/_pshinter.c | 3 ++- src/_psmodule.c | 5 +++-- src/_raster.c | 3 ++- src/_sfnt.c | 5 +++-- src/_smooth.c | 3 ++- src/_truetype.c | 3 ++- src/_type1.c | 3 ++- 16 files changed, 37 insertions(+), 21 deletions(-) diff --git a/src/String.h b/src/String.h index e57d4b33b..d4d49bbf3 100644 --- a/src/String.h +++ b/src/String.h @@ -176,7 +176,7 @@ cc_unichar Convert_CP437ToUnicode(char c); /* Converts a unicode codepoint to its code page 437 equivalent, or '?' if no match. */ char Convert_CodepointToCP437(cc_codepoint cp); /* Attempts to convert a unicode codepoint to its code page 437 equivalent. */ -cc_bool Convert_TryCodepointToCP437(cc_codepoint cp, char* c); +CC_API cc_bool Convert_TryCodepointToCP437(cc_codepoint cp, char* c); /* Decodes a unicode codepoint from UTF8, returning number of bytes read. */ /* Returns 0 if not enough input data to read the character. */ int Convert_Utf8ToCodepoint(cc_codepoint* cp, const cc_uint8* data, cc_uint32 len); diff --git a/src/_autofit.c b/src/_autofit.c index aa28528ff..e48d65f25 100644 --- a/src/_autofit.c +++ b/src/_autofit.c @@ -15,7 +15,8 @@ /* */ /***************************************************************************/ -#ifndef __EMSCRIPTEN__ +#include "Core.h" +#ifdef CC_BUILD_FREETYPE #define FT_MAKE_OPTION_SINGLE_OBJECT #include "freetype/ft2build.h" diff --git a/src/_cff.c b/src/_cff.c index ebb88ef4b..8243a2441 100644 --- a/src/_cff.c +++ b/src/_cff.c @@ -15,7 +15,8 @@ /* */ /***************************************************************************/ -#ifndef __EMSCRIPTEN__ +#include "Core.h" +#ifdef CC_BUILD_FREETYPE #define FT_MAKE_OPTION_SINGLE_OBJECT #include "freetype/ft2build.h" diff --git a/src/_ftbase.c b/src/_ftbase.c index aca8ffd7c..3ca0d7ef2 100644 --- a/src/_ftbase.c +++ b/src/_ftbase.c @@ -15,7 +15,8 @@ /* */ /***************************************************************************/ -#ifndef __EMSCRIPTEN__ +#include "Core.h" +#ifdef CC_BUILD_FREETYPE #include "freetype/ft2build.h" #define FT_MAKE_OPTION_SINGLE_OBJECT diff --git a/src/_ftbitmap.c b/src/_ftbitmap.c index 8b84087d4..66a0ca364 100644 --- a/src/_ftbitmap.c +++ b/src/_ftbitmap.c @@ -15,7 +15,8 @@ /* */ /***************************************************************************/ - +#include "Core.h" +#ifdef CC_BUILD_FREETYPE #include "freetype/ft2build.h" #include FT_INTERNAL_DEBUG_H_FT @@ -807,5 +808,5 @@ return FT_Err_Ok; } - +#endif /* END */ diff --git a/src/_ftglyph.c b/src/_ftglyph.c index e82cd976e..38a0cadc5 100644 --- a/src/_ftglyph.c +++ b/src/_ftglyph.c @@ -27,7 +27,8 @@ /* */ /*************************************************************************/ - +#include "Core.h" +#ifdef CC_BUILD_FREETYPE #include "freetype/ft2build.h" #include FT_INTERNAL_DEBUG_H_FT @@ -557,5 +558,5 @@ } } - +#endif /* END */ diff --git a/src/_ftinit.c b/src/_ftinit.c index aeb60bdcf..f42472297 100644 --- a/src/_ftinit.c +++ b/src/_ftinit.c @@ -36,7 +36,8 @@ /* */ /*************************************************************************/ - +#include "Core.h" +#ifdef CC_BUILD_FREETYPE #include "freetype/ft2build.h" #include FT_CONFIG_CONFIG_H_FT #include FT_INTERNAL_OBJECTS_H_FT @@ -100,4 +101,5 @@ } } +#endif /* END */ diff --git a/src/_ftsynth.c b/src/_ftsynth.c index bf482da06..b12c0b331 100644 --- a/src/_ftsynth.c +++ b/src/_ftsynth.c @@ -15,7 +15,8 @@ /* */ /***************************************************************************/ - +#include "Core.h" +#ifdef CC_BUILD_FREETYPE #include "freetype/ft2build.h" #include FT_SYNTHESIS_H_FT #include FT_INTERNAL_DEBUG_H_FT @@ -118,5 +119,5 @@ slot->bitmap_top += (FT_Int)( ystr >> 6 ); } - +#endif /* END */ diff --git a/src/_psaux.c b/src/_psaux.c index c0efa68b9..fc7e8affe 100644 --- a/src/_psaux.c +++ b/src/_psaux.c @@ -15,7 +15,8 @@ /* */ /***************************************************************************/ -#ifndef __EMSCRIPTEN__ +#include "Core.h" +#ifdef CC_BUILD_FREETYPE #define FT_MAKE_OPTION_SINGLE_OBJECT #include "freetype/ft2build.h" diff --git a/src/_pshinter.c b/src/_pshinter.c index ec83d4198..2e0d143bc 100644 --- a/src/_pshinter.c +++ b/src/_pshinter.c @@ -15,7 +15,8 @@ /* */ /***************************************************************************/ -#ifndef __EMSCRIPTEN__ +#include "Core.h" +#ifdef CC_BUILD_FREETYPE #define FT_MAKE_OPTION_SINGLE_OBJECT #include "freetype/ft2build.h" diff --git a/src/_psmodule.c b/src/_psmodule.c index cbdebd066..019eb6430 100644 --- a/src/_psmodule.c +++ b/src/_psmodule.c @@ -15,7 +15,8 @@ /* */ /***************************************************************************/ - +#include "Core.h" +#ifdef CC_BUILD_FREETYPE #include "freetype/ft2build.h" #include FT_INTERNAL_DEBUG_H_FT #include FT_INTERNAL_OBJECTS_H_FT @@ -614,5 +615,5 @@ (FT_Module_Requester) PUT_PS_NAMES_SERVICE( psnames_get_service ) /* get_interface */ ) - +#endif /* END */ diff --git a/src/_raster.c b/src/_raster.c index c65b46c21..edddd4f4e 100644 --- a/src/_raster.c +++ b/src/_raster.c @@ -15,7 +15,8 @@ /* */ /***************************************************************************/ -#ifndef __EMSCRIPTEN__ +#include "Core.h" +#ifdef CC_BUILD_FREETYPE #define FT_MAKE_OPTION_SINGLE_OBJECT #include "freetype/ft2build.h" diff --git a/src/_sfnt.c b/src/_sfnt.c index a3a2882ea..f22d4e7e3 100644 --- a/src/_sfnt.c +++ b/src/_sfnt.c @@ -15,7 +15,8 @@ /* */ /***************************************************************************/ - +#include "Core.h" +#ifdef CC_BUILD_FREETYPE #define FT_MAKE_OPTION_SINGLE_OBJECT #include "freetype/ft2build.h" @@ -26,6 +27,6 @@ #include "freetype/ttmtx.c" #include "freetype/ttpost.c" #include "freetype/ttsbit.c" - +#endif /* END */ diff --git a/src/_smooth.c b/src/_smooth.c index 96c3d791f..c03c74ff8 100644 --- a/src/_smooth.c +++ b/src/_smooth.c @@ -15,7 +15,8 @@ /* */ /***************************************************************************/ -#ifndef __EMSCRIPTEN__ +#include "Core.h" +#ifdef CC_BUILD_FREETYPE #define FT_MAKE_OPTION_SINGLE_OBJECT #include "freetype/ft2build.h" diff --git a/src/_truetype.c b/src/_truetype.c index eaed7ecb4..034257623 100644 --- a/src/_truetype.c +++ b/src/_truetype.c @@ -15,7 +15,8 @@ /* */ /***************************************************************************/ -#ifndef __EMSCRIPTEN__ +#include "Core.h" +#ifdef CC_BUILD_FREETYPE #define FT_MAKE_OPTION_SINGLE_OBJECT #include "freetype/ft2build.h" diff --git a/src/_type1.c b/src/_type1.c index 4c6ab9d5a..490c73691 100644 --- a/src/_type1.c +++ b/src/_type1.c @@ -15,7 +15,8 @@ /* */ /***************************************************************************/ -#ifndef __EMSCRIPTEN__ +#include "Core.h" +#ifdef CC_BUILD_FREETYPE #define FT_MAKE_OPTION_SINGLE_OBJECT #include "freetype/ft2build.h"