*Ouch* :-)

Werner, please don't commit something if you think there are still problems
in it, that's what code reviews are, and I'm currently on vacation, so
we've been lucky I could glimpse at my email and have time to fix it.
See attached patch for a fix. Sorry about that. We need a better way to
automatically check our builds. Note that the freetype2-demos issue didn't
appear on my workstation because I was doing an incremental build, and our
dependencies are so wrong that Make didn't catch the need to recompile the
demo sources, only relink the binaries. Yet another reason to change our
build.

I'll work on a proper rebuild-check script first though...

- David

Le lun. 6 juil. 2020 à 08:31, Werner LEMBERG <[email protected]> a écrit :

> > [...] compilation of the the demo programs fails with
> >
> >     freetype2-demos/src/ftbench.c: In function ‘face_requester’:
> >       freetype2-demos/src/ftbench.c:165:5: warning:
> >         implicit declaration of function ‘FT_UNUSED’
> [-Wimplicit-function-declaration]
> >        FT_UNUSED( face_id );
> >        ^~~~~~~~~
>
> I've fixed this meanwhile.  So only two issues for you, David :-)
>
>
>     Werner
>
From 8abef31464aea930e3d9474444fa611845eff97d Mon Sep 17 00:00:00 2001
From: David Turner <[email protected]>
Date: Mon, 6 Jul 2020 10:56:36 +0200
Subject: [build] Fix multi and C++ builds.

The following builds were failing due to previous changes:

  make multi
  make multi CC="c++"

This patch fixes the issues, which were missing includes to
get the right macro definitions in multi-build mode.
---
 include/freetype/config/ftconfig.h |  3 ---
 include/freetype/config/ftheader.h | 20 ++++++++++++--------
 src/cache/ftccache.h               |  2 +-
 src/cache/ftcmru.h                 |  1 +
 src/pcf/pcfutil.h                  |  2 +-
 src/psaux/pserror.h                |  1 +
 src/psaux/psft.h                   |  2 +-
 src/psaux/psstack.h                |  1 +
 src/sfnt/woff2tags.c               |  2 +-
 src/sfnt/woff2tags.h               |  1 +
 10 files changed, 20 insertions(+), 15 deletions(-)

diff --git a/include/freetype/config/ftconfig.h b/include/freetype/config/ftconfig.h
index d59f29323..b464e0b78 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 b028ece9c..28b5cc60c 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 2996ee808..11698bb0e 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 e7c2a8fad..ac4f9b126 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 be986e756..a197c1559 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 eb0a865e2..5738853fa 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 902983ed7..3da454e60 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 18cd39bc6..b9ef9edf1 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 977538519..fd9f2e6c5 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 d0d28ae0a..c437c77aa 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
-- 
2.20.1

Reply via email to