[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'.
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 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182
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