diff options
author | Werner Lemberg <wl@gnu.org> | 2023-02-08 21:49:56 +0100 |
---|---|---|
committer | Werner Lemberg <wl@gnu.org> | 2023-02-08 21:53:30 +0100 |
commit | 995ccfaca5b11efa28be9202a063e0d6270f0d17 (patch) | |
tree | e5c7ae9ec52184d7617078ed95cbacf70b3c5a45 | |
parent | 663486a7acf5c1e4dd356e84c3e11d5aa6794158 (diff) | |
download | freetype2-995ccfaca5b11efa28be9202a063e0d6270f0d17.tar.gz |
[autofit] Fix 'multi' compilation.
* src/autofit/ft-hb.c: Decorate with `FT_LOCAL_DEF`.
Add ANSI boilerplate code for otherwise empty file.
* src/autofit/ft-hb.h: Include `compiler-macros.h` and `freetype.h`.
Use `FT_BEGIN_HEADER` and `FT_END_HEADER`.
Decorate with `FT_LOCAL`.
* src/autofit/rules.mk (AUTOF_DRV_SRC): Add `ft-hb.c`.
-rw-r--r-- | src/autofit/ft-hb.c | 11 | ||||
-rw-r--r-- | src/autofit/ft-hb.h | 19 | ||||
-rw-r--r-- | src/autofit/rules.mk | 1 |
3 files changed, 26 insertions, 5 deletions
diff --git a/src/autofit/ft-hb.c b/src/autofit/ft-hb.c index 260ebdc1b..09a8401c4 100644 --- a/src/autofit/ft-hb.c +++ b/src/autofit/ft-hb.c @@ -92,7 +92,7 @@ hb_ft_face_create_ (FT_Face ft_face, return face; } -hb_font_t * +FT_LOCAL_DEF(hb_font_t *) hb_ft_font_create_ (FT_Face ft_face, hb_destroy_func_t destroy) { @@ -105,4 +105,11 @@ hb_ft_font_create_ (FT_Face ft_face, return font; } -#endif +#else /* !FT_CONFIG_OPTION_USE_HARFBUZZ */ + +/* ANSI C doesn't like empty source files */ +typedef int _ft_hb_dummy; + +#endif /* !FT_CONFIG_OPTION_USE_HARFBUZZ */ + +/* END */ diff --git a/src/autofit/ft-hb.h b/src/autofit/ft-hb.h index 0d3ca206d..92a5774bc 100644 --- a/src/autofit/ft-hb.h +++ b/src/autofit/ft-hb.h @@ -29,7 +29,20 @@ #include <hb.h> -hb_font_t * hb_ft_font_create_ (FT_Face ft_face, - hb_destroy_func_t destroy); +#include <freetype/internal/compiler-macros.h> +#include <freetype/freetype.h> -#endif + +FT_BEGIN_HEADER + +FT_LOCAL(hb_font_t *) +hb_ft_font_create_ (FT_Face ft_face, + hb_destroy_func_t destroy); + + +FT_END_HEADER + +#endif /* FT_HB_H */ + + +/* END */ diff --git a/src/autofit/rules.mk b/src/autofit/rules.mk index 4b6fcfbdd..a46ba3f0f 100644 --- a/src/autofit/rules.mk +++ b/src/autofit/rules.mk @@ -39,6 +39,7 @@ AUTOF_DRV_SRC := $(AUTOF_DIR)/afblue.c \ $(AUTOF_DIR)/afmodule.c \ $(AUTOF_DIR)/afranges.c \ $(AUTOF_DIR)/afshaper.c \ + $(AUTOF_DIR)/ft-hb.c # AUTOF driver headers # |