Commit 072dc45d270f50cfdaaf831f7a883c8b1dfb4a5b

Werner Lemberg 2013-12-28T12:26:21

[autofit] Code shuffling to reduce use of cpp macros. * src/autofit/afglobal.c (af_face_globals_compute_style_coverage): Call `af_get_coverage' unconditionally. * src/autofit/autofit.c: Include `hbshim.c' unconditionally. * src/autofit/hbshim.c (af_get_coverage) [!FT_CONFIG_OPTION_USE_HARFBUZZ]: Provide dummy function. * src/autofit/hbshim.h: Provide function declarations unconditionally.

diff --git a/ChangeLog b/ChangeLog
index dd0a75e..2238497 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,5 +1,20 @@
 2013-12-28  Werner Lemberg  <wl@gnu.org>
 
+	[autofit] Code shuffling to reduce use of cpp macros.
+
+	* src/autofit/afglobal.c (af_face_globals_compute_style_coverage):
+	Call `af_get_coverage' unconditionally.
+
+	* src/autofit/autofit.c: Include `hbshim.c' unconditionally.
+
+	* src/autofit/hbshim.c (af_get_coverage)
+	[!FT_CONFIG_OPTION_USE_HARFBUZZ]: Provide dummy function.
+
+	* src/autofit/hbshim.h: Provide function declarations
+	unconditionally.
+
+2013-12-28  Werner Lemberg  <wl@gnu.org>
+
 	[autofit] Add wrapper function for `FT_Get_Char_Index'.
 
 	Yet-to-come changes will provide HarfBuzz functionality for the new
diff --git a/src/autofit/afglobal.c b/src/autofit/afglobal.c
index 4c9ee1f..9d82f94 100644
--- a/src/autofit/afglobal.c
+++ b/src/autofit/afglobal.c
@@ -193,10 +193,8 @@
         }
       }
 
-#ifdef FT_CONFIG_OPTION_USE_HARFBUZZ
       /* get glyphs not directly addressable by cmap */
       af_get_coverage( globals, style_class, gstyles );
-#endif
     }
 
     /* mark ASCII digits */
diff --git a/src/autofit/autofit.c b/src/autofit/autofit.c
index 00c5af3..e2b9934 100644
--- a/src/autofit/autofit.c
+++ b/src/autofit/autofit.c
@@ -34,9 +34,7 @@
 #include "afcjk.c"
 #include "afindic.c"
 
-#ifdef FT_CONFIG_OPTION_USE_HARFBUZZ
 #include "hbshim.c"
-#endif
 
 #include "afloader.c"
 #include "afmodule.c"
diff --git a/src/autofit/hbshim.c b/src/autofit/hbshim.c
index e9b93a2..451636e 100644
--- a/src/autofit/hbshim.c
+++ b/src/autofit/hbshim.c
@@ -294,6 +294,19 @@
 #else /* !FT_CONFIG_OPTION_USE_HARDBUZZ */
 
 
+  FT_Error
+  af_get_coverage( AF_FaceGlobals  globals,
+                   AF_StyleClass   style_class,
+                   FT_Byte*        gstyles )
+  {
+    FT_UNUSED( globals );
+    FT_UNUSED( style_class );
+    FT_UNUSED( gstyles );
+
+    return FT_Err_Ok;
+  }
+
+
   FT_UInt
   af_get_char_index( AF_StyleMetrics  metrics,
                      FT_ULong         charcode )
diff --git a/src/autofit/hbshim.h b/src/autofit/hbshim.h
index 915ca75..52b67c4 100644
--- a/src/autofit/hbshim.h
+++ b/src/autofit/hbshim.h
@@ -30,6 +30,8 @@
 #include <hb-ot.h>
 #include <hb-ft.h>
 
+#endif
+
 
 FT_BEGIN_HEADER
 
@@ -46,15 +48,6 @@ FT_BEGIN_HEADER
 
 FT_END_HEADER
 
-
-#else /* !FT_CONFIG_OPTION_USE_HARFBUZZ */
-
-  FT_UInt
-  af_get_char_index( AF_StyleMetrics  metrics,
-                     FT_ULong         charcode );
-
-#endif /* !FT_CONFIG_OPTION_USE_HARFBUZZ */
-
 #endif /* __HBSHIM_H__ */