Commit cb4a943bc4d24d48eeb5d1515c5acd880c4a82ab

David Turner 2020-07-06T10:56:36

[build] Fix multi and C++ builds. The following builds were failing due to previous changes: make multi make multi CC="c++" * include/freetype/config/ftconfig.h: Remove `FT_END_HEADER'. * include/freetype/config/ftheader.h (FT_BEGIN_HEADER, FT_END_HEADER): Protect against redefinition. * src/cache/ftccache.h, src/cache/ftcmru.h, src/pcf/pcfutil.h, src/psaux/pserror.h, src/psaux/psft.h, src/psaux/psstack.h, src/sfnt/woff2tags.h: Include `compiler-macros.h'. * src/sfnt/woff2tags.c: Include `woff2tags.h'.

diff --git a/ChangeLog b/ChangeLog
index 45a5f97..7bf83a0 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,23 @@
+2020-07-06  David Turner  <david@freetype.org>
+
+	[build] Fix multi and C++ builds.
+
+	The following builds were failing due to previous changes:
+
+	  make multi
+	  make multi CC="c++"
+
+	* include/freetype/config/ftconfig.h: Remove `FT_END_HEADER'.
+
+	* include/freetype/config/ftheader.h (FT_BEGIN_HEADER,
+	FT_END_HEADER): Protect against redefinition.
+
+	* src/cache/ftccache.h, src/cache/ftcmru.h, src/pcf/pcfutil.h,
+	src/psaux/pserror.h, src/psaux/psft.h, src/psaux/psstack.h,
+	src/sfnt/woff2tags.h: Include `compiler-macros.h'.
+
+	* src/sfnt/woff2tags.c: Include `woff2tags.h'.
+
 2020-07-06  Werner Lemberg  <wl@gnu.org>
 
 	[psaux] Improve `t1_decoder_parse_metrics' (#58646).
diff --git a/include/freetype/config/ftconfig.h b/include/freetype/config/ftconfig.h
index d59f293..b464e0b 100644
--- a/include/freetype/config/ftconfig.h
+++ b/include/freetype/config/ftconfig.h
@@ -45,9 +45,6 @@
 #include <freetype/config/public-macros.h>
 #include <freetype/config/mac-support.h>
 
-FT_END_HEADER
-
-
 #endif /* FTCONFIG_H_ */
 
 
diff --git a/include/freetype/config/ftheader.h b/include/freetype/config/ftheader.h
index b028ece..28b5cc6 100644
--- a/include/freetype/config/ftheader.h
+++ b/include/freetype/config/ftheader.h
@@ -30,10 +30,12 @@
   /*    encapsulated in an `extern "C" { .. }` block when included from a  */
   /*    C++ compiler.                                                      */
   /*                                                                       */
-#ifdef __cplusplus
-#define FT_BEGIN_HEADER  extern "C" {
-#else
-#define FT_BEGIN_HEADER  /* nothing */
+#ifndef FT_BEGIN_HEADER
+#  ifdef __cplusplus
+#    define FT_BEGIN_HEADER  extern "C" {
+#  else
+#  define FT_BEGIN_HEADER  /* nothing */
+#  endif
 #endif
 
 
@@ -48,10 +50,12 @@
   /*    encapsulated in an `extern "C" { .. }` block when included from a  */
   /*    C++ compiler.                                                      */
   /*                                                                       */
-#ifdef __cplusplus
-#define FT_END_HEADER  }
-#else
-#define FT_END_HEADER  /* nothing */
+#ifndef FT_END_HEADER
+#  ifdef __cplusplus
+#    define FT_END_HEADER  }
+#  else
+#   define FT_END_HEADER  /* nothing */
+#  endif
 #endif
 
 
diff --git a/src/cache/ftccache.h b/src/cache/ftccache.h
index 2996ee8..11698bb 100644
--- a/src/cache/ftccache.h
+++ b/src/cache/ftccache.h
@@ -19,7 +19,7 @@
 #ifndef FTCCACHE_H_
 #define FTCCACHE_H_
 
-
+#include <freetype/internal/compiler-macros.h>
 #include "ftcmru.h"
 
 FT_BEGIN_HEADER
diff --git a/src/cache/ftcmru.h b/src/cache/ftcmru.h
index e7c2a8f..ac4f9b1 100644
--- a/src/cache/ftcmru.h
+++ b/src/cache/ftcmru.h
@@ -45,6 +45,7 @@
 
 
 #include <freetype/freetype.h>
+#include <freetype/internal/compiler-macros.h>
 
 #ifdef FREETYPE_H
 #error "freetype.h of FreeType 1 has been loaded!"
diff --git a/src/pcf/pcfutil.h b/src/pcf/pcfutil.h
index be986e7..a197c15 100644
--- a/src/pcf/pcfutil.h
+++ b/src/pcf/pcfutil.h
@@ -31,7 +31,7 @@ THE SOFTWARE.
 
 #include <ft2build.h>
 #include FT_CONFIG_CONFIG_H
-
+#include <freetype/internal/compiler-macros.h>
 
 FT_BEGIN_HEADER
 
diff --git a/src/psaux/pserror.h b/src/psaux/pserror.h
index eb0a865..5738853 100644
--- a/src/psaux/pserror.h
+++ b/src/psaux/pserror.h
@@ -50,6 +50,7 @@
 
 
 #include <freetype/fterrors.h>
+#include <freetype/internal/compiler-macros.h>
 #include "psft.h"
 
 
diff --git a/src/psaux/psft.h b/src/psaux/psft.h
index 902983e..3da454e 100644
--- a/src/psaux/psft.h
+++ b/src/psaux/psft.h
@@ -40,9 +40,9 @@
 #define PSFT_H_
 
 
+#include <freetype/internal/compiler-macros.h>
 #include "pstypes.h"
 
-
   /* TODO: disable asserts for now */
 #define CF2_NDEBUG
 
diff --git a/src/psaux/psstack.h b/src/psaux/psstack.h
index 18cd39b..b9ef9ed 100644
--- a/src/psaux/psstack.h
+++ b/src/psaux/psstack.h
@@ -39,6 +39,7 @@
 #ifndef PSSTACK_H_
 #define PSSTACK_H_
 
+#include <freetype/internal/compiler-macros.h>
 
 FT_BEGIN_HEADER
 
diff --git a/src/sfnt/woff2tags.c b/src/sfnt/woff2tags.c
index 9775385..fd9f2e6 100644
--- a/src/sfnt/woff2tags.c
+++ b/src/sfnt/woff2tags.c
@@ -17,7 +17,7 @@
 
 
 #include <freetype/tttags.h>
-
+#include "woff2tags.h"
 
   /*
    * Return tag from index in the order given in WOFF2 specification.
diff --git a/src/sfnt/woff2tags.h b/src/sfnt/woff2tags.h
index d0d28ae..c437c77 100644
--- a/src/sfnt/woff2tags.h
+++ b/src/sfnt/woff2tags.h
@@ -21,6 +21,7 @@
 
 
 #include <freetype/internal/ftobjs.h>
+#include <freetype/internal/compiler-macros.h>
 
 
 FT_BEGIN_HEADER