Commit f9be567f5f6703e68980761f54ef3d896b63185b

Werner Lemberg 2015-07-09T15:10:31

Better support of user-supplied C++ namespaces. See http://lists.nongnu.org/archive/html/freetype-devel/2015-07/msg00008.html for a rationale. * src/autofit/afpic.h, src/base/basepic.h, src/cff/cffpic.h, src/pshinter/pshpic.h, src/psnames/pspic.h, src/raster/rastpic.h, src/sfnt/sfntpic.h, src/smooth/ftspic.h, src/truetype/ttpic.h (FT_BEGIN_HEADER, FT_END_HEADER): Move macro calls to not enclose header files that contain FT_{BEGIN,END}_HEADER macros by themselves. * src/autofit/aftypes.h [FT_DEBUG_AUTOFIT]: Include FT_CONFIG_STANDARD_LIBRARY_H earlier. * src/truetype/ttpic.h: Include FT_INTERNL_PIC_H.

diff --git a/ChangeLog b/ChangeLog
index 76375f5..2827043 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,25 @@
+2015-07-09  Werner Lemberg  <wl@gnu.org>
+
+	Better support of user-supplied C++ namespaces.
+
+	See
+
+	  http://lists.nongnu.org/archive/html/freetype-devel/2015-07/msg00008.html
+
+	for a rationale.
+
+	* src/autofit/afpic.h, src/base/basepic.h, src/cff/cffpic.h,
+	src/pshinter/pshpic.h, src/psnames/pspic.h, src/raster/rastpic.h,
+	src/sfnt/sfntpic.h, src/smooth/ftspic.h, src/truetype/ttpic.h
+	(FT_BEGIN_HEADER, FT_END_HEADER): Move macro calls to not enclose
+	header files that contain FT_{BEGIN,END}_HEADER macros by
+	themselves.
+
+	* src/autofit/aftypes.h [FT_DEBUG_AUTOFIT]: Include
+	FT_CONFIG_STANDARD_LIBRARY_H earlier.
+
+	* src/truetype/ttpic.h: Include FT_INTERNL_PIC_H.
+
 2015-07-07  Werner Lemberg  <wl@gnu.org>
 
 	[sfnt] Make `tt_face_get_name' member of the SFNT interface.
diff --git a/src/autofit/afpic.h b/src/autofit/afpic.h
index 25071e3..9b45069 100644
--- a/src/autofit/afpic.h
+++ b/src/autofit/afpic.h
@@ -20,8 +20,6 @@
 #define __AFPIC_H__
 
 
-FT_BEGIN_HEADER
-
 #include FT_INTERNAL_PIC_H
 
 
@@ -43,6 +41,8 @@ FT_BEGIN_HEADER
 #include "aftypes.h"
 
 
+FT_BEGIN_HEADER
+
   typedef struct  AFModulePIC_
   {
     FT_ServiceDescRec*          af_services;
@@ -93,12 +93,12 @@ FT_BEGIN_HEADER
   FT_Error
   autofit_module_class_pic_init( FT_Library  library );
 
+FT_END_HEADER
+
 #endif /* FT_CONFIG_OPTION_PIC */
 
  /* */
 
-FT_END_HEADER
-
 #endif /* __AFPIC_H__ */
 
 
diff --git a/src/autofit/aftypes.h b/src/autofit/aftypes.h
index 78e3fd7..fdf7978 100644
--- a/src/autofit/aftypes.h
+++ b/src/autofit/aftypes.h
@@ -41,6 +41,10 @@
 
 #include "afblue.h"
 
+#ifdef FT_DEBUG_AUTOFIT
+#include FT_CONFIG_STANDARD_LIBRARY_H
+#endif
+
 
 FT_BEGIN_HEADER
 
@@ -54,8 +58,6 @@ FT_BEGIN_HEADER
 
 #ifdef FT_DEBUG_AUTOFIT
 
-#include FT_CONFIG_STANDARD_LIBRARY_H
-
 extern int    _af_debug_disable_horz_hints;
 extern int    _af_debug_disable_vert_hints;
 extern int    _af_debug_disable_blue_hints;
diff --git a/src/base/basepic.h b/src/base/basepic.h
index 51ecf9e..c5d7cbf 100644
--- a/src/base/basepic.h
+++ b/src/base/basepic.h
@@ -20,10 +20,9 @@
 #define __BASEPIC_H__
 
 
-FT_BEGIN_HEADER
-
 #include FT_INTERNAL_PIC_H
 
+
 #ifndef FT_CONFIG_OPTION_PIC
 
 #define FT_OUTLINE_GLYPH_CLASS_GET  &ft_outline_glyph_class
@@ -43,6 +42,8 @@ FT_BEGIN_HEADER
 #endif
 
 
+FT_BEGIN_HEADER
+
   typedef struct  BasePIC_
   {
     FT_Module_Class**  default_module_classes;
@@ -78,12 +79,12 @@ FT_BEGIN_HEADER
   FT_Error
   ft_base_pic_init( FT_Library  library );
 
+FT_END_HEADER
+
 #endif /* FT_CONFIG_OPTION_PIC */
 
   /* */
 
-FT_END_HEADER
-
 #endif /* __BASEPIC_H__ */
 
 
diff --git a/src/cff/cffpic.h b/src/cff/cffpic.h
index a29620e..9a221a7 100644
--- a/src/cff/cffpic.h
+++ b/src/cff/cffpic.h
@@ -20,8 +20,6 @@
 #define __CFFPIC_H__
 
 
-FT_BEGIN_HEADER
-
 #include FT_INTERNAL_PIC_H
 
 
@@ -49,6 +47,8 @@ FT_BEGIN_HEADER
 #include FT_SERVICE_PROPERTIES_H
 
 
+FT_BEGIN_HEADER
+
   typedef struct  CffModulePIC_
   {
     FT_ServiceDescRec*        cff_services;
@@ -96,12 +96,12 @@ FT_BEGIN_HEADER
   FT_Error
   cff_driver_class_pic_init( FT_Library  library );
 
+FT_END_HEADER
+
 #endif /* FT_CONFIG_OPTION_PIC */
 
  /* */
 
-FT_END_HEADER
-
 #endif /* __CFFPIC_H__ */
 
 
diff --git a/src/pshinter/pshpic.h b/src/pshinter/pshpic.h
index 62de457..ca35cd6 100644
--- a/src/pshinter/pshpic.h
+++ b/src/pshinter/pshpic.h
@@ -20,8 +20,6 @@
 #define __PSHPIC_H__
 
 
-FT_BEGIN_HEADER
-
 #include FT_INTERNAL_PIC_H
 
 
@@ -33,6 +31,8 @@ FT_BEGIN_HEADER
 
 #include FT_INTERNAL_POSTSCRIPT_HINTS_H
 
+FT_BEGIN_HEADER
+
   typedef struct  PSHinterPIC_
   {
     PSHinter_Interface  pshinter_interface;
@@ -51,12 +51,12 @@ FT_BEGIN_HEADER
   FT_Error
   pshinter_module_class_pic_init( FT_Library  library );
 
+FT_END_HEADER
+
 #endif /* FT_CONFIG_OPTION_PIC */
 
  /* */
 
-FT_END_HEADER
-
 #endif /* __PSHPIC_H__ */
 
 
diff --git a/src/psnames/pspic.h b/src/psnames/pspic.h
index 88ccda3..443225a 100644
--- a/src/psnames/pspic.h
+++ b/src/psnames/pspic.h
@@ -20,10 +20,9 @@
 #define __PSPIC_H__
 
 
-FT_BEGIN_HEADER
-
 #include FT_INTERNAL_PIC_H
 
+
 #ifndef FT_CONFIG_OPTION_PIC
 
 #define PSCMAPS_SERVICES_GET   pscmaps_services
@@ -33,6 +32,9 @@ FT_BEGIN_HEADER
 
 #include FT_SERVICE_POSTSCRIPT_CMAPS_H
 
+
+FT_BEGIN_HEADER
+
   typedef struct  PSModulePIC_
   {
     FT_ServiceDescRec*     pscmaps_services;
@@ -54,12 +56,12 @@ FT_BEGIN_HEADER
   FT_Error
   psnames_module_class_pic_init( FT_Library  library );
 
+FT_END_HEADER
+
 #endif /* FT_CONFIG_OPTION_PIC */
 
  /* */
 
-FT_END_HEADER
-
 #endif /* __PSPIC_H__ */
 
 
diff --git a/src/raster/rastpic.h b/src/raster/rastpic.h
index a875884..c12d75b 100644
--- a/src/raster/rastpic.h
+++ b/src/raster/rastpic.h
@@ -20,11 +20,11 @@
 #define __RASTPIC_H__
 
 
-FT_BEGIN_HEADER
-
 #include FT_INTERNAL_PIC_H
 
 
+FT_BEGIN_HEADER
+
 #ifndef FT_CONFIG_OPTION_PIC
 
 #define FT_STANDARD_RASTER_GET  ft_standard_raster
diff --git a/src/sfnt/sfntpic.h b/src/sfnt/sfntpic.h
index 82d7427..d99be6a 100644
--- a/src/sfnt/sfntpic.h
+++ b/src/sfnt/sfntpic.h
@@ -20,8 +20,6 @@
 #define __SFNTPIC_H__
 
 
-FT_BEGIN_HEADER
-
 #include FT_INTERNAL_PIC_H
 
 
@@ -55,6 +53,8 @@ FT_BEGIN_HEADER
 #include "ttcmap.h"
 
 
+FT_BEGIN_HEADER
+
   typedef struct  sfntModulePIC_
   {
     FT_ServiceDescRec*        sfnt_services;
@@ -99,12 +99,13 @@ FT_BEGIN_HEADER
   FT_Error
   sfnt_module_class_pic_init( FT_Library  library );
 
+
+FT_END_HEADER
+
 #endif /* FT_CONFIG_OPTION_PIC */
 
   /* */
 
-FT_END_HEADER
-
 #endif /* __SFNTPIC_H__ */
 
 
diff --git a/src/smooth/ftspic.h b/src/smooth/ftspic.h
index 99b9f0e..071afcf 100644
--- a/src/smooth/ftspic.h
+++ b/src/smooth/ftspic.h
@@ -20,10 +20,11 @@
 #define __FTSPIC_H__
 
 
-FT_BEGIN_HEADER
-
 #include FT_INTERNAL_PIC_H
 
+
+FT_BEGIN_HEADER
+
 #ifndef FT_CONFIG_OPTION_PIC
 
 #define FT_GRAYS_RASTER_GET  ft_grays_raster
diff --git a/src/truetype/ttpic.h b/src/truetype/ttpic.h
index 48ba4aa..076ae56 100644
--- a/src/truetype/ttpic.h
+++ b/src/truetype/ttpic.h
@@ -20,7 +20,8 @@
 #define __TTPIC_H__
 
 
-FT_BEGIN_HEADER
+#include FT_INTERNAL_PIC_H
+
 
 #ifndef FT_CONFIG_OPTION_PIC
 
@@ -37,6 +38,8 @@ FT_BEGIN_HEADER
 #include FT_SERVICE_PROPERTIES_H
 
 
+FT_BEGIN_HEADER
+
   typedef struct  TTModulePIC_
   {
     FT_ServiceDescRec*          tt_services;
@@ -68,13 +71,12 @@ FT_BEGIN_HEADER
   FT_Error
   tt_driver_class_pic_init( FT_Library  library );
 
+FT_END_HEADER
+
 #endif /* FT_CONFIG_OPTION_PIC */
 
  /* */
 
-
-FT_END_HEADER
-
 #endif /* __TTPIC_H__ */