Commit 2f1863cfb72f72fc9a454c8cb91cc711f56d01bd

Tor Andersson 2017-11-23T20:40:52

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.

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