Silence unused function warnings. Some static function declarations cause unused function warnings if certain config options are turned off via `ftoption.h'. * src/base/ftbase.h, src/base/ftrfork.c, src/sfnt/ttbdf.h, src/truetype/ttgxvar.h: Add #ifdef guards around these sections.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106
diff --git a/ChangeLog b/ChangeLog
index 82d6f2c..40b09b9 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,13 @@
+2017-11-23 Tor Andersson <tor.andersson@artifex.com>
+
+ Silence unused function warnings.
+
+ Some static function declarations cause unused function warnings if
+ certain config options are turned off via `ftoption.h'.
+
+ * src/base/ftbase.h, src/base/ftrfork.c, src/sfnt/ttbdf.h,
+ src/truetype/ttgxvar.h: Add #ifdef guards around these sections.
+
2017-11-22 Ewald Hew <ewaldhew@gmail.com>
* src/psaux/psft.c (cf2_setGlyphWidth): Check format before setting.
diff --git a/src/base/ftbase.h b/src/base/ftbase.h
index 2072284..a4493cc 100644
--- a/src/base/ftbase.h
+++ b/src/base/ftbase.h
@@ -2,7 +2,7 @@
/* */
/* ftbase.h */
/* */
-/* The FreeType private functions used in base module (specification). */
+/* Private functions used in the `base' module (specification). */
/* */
/* Copyright 2008-2017 by */
/* David Turner, Robert Wilhelm, Werner Lemberg, and suzuki toshiya. */
@@ -27,6 +27,8 @@
FT_BEGIN_HEADER
+#ifdef FT_CONFIG_OPTION_MAC_FONTS
+
/* MacOS resource fork cannot exceed 16MB at least for Carbon code; */
/* see https://support.microsoft.com/en-us/kb/130437 */
#define FT_MAC_RFORK_MAX_LEN 0x00FFFFFFUL
@@ -65,6 +67,8 @@ FT_BEGIN_HEADER
ft_raccess_rule_by_darwin_vfs( FT_Library library, FT_UInt rule_index );
#endif
+#endif /* FT_CONFIG_OPTION_MAC_FONTS */
+
FT_END_HEADER
diff --git a/src/base/ftrfork.c b/src/base/ftrfork.c
index f5ad287..b86cf8c 100644
--- a/src/base/ftrfork.c
+++ b/src/base/ftrfork.c
@@ -478,7 +478,7 @@
}
-#ifndef FT_MACINTOSH
+#if defined( FT_CONFIG_OPTION_MAC_FONTS ) && !defined( FT_MACINTOSH )
static FT_RFork_Rule
raccess_get_rule_type_from_rule_index( FT_Library library,
FT_UInt rule_index )
diff --git a/src/sfnt/ttbdf.h b/src/sfnt/ttbdf.h
index 398b620..31d4ab1 100644
--- a/src/sfnt/ttbdf.h
+++ b/src/sfnt/ttbdf.h
@@ -28,6 +28,8 @@
FT_BEGIN_HEADER
+#ifdef TT_CONFIG_OPTION_BDF
+
FT_LOCAL( void )
tt_face_free_bdf_props( TT_Face face );
@@ -37,6 +39,8 @@ FT_BEGIN_HEADER
const char* property_name,
BDF_PropertyRec *aprop );
+#endif /* TT_CONFIG_OPTION_BDF */
+
FT_END_HEADER
diff --git a/src/truetype/ttgxvar.h b/src/truetype/ttgxvar.h
index a9a1165..bce66ee 100644
--- a/src/truetype/ttgxvar.h
+++ b/src/truetype/ttgxvar.h
@@ -27,6 +27,8 @@
FT_BEGIN_HEADER
+#ifdef TT_CONFIG_OPTION_GX_VAR_SUPPORT
+
/*************************************************************************/
/* */
/* <Struct> */
@@ -439,6 +441,8 @@ FT_BEGIN_HEADER
FT_LOCAL( void )
tt_done_blend( TT_Face face );
+#endif /* TT_CONFIG_OPTION_GX_VAR_SUPPORT */
+
FT_END_HEADER