Re: [patch] Simplify ftconfig.h

2020-07-23 Thread David Turner
Le jeu. 23 juil. 2020 à 13:19, Werner LEMBERG  a écrit :

>
> Hello David,
>
>
> > Here's a patch to add a .clang-format style file to the directory.
>
> Thanks.  I've slightly improved it, but I think there is still room
> for more fixes.


Good, can you share your updated version? We may not get 100% of what we
want, but the benefits of everyone using the same formatting style are far
greater imho.


> Note that newer `clang-format` binaries have
> additional options; we thus have to specify which version has to be
>
used.
>

Yes, very true. I'm currently using clang-format version 9

>
> Werner
>


Re: [patch] Simplify ftconfig.h

2020-07-23 Thread Alexei Podtelezhnikov


>> Here's a patch to add a .clang-format style file to the directory.
> 
> Thanks.  I've slightly improved it, but I think there is still room
> for more fixes.  Note that newer `clang-format` binaries have
> additional options; we thus have to specify which version has to be
> used.

Hi all, 

I used ‘indent’ to do formatting. It is also quite flexible. I’ll see what I 
can do.

Alexei


Re: [patch] Simplify ftconfig.h

2020-07-23 Thread Werner LEMBERG


Hello David,


> Here's a patch to add a .clang-format style file to the directory.

Thanks.  I've slightly improved it, but I think there is still room
for more fixes.  Note that newer `clang-format` binaries have
additional options; we thus have to specify which version has to be
used.


Werner



Re: [patch] Simplify ftconfig.h

2020-07-08 Thread David Turner
Here's a patch to add a .clang-format style file to the directory. Note
that this doesn't reformat the sources, but see the instructions in the
commit message to do that.
I dinf the results quite close to what we have. Please take a look and let
me know your opinon on the results.

Apart from that, there are several ways to enforce rules, for example using
git hooks that will run cheks before a submit or a push.
Other options are using a code review tool so that each patch is vetted
properly before being submitted, but that's more related to the discussion
about moving to gitlab/github.

Le mar. 7 juil. 2020 à 07:09, Werner LEMBERG  a écrit :

>
> >> However, I've already invested a lot of time in writing ChangeLog
> >> entries...
> >
> > Would you consider dropping the ChangeLog entries.
>
> Basically, I don't object to that.  However, experience has shown that
> people tend to write very sloppy git commit messages in general.  The
> ChangeLog format enforces you to describe changes in a standardized
> way that I consider very helpful.
>
> > It is far simpler to rely on the git history for this, and just
> > enforcing that committer provide meaningful commit messages should
> > be enough?
>
> If we can do what Emacs does – namely git commit messages in ChangeLog
> style – I'm all for dropping direct ChangeLog entries.
>
> > Also, whenever you reformat some of the patches that are sent to
> > you, the original author has to resolve the conflicts manually, or
> > drop its own branch, which is not always practical (e.g. when there
> > are other work-in-progress commits/branches on top of the one that
> > was originally submitted).
>
> This is admittedly a problem.
>
> > Would you consider using clang-format to automate the formatting
> > task? I think we can get pretty close to the FreeType formatting
> > standard with a Clang style sheet.  It won't be 100% the same, but
> > close enough to avoid repetitive work.
>
> If you can manage to write that, please do!  Automatic formatting has
> definitely benefits.  Honestly, I suggest that we get completely rid
> of the special FreeType formatting.  For consistency I'm enforcing it
> on all pieces of code, but virtually all contributors have
> difficulties to follow the (unwritten) rules.  Something like
>
>   int main(int argc,
>char **argv)
>   {
> FT_Error error;
> FT_Library library;
> FT_Face face;
> int i;
>
>
> error = FT_Init_FreeType();
> if (error)
> {
>   foobar();
>   die("FT_Init_FreeType failed");
> }
>
> if (argc != 2)
>   die("no font file argument given");
>
> ...
>
> looks nice IMHO – and is quite standard, AFAICS.  Of course,
> vertical alignment like
>
> FT_Error   error;
> FT_Library library;
> FT_Faceface;
> inti;
>
> is quite nice, too, but I doubt that it can be really handled
> automatically.
>
> Whatever you come up with, please check whether our API documentation
> can be built correctly.  Additionally, such a change should be
> introduced right after a release.
>
> > here's another patch that tries to fix this.  Sorry about that.
> > Also Ben Wagner noticed me that some third-party code is using
> > FT_UNUSED(), so I've moved it back to public-macros.h to avoid
> > breaking this.
>
> Thanks, applied (with minor additions).
>
>
> Werner
>
From efa7fc4dcc0fe2b4a15cec1b04f45a71b99435cd Mon Sep 17 00:00:00 2001
From: David Turner 
Date: Fri, 1 May 2020 15:37:56 +0200
Subject: [build] Add .clang-format file

This file can be used to reformat FreeType sources and commits
using one of these methods:

- Direct formatting of a whole file:

clang-format -i path/to/file

  For example, to reformat all sources at once:

echo builds/unix/ftconfig.h.in $(git ls-files *.[hc]) | xargs clang-format -i

- Only reformat the changed lines in the current work directoy:

git clang-format

The style settings in this file are very close to the FreeType
formatting style, with the following exceptions which are not supported
here:

- Mminimal 2-space margin on each non-empty line.
  (no left margin instead).

- 2 empty lines between variable declarations and statements in C blocks.
  (only 1 is kept).

{
  int  x = ...;

  foo(x);
}

  becomes

{
  int x = ...;

  foo(x);
}

- Aignment of declarations uses 2 spaces to separate types and variable
  names (only 1 space is kept).

 int  x;=>   int x;
 int  y; int y;

- The start used for output parameters in function signature should be
  near the variable name (always near the type).

void foo(int* input_ptr, int *output_ptr)
  => void foo(int* input_ptr, int* output_ptr)
---
 .clang-format | 12 
 1 file changed, 12 insertions(+)
 create mode 100644 .clang-format

diff --git a/.clang-format b/.clang-format
new file mode 100644
index 0..340a664a9
--- /dev/null
+++ b/.clang-format
@@ -0,0 +1,12 @@
+BasedOnStyle: Chromium

Re: [patch] Simplify ftconfig.h

2020-07-07 Thread Alexei Podtelezhnikov


>> It is far simpler to rely on the git history for this, and just
>> enforcing that committer provide meaningful commit messages should
>> be enough?
> 
> If we can do what Emacs does – namely git commit messages in ChangeLog
> style – I'm all for dropping direct ChangeLog entries.

GCC git-commit messages are very strictly formatted in Emacs style.  Do they 
use any tools?

On related note, git can nicely annotate diff hanks with function names, which 
is helpful for writing ChangeLog and commit messages. Can somebody write a 
regexp to help git recognize FreeType style?

Alexei


Re: [patch] Simplify ftconfig.h

2020-07-06 Thread Werner LEMBERG

>> However, I've already invested a lot of time in writing ChangeLog
>> entries...
>
> Would you consider dropping the ChangeLog entries.

Basically, I don't object to that.  However, experience has shown that
people tend to write very sloppy git commit messages in general.  The
ChangeLog format enforces you to describe changes in a standardized
way that I consider very helpful.

> It is far simpler to rely on the git history for this, and just
> enforcing that committer provide meaningful commit messages should
> be enough?

If we can do what Emacs does – namely git commit messages in ChangeLog
style – I'm all for dropping direct ChangeLog entries.

> Also, whenever you reformat some of the patches that are sent to
> you, the original author has to resolve the conflicts manually, or
> drop its own branch, which is not always practical (e.g. when there
> are other work-in-progress commits/branches on top of the one that
> was originally submitted).

This is admittedly a problem.

> Would you consider using clang-format to automate the formatting
> task? I think we can get pretty close to the FreeType formatting
> standard with a Clang style sheet.  It won't be 100% the same, but
> close enough to avoid repetitive work.

If you can manage to write that, please do!  Automatic formatting has
definitely benefits.  Honestly, I suggest that we get completely rid
of the special FreeType formatting.  For consistency I'm enforcing it
on all pieces of code, but virtually all contributors have
difficulties to follow the (unwritten) rules.  Something like

  int main(int argc,
   char **argv)
  {
FT_Error error;
FT_Library library;
FT_Face face;
int i;


error = FT_Init_FreeType();
if (error)
{
  foobar();
  die("FT_Init_FreeType failed");
}

if (argc != 2)
  die("no font file argument given");

...

looks nice IMHO – and is quite standard, AFAICS.  Of course,
vertical alignment like

FT_Error   error;
FT_Library library;
FT_Faceface;
inti;

is quite nice, too, but I doubt that it can be really handled
automatically.

Whatever you come up with, please check whether our API documentation
can be built correctly.  Additionally, such a change should be
introduced right after a release.

> here's another patch that tries to fix this.  Sorry about that.
> Also Ben Wagner noticed me that some third-party code is using
> FT_UNUSED(), so I've moved it back to public-macros.h to avoid
> breaking this.

Thanks, applied (with minor additions).


Werner


Re: [patch] Simplify ftconfig.h

2020-07-06 Thread Nikolaus Waxweiler
Would you consider dropping the ChangeLog entries. It is far simpler 
to rely on the git history for this, and just enforcing that commiter 
provide meaningful commit message should be enough?


Yes please. Alternatively, there are tools like 
https://pypi.org/project/towncrier/.


> Would you consider using clang-format to automate the formatting 
task? I think we can get pretty close to the FreeType formatting 
standard with a Clang style sheet. It won't be 100% the same, but close 
enough to avoid repetitive work.


YES YES YES. It is _so_ nice to just hit a format hotkey. It's become 
so automatic for me that I rarely think about formatting anymore.






Re: [patch] Simplify ftconfig.h

2020-07-06 Thread David Turner
Le lun. 6 juil. 2020 à 11:58, Werner LEMBERG  a écrit :

>
> > Werner, please don't commit something if you think there are still
> > problems in it, that's what code reviews are,
>
> Normally, I do that.  However, I've already invested a lot of time in
> writing ChangeLog entries...
>
> Would you consider dropping the ChangeLog entries. It is far simpler to
rely on the git history for this, and just enforcing that commiter provide
meaningful commit message should be enough?
Also, whenever you reformat some of the patches that are sent to you, the
original author has to resolve the conflicts manually, or drop its own
branch, which is not always practical (e.g. when there are other
work-in-progress commits/branches on top of the one that was originally
submitted). Would you consider using clang-format to automate the
formatting task? I think we can get pretty close to the FreeType formatting
standard with a Clang style sheet. It won't be 100% the same, but close
enough to avoid repetitive work.


> See attached patch for a fix.
>
> Applied, thanks.  Note, however, that there are still issues with
> `make multi CC=c++` (I'm using g++ 7.5.0):
>
> Yes, here's another patch that tries to fix this. Sorry about that.
Also Ben Wagner noticed me that some third-party code is using FT_UNUSED(),
so I've moved it back to public-macros.h to avoid breaking this.




>   c++ -ansi -pedantic \
>   -Ifreetype2.compiled [...] \
>   freetype2/src/base/ftsystem.c
>   In file included from freetype2/include/freetype/config/ftconfig.h:45:0,
>from freetype2/src/base/ftsystem.c:29:
>   freetype2/include/freetype/config/public-macros.h:83:61: error:
> expected unqualified-id before string constant
>#define FT_EXPORT( x )  FT_PUBLIC_FUNCTION_ATTRIBUTE extern "C" x
>^
>   freetype2/include/freetype/fterrors.h:281:3: note:
> in expansion of macro ‘FT_EXPORT’
>  FT_EXPORT( const char* )
>  ^
>
> > Sorry about that.  We need a better way to automatically check our
> > builds.  [...]  I'll work on a proper rebuild-check script first
> > though...
>
> I don't worry about that right now, and please don't invest too much
> time here.  This is something after a switch to a new build system
> IMHO.
>
>
> Werner
>
From 0cfacffe05ae6eeffe2df0d0663fa4666a8b6afc Mon Sep 17 00:00:00 2001
From: David Turner 
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++"
  make CC="c++"

This patch fixes the issues, which were missing includes to
get the right macro definitions in multi-build mode.

Also, FT_UNUSED() is actually used by third-party code, so
move it back to  to avoid
breaking it.
---
 include/freetype/config/public-macros.h | 16 +---
 include/freetype/internal/compiler-macros.h | 19 ---
 src/cache/ftccback.h|  2 ++
 src/lzw/ftzopen.h   |  3 +++
 4 files changed, 22 insertions(+), 18 deletions(-)

diff --git a/include/freetype/config/public-macros.h b/include/freetype/config/public-macros.h
index b1fa0f2b3..5cc3236ed 100644
--- a/include/freetype/config/public-macros.h
+++ b/include/freetype/config/public-macros.h
@@ -78,13 +78,23 @@ FT_BEGIN_HEADER
  *
  * FT_EXPORT( FT_Bool )  FT_Object_Method( FT_Object obj, ... );
  *
+ * NOTE: This requires that all FT_EXPORT() uses are inside FT_BEGIN_HEADER ..
+ * FT_END_HEADER blocks. This guarantees that the functions are exported with
+ * C linkage, even when the header is included by a C++ source file.
  */
-#ifdef __cplusplus
-#define FT_EXPORT( x )  FT_PUBLIC_FUNCTION_ATTRIBUTE extern "C" x
-#else
 #define FT_EXPORT( x )  FT_PUBLIC_FUNCTION_ATTRIBUTE extern x
+
+  /* `FT_UNUSED` indicates that a given parameter is not used --   */
+  /* this is only used to get rid of unpleasant compiler warnings. */
+  /*   */
+  /* Technically, this was not meant to be part of the public API, */
+  /* but some third-party code depends on it.  */
+  /*   */
+#ifndef FT_UNUSED
+#define FT_UNUSED( arg )  ( (arg) = (arg) )
 #endif
 
+
 FT_END_HEADER
 
 #endif  /* FREETYPE_CONFIG_PUBLIC_MACROS_H_ */
diff --git a/include/freetype/internal/compiler-macros.h b/include/freetype/internal/compiler-macros.h
index 1f432bca5..b62c0777b 100644
--- a/include/freetype/internal/compiler-macros.h
+++ b/include/freetype/internal/compiler-macros.h
@@ -27,12 +27,6 @@ FT_BEGIN_HEADER
 #  if defined( _COMPILER_VERSION ) && ( _COMPILER_VERSION >= 730 )
 #pragma set woff 3505
 #  endif
-#endif
-
-  /* `FT_UNUSED` indicates that a given parameter is not used --   */
-  /* this is only used to get rid of unpleasant compiler warnings. */
-#ifndef FT_UNUSED
-#define 

Re: [patch] Simplify ftconfig.h

2020-07-06 Thread Vincent Torri
On Mon, Jul 6, 2020 at 11:58 AM Werner LEMBERG  wrote:
>
>
> > Werner, please don't commit something if you think there are still
> > problems in it, that's what code reviews are,
>
> Normally, I do that.  However, I've already invested a lot of time in
> writing ChangeLog entries...
>
> > See attached patch for a fix.
>
> Applied, thanks.  Note, however, that there are still issues with
> `make multi CC=c++` (I'm using g++ 7.5.0):
>
>   c++ -ansi -pedantic \
>   -Ifreetype2.compiled [...] \
>   freetype2/src/base/ftsystem.c
>   In file included from freetype2/include/freetype/config/ftconfig.h:45:0,
>from freetype2/src/base/ftsystem.c:29:
>   freetype2/include/freetype/config/public-macros.h:83:61: error:
> expected unqualified-id before string constant
>#define FT_EXPORT( x )  FT_PUBLIC_FUNCTION_ATTRIBUTE extern "C" x
>^
>   freetype2/include/freetype/fterrors.h:281:3: note:
> in expansion of macro ‘FT_EXPORT’
>  FT_EXPORT( const char* )
>  ^
>
> > Sorry about that.  We need a better way to automatically check our
> > builds.  [...]  I'll work on a proper rebuild-check script first
> > though...


github + travis-CI (and appveyor for windows) + coverity (static
analysis) + coverage (unit testing coverage)

i'm sure you can fork your repo in github. if you don't like github,
gitlab should offer the same kind of tools

Vincent Torri



Re: [patch] Simplify ftconfig.h

2020-07-06 Thread Werner LEMBERG

> Werner, please don't commit something if you think there are still
> problems in it, that's what code reviews are,

Normally, I do that.  However, I've already invested a lot of time in
writing ChangeLog entries...

> See attached patch for a fix.

Applied, thanks.  Note, however, that there are still issues with
`make multi CC=c++` (I'm using g++ 7.5.0):

  c++ -ansi -pedantic \
  -Ifreetype2.compiled [...] \
  freetype2/src/base/ftsystem.c
  In file included from freetype2/include/freetype/config/ftconfig.h:45:0,
   from freetype2/src/base/ftsystem.c:29:
  freetype2/include/freetype/config/public-macros.h:83:61: error:
expected unqualified-id before string constant
   #define FT_EXPORT( x )  FT_PUBLIC_FUNCTION_ATTRIBUTE extern "C" x
   ^
  freetype2/include/freetype/fterrors.h:281:3: note:
in expansion of macro ‘FT_EXPORT’
 FT_EXPORT( const char* )
 ^

> Sorry about that.  We need a better way to automatically check our
> builds.  [...]  I'll work on a proper rebuild-check script first
> though...

I don't worry about that right now, and please don't invest too much
time here.  This is something after a switch to a new build system
IMHO.


Werner


Re: [patch] Simplify ftconfig.h

2020-07-06 Thread Vincent Torri
On Mon, Jul 6, 2020 at 11:17 AM Nikolaus Waxweiler 
wrote:

> Meson has a check-dist thing built in. Just saying 
>

and other nice things. I'm eagerly waiting for a meson build

Vincent Torri


Re: [patch] Simplify ftconfig.h

2020-07-06 Thread Nikolaus Waxweiler
Meson has a check-dist thing built in. Just saying 


Re: [patch] Simplify ftconfig.h

2020-07-06 Thread David Turner
*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  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 8abef31464aea930e3d947fa611845eff97d Mon Sep 17 00:00:00 2001
From: David Turner 
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 
 #include 
 
-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 
 #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 
+#include 
 
 #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 
 #include FT_CONFIG_CONFIG_H
-
+#include 
 
 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 
+#include 
 #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 
 #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_
 

Re: [patch] Simplify ftconfig.h

2020-07-06 Thread Werner LEMBERG
> [...] 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


Re: [patch] Simplify ftconfig.h

2020-07-05 Thread Werner LEMBERG

> Yes, here's it is as a bundle of 5 intermediate commits.  As a
> reminder, to use it, do:
> 
> git remote add bundle /path/to/bundle
> git fetch bundle

Thanks!  I've normalized the commit messages by converting them to
proper ChangeLog entries, then committed to git.

Note, however, that there are serious issues which I ask you to fix
ASAP:

* After compiling the library with `make devel; make', 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 );
   ^
freetype2-demos/src/ftbench.c:165:5: warning:
  nested extern declaration of ‘FT_UNUSED’ [-Wnested-externs]

[...]

/usr/lib64/gcc/x86_64-suse-linux/7/../../../../x86_64-suse-linux/bin/ld:
 ftbench.o: in function `face_requester':
   freetype2-demos/src/ftbench.c:165: undefined reference to `FT_UNUSED'

[...]


* Compilation with

make multi CC=c++

  now fails with

In file included from freetype2/devel/ft2build.h:36:0,
 from freetype2/src/base/ftsystem.c:28:
  freetype2/include/freetype/config/ftheader.h:52:24: error:
expected declaration before ‘}’ token
 #define FT_END_HEADER  }
^
freetype2/include/freetype/config/ftconfig.h:48:1: note:
  in expansion of macro ‘FT_END_HEADER’
 FT_END_HEADER
 ^


* Compilation with

make multi

  aborts with

  In file included from freetype2/src/pcf/pcfutil.c:35:0:
freetype2/src/pcf/pcfutil.h:38:3: warning:
  return type defaults to ‘int’ [-Wreturn-type]
 FT_LOCAL( void )
 ^~~~
  freetype2/src/pcf/pcfutil.h: In function ‘FT_LOCAL’:
freetype2/src/pcf/pcfutil.h:39:3: error:
  expected declaration specifiers before ‘BitOrderInvert’
 BitOrderInvert( unsigned char*  buf,
 ^~
  freetype2/src/pcf/pcfutil.h:42:3: error:
expected declaration specifiers before ‘FT_LOCAL’
 FT_LOCAL( void )
 ^~~~
  freetype2/src/pcf/pcfutil.h:46:3: error:
expected declaration specifiers before ‘FT_LOCAL’
 FT_LOCAL( void )
 ^~~~
  freetype2/src/pcf/pcfutil.c:42:3: error:
expected declaration specifiers before ‘FT_LOCAL_DEF’
 FT_LOCAL_DEF( void )
 ^~~~
  freetype2/src/pcf/pcfutil.c:64:3: error:
expected declaration specifiers before ‘FT_LOCAL_DEF’
 FT_LOCAL_DEF( void )
 ^~~~
  freetype2/src/pcf/pcfutil.c:83:3: error:
expected declaration specifiers before ‘FT_LOCAL_DEF’
 FT_LOCAL_DEF( void )
 ^~~~
  freetype2/src/pcf/pcfutil.c:100:3: error:
expected ‘{’ at end of input
 }
 ^
  freetype2/src/pcf/pcfutil.c:100:3: warning:
control reaches end of non-void function [-Wreturn-type]
 }
 ^


Werner


Re: [patch] Simplify ftconfig.h

2020-07-02 Thread David Turner
Le mar. 30 juin 2020 à 15:27, Werner LEMBERG  a écrit :

>
> > Here's the rebased and updated patch then.
>
> Thanks.  However, what you've sent are actually two completely
> separate things: The splitting of `ftconfig.h` into smaller files, and
> the modification of `FT_BASE' and friends.  Please change this into
> two separate commits, which makes it much easier to follow the
> changes.
>
> Yes, here's it is as a bundle of 5 intermediate commits.
As a reminder, to use it, do:

git remote add bundle /path/to/bundle
git fetch bundle

This will print the remote branch (i.e. bundle/ftconfig-cleanup in this
case)

- David

>
> Werner
>


freetype2-ftconfig-cleanup.bundle
Description: Binary data


Re: [patch] Simplify ftconfig.h

2020-06-30 Thread Werner LEMBERG


> Here's the rebased and updated patch then.

Thanks.  However, what you've sent are actually two completely
separate things: The splitting of `ftconfig.h` into smaller files, and
the modification of `FT_BASE' and friends.  Please change this into
two separate commits, which makes it much easier to follow the
changes.


Werner



Re: [patch] Simplify ftconfig.h

2020-06-30 Thread David Turner
Le mar. 30 juin 2020 à 07:23, Werner LEMBERG  a écrit :

>
> > We should also decide whether to chose a dash or an underscore as
> > the word separator for header and source file names :-) I have no
> > favorites here, but being consistent will be less ambiguous for
> > everyone.
>
> I definitely prefer '-' over '_'.
>
> Thanks, let's go with it. Here's the rebased and updated patch then.

>
> Werner
>
From 1d2fe6e959f4fb4a3321eab1a104298118273541 Mon Sep 17 00:00:00 2001
From: David Turner 
Date: Tue, 23 Jun 2020 20:54:41 +0200
Subject: [build] Simplify 

This patch simplifies the content of ftconfig.h by
moving things around a little, i.e.:

- Move public compiler macros needed by the FreeType
  API headers to ,
  while all other macros that are only used by the
  implementation are moved to
   instead.

- Update the definitions of FT_BASE() and related
  macro to ensure that internal functions have hidden
  visibility by default (see FT_INTERNAL_FUNCTION_ATTRIBUTE)
  in  for details).

- Move integer type definitions to
   while allowing
  the header's includer to define FT_SIZEOF_INT and
  FT_SIZEOF_LONG (as required on Unix).

- Move Mac support macro definitions to
  . It is unclear
  at this point if this is required by the public
  API header. Otherwise, this might be moved to
   instead.

- Rename builds/unix/ftconfig.in to
  builds/unix/ftconfig.h.in since we are no longer
  limited to 8.3 file names (yeah!). Also make
  the file's content drastically shorter since
  it can now include the other config/ headers
  listed above.

- Update builds/vms/ftconfig.h as well.

- Update CMakeLists.txt

NOTE: This patch does not try to move the definitions
of HAVE_UNISTD_H and HAVE_FCNTL_H from the public
ftconfig.h header generated by `configure` on Unix.
However, these values have no place in a public
header, and should probably be moved to compiler
flags instead. Maybe in a future patch.
---
 CMakeLists.txt  |   4 +-
 builds/unix/configure.raw   |  22 +-
 builds/unix/ftconfig.h.in   |  77 +++
 builds/unix/ftconfig.in | 602 
 builds/vms/ftconfig.h   | 491 +---
 include/freetype/config/ftconfig.h  | 531 +
 include/freetype/config/integer-types.h | 245 
 include/freetype/config/mac-support.h   |  49 ++
 include/freetype/config/public-macros.h |  82 +++
 include/freetype/internal/compiler-macros.h | 278 +
 include/freetype/internal/ftcalc.h  |   1 +
 include/freetype/internal/ftdebug.h |   2 +
 include/freetype/internal/ftdrv.h   |   1 +
 include/freetype/internal/ftmemory.h|   1 +
 include/freetype/internal/ftobjs.h  |   1 +
 include/freetype/internal/ftserv.h  |   1 +
 include/freetype/internal/ftvalid.h |   3 +-
 src/raster/ftraster.h   |   1 +
 18 files changed, 755 insertions(+), 1637 deletions(-)
 create mode 100644 builds/unix/ftconfig.h.in
 delete mode 100644 builds/unix/ftconfig.in
 create mode 100644 include/freetype/config/integer-types.h
 create mode 100644 include/freetype/config/mac-support.h
 create mode 100644 include/freetype/config/public-macros.h
 create mode 100644 include/freetype/internal/compiler-macros.h

diff --git a/CMakeLists.txt b/CMakeLists.txt
index 17787a171..c9befb421 100644
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -241,7 +241,7 @@ if (UNIX)
   check_include_file("unistd.h" HAVE_UNISTD_H)
   check_include_file("fcntl.h" HAVE_FCNTL_H)
 
-  file(READ "${PROJECT_SOURCE_DIR}/builds/unix/ftconfig.in"
+  file(READ "${PROJECT_SOURCE_DIR}/builds/unix/ftconfig.h.in"
 FTCONFIG_H)
   if (HAVE_UNISTD_H)
 string(REGEX REPLACE
@@ -253,8 +253,6 @@ if (UNIX)
   "#undef +(HAVE_FCNTL_H)" "#define \\1 1"
   FTCONFIG_H "${FTCONFIG_H}")
   endif ()
-  string(REPLACE "/undef " "#undef "
-FTCONFIG_H "${FTCONFIG_H}")
 else ()
   file(READ "${PROJECT_SOURCE_DIR}/include/freetype/config/ftconfig.h"
 FTCONFIG_H)
diff --git a/builds/unix/configure.raw b/builds/unix/configure.raw
index 50f270119..f04c4c2b3 100644
--- a/builds/unix/configure.raw
+++ b/builds/unix/configure.raw
@@ -12,7 +12,7 @@
 # fully.
 
 AC_INIT([FreeType], [@VERSION@], [freet...@nongnu.org], [freetype])
-AC_CONFIG_SRCDIR([ftconfig.in])
+AC_CONFIG_SRCDIR([ftconfig.h.in])
 
 
 # Don't forget to update `docs/VERSIONS.TXT'!
@@ -109,11 +109,11 @@ AC_CHECK_SIZEOF([long])
 AC_TYPE_LONG_LONG_INT
 
 
-# check whether cpp computation of size of int and long in ftconfig.in works
+# check whether cpp computation of size of int and long in ftconfig.h.in works
 
-AC_MSG_CHECKING([whether cpp computation of bit length in ftconfig.in works])
+AC_MSG_CHECKING([whether cpp computation of bit length in ftconfig.h.in works])
 orig_CPPFLAGS="${CPPFLAGS}"
-CPPFLAGS="-I${srcdir} -I. -I${srcdir}/../../include/freetype/config ${CPPFLAGS}"
+CPPFLAGS="-I${srcdir} -I. 

Re: [patch] Simplify ftconfig.h

2020-06-29 Thread Werner LEMBERG


> We should also decide whether to chose a dash or an underscore as
> the word separator for header and source file names :-) I have no
> favorites here, but being consistent will be less ambiguous for
> everyone.

I definitely prefer '-' over '_'.


Werner



Re: [patch] Simplify ftconfig.h

2020-06-29 Thread David Turner
Le mer. 24 juin 2020 à 13:49, Alexei Podtelezhnikov  a
écrit :

> Hello David,
>
> >  create mode 100644 include/freetype/config/compiler_macros.h
> >  create mode 100644 include/freetype/config/integer_types.h
> >  create mode 100644 include/freetype/config/mac_support.h
> >  create mode 100644 include/freetype/internal/compiler_macros.h
>
> The same filename albeit in different folders might be confusing and
> prone to errors.


Oh, very good point, I'll change this.

Also _macros.h is a bit redundant.


I don't think so, the header is really about defining macros that are
compiler-specific.


> How about
> config/ftconfig-compiler.h and internal/ftcompiler.h?


First, we should avoid our cryptic short names now, the use of prefixes
like "ft" was due to the fact that some people didn't even have proper
directories when developing for embedded systems (a long long time ago).
So any public header began with "ft", all TrueType headers, began with
"tt", etc... We really don't need this anymore. We need to keep the public
header names consistent to avoid breaking all kinds of scripts that operate
on them, but for anything new, or under internal/ or even src/, we are now
free to rename everything to something vastly more meaningful.
The good thing is we don't have to do this all at once, progressively will
be good.

Also ftconfig-compiler.h makes me think about a compiler for configuration
files, I find "compiler_macros.h" or "compiler_defines.h" more explicit.



> Personally, I
> would rather reflect custody in the names: ftconfig-types.h
> ftconfig-mac.h. It might just be me but I am not a big fan of
> verbosity in C including filenames.
>
>
We should also decide whether to chose a dash or an underscore as the word
separator for header and source file names :-)
I have no favorites here, but being consistent will be less ambiguous for
everyone.



> Alexei
>


Re: [patch] Simplify ftconfig.h

2020-06-24 Thread Alexei Podtelezhnikov
Hello David,

>  create mode 100644 include/freetype/config/compiler_macros.h
>  create mode 100644 include/freetype/config/integer_types.h
>  create mode 100644 include/freetype/config/mac_support.h
>  create mode 100644 include/freetype/internal/compiler_macros.h

The same filename albeit in different folders might be confusing and
prone to errors. Also _macros.h is a bit redundant. How about
config/ftconfig-compiler.h and internal/ftcompiler.h? Personally, I
would rather reflect custody in the names: ftconfig-types.h
ftconfig-mac.h. It might just be me but I am not a big fan of
verbosity in C including filenames.

Alexei



Re: [patch] Simplify ftconfig.h

2020-06-24 Thread David Turner
And the previous patch didn't handle CMakeLists.txt properly, so here's a
third version that fixes the issue.

Le mar. 23 juin 2020 à 22:25, David Turner  a écrit :

> Good catch, here's the updated patch that also modifies
> builds/vms/ftconfig.h
>
> We might remove support for __BORLANDC__ et al in the future, but I prefer
> to do that in a separate patch (as well as all support code under builds/
> for these compilers).
> Just moving things around is simpler to review and implement so far :)
>
> Thank you
>
> Le mar. 23 juin 2020 à 22:03, Alexei Podtelezhnikov 
> a écrit :
>
>> On Tue, Jun 23, 2020 at 3:05 PM David Turner  wrote:
>> >
>> > [build] Simplify 
>> >
>> > This patch simplifies the content of ftconfig.h by
>> > moving things around a little, i.e.:
>>
>> This greatly consolidates a lot of redundancy in multiple copies of
>> ftconfig.h too. However, I think you missed the third copy for
>> ftconfig.h in builds/vms/ftconfig.h. I also wonder if __BORLANDC__,
>> __WATCOMC__, and __MWERKS__ are still worth mentioning.
>>
>
From 8f19504ac39fa66712a1a59954236c9ed161bbd4 Mon Sep 17 00:00:00 2001
From: David Turner 
Date: Tue, 23 Jun 2020 20:54:41 +0200
Subject: [build] Simplify 

This patch simplifies the content of ftconfig.h by
moving things around a little, i.e.:

- Move public compiler macros needed by the FreeType
  API headers to ,
  while all other macros that are only used by the
  implementation are moved to
   instead.

- Move integer type definitions to
   while allowing
  the header's includer to define FT_SIZEOF_INT and
  FT_SIZEOF_LONG (as required on Unix).

- Move Mac support macro definitions to
  . It is unclear
  at this point if this is required by the public
  API header. Otherwise, this might be moved to
   instead.

- Rename builds/unix/ftconfig.in to
  builds/unix/ftconfig.h.in since we are no longer
  limited to 8.3 file names (yeah!). Also make
  the file's content drastically shorter since
  it can now include the other config/ headers
  listed above.

- Update builds/vms/ftconfig.h as well.

- Update CMakeLists.txt

NOTE: This patch does not try to move the definitions
of HAVE_UNISTD_H and HAVE_FCNTL_H from the public
ftconfig.h header generated by `configure` on Unix.
However, these values have no place in a public
header, and should probably be moved to compiler
flags instead. Maybe in a future patch.
---
 CMakeLists.txt  |   4 +-
 builds/unix/configure.raw   |  22 +-
 builds/unix/ftconfig.h.in   |  77 +++
 builds/unix/ftconfig.in | 602 
 builds/vms/ftconfig.h   | 491 +---
 include/freetype/config/compiler_macros.h   |  89 +++
 include/freetype/config/ftconfig.h  | 531 +
 include/freetype/config/integer_types.h | 245 
 include/freetype/config/mac_support.h   |  49 ++
 include/freetype/internal/compiler_macros.h | 271 +
 include/freetype/internal/ftcalc.h  |   1 +
 include/freetype/internal/ftdebug.h |   2 +
 include/freetype/internal/ftdrv.h   |   1 +
 include/freetype/internal/ftmemory.h|   1 +
 include/freetype/internal/ftobjs.h  |   1 +
 include/freetype/internal/ftserv.h  |   1 +
 include/freetype/internal/ftvalid.h |   3 +-
 src/raster/ftraster.h   |   1 +
 18 files changed, 755 insertions(+), 1637 deletions(-)
 create mode 100644 builds/unix/ftconfig.h.in
 delete mode 100644 builds/unix/ftconfig.in
 create mode 100644 include/freetype/config/compiler_macros.h
 create mode 100644 include/freetype/config/integer_types.h
 create mode 100644 include/freetype/config/mac_support.h
 create mode 100644 include/freetype/internal/compiler_macros.h

diff --git a/CMakeLists.txt b/CMakeLists.txt
index 17787a171..c9befb421 100644
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -241,7 +241,7 @@ if (UNIX)
   check_include_file("unistd.h" HAVE_UNISTD_H)
   check_include_file("fcntl.h" HAVE_FCNTL_H)
 
-  file(READ "${PROJECT_SOURCE_DIR}/builds/unix/ftconfig.in"
+  file(READ "${PROJECT_SOURCE_DIR}/builds/unix/ftconfig.h.in"
 FTCONFIG_H)
   if (HAVE_UNISTD_H)
 string(REGEX REPLACE
@@ -253,8 +253,6 @@ if (UNIX)
   "#undef +(HAVE_FCNTL_H)" "#define \\1 1"
   FTCONFIG_H "${FTCONFIG_H}")
   endif ()
-  string(REPLACE "/undef " "#undef "
-FTCONFIG_H "${FTCONFIG_H}")
 else ()
   file(READ "${PROJECT_SOURCE_DIR}/include/freetype/config/ftconfig.h"
 FTCONFIG_H)
diff --git a/builds/unix/configure.raw b/builds/unix/configure.raw
index 50f270119..f04c4c2b3 100644
--- a/builds/unix/configure.raw
+++ b/builds/unix/configure.raw
@@ -12,7 +12,7 @@
 # fully.
 
 AC_INIT([FreeType], [@VERSION@], [freet...@nongnu.org], [freetype])
-AC_CONFIG_SRCDIR([ftconfig.in])
+AC_CONFIG_SRCDIR([ftconfig.h.in])
 
 
 # Don't forget to update `docs/VERSIONS.TXT'!
@@ -109,11 +109,11 @@ AC_CHECK_SIZEOF([long])
 AC_TYPE_LONG_LONG_INT
 
 
-# check 

Re: [patch] Simplify ftconfig.h

2020-06-23 Thread David Turner
Good catch, here's the updated patch that also modifies
builds/vms/ftconfig.h

We might remove support for __BORLANDC__ et al in the future, but I prefer
to do that in a separate patch (as well as all support code under builds/
for these compilers).
Just moving things around is simpler to review and implement so far :)

Thank you

Le mar. 23 juin 2020 à 22:03, Alexei Podtelezhnikov  a
écrit :

> On Tue, Jun 23, 2020 at 3:05 PM David Turner  wrote:
> >
> > [build] Simplify 
> >
> > This patch simplifies the content of ftconfig.h by
> > moving things around a little, i.e.:
>
> This greatly consolidates a lot of redundancy in multiple copies of
> ftconfig.h too. However, I think you missed the third copy for
> ftconfig.h in builds/vms/ftconfig.h. I also wonder if __BORLANDC__,
> __WATCOMC__, and __MWERKS__ are still worth mentioning.
>
From eb779dec558e0f7dc1626318911532a8a529fdb7 Mon Sep 17 00:00:00 2001
From: David Turner 
Date: Tue, 23 Jun 2020 20:54:41 +0200
Subject: [build] Simplify 

This patch simplifies the content of ftconfig.h by
moving things around a little, i.e.:

- Move public compiler macros needed by the FreeType
  API headers to ,
  while all other macros that are only used by the
  implementation are moved to
   instead.

- Move integer type definitions to
   while allowing
  the header's includer to define FT_SIZEOF_INT and
  FT_SIZEOF_LONG (as required on Unix).

- Move Mac support macro definitions to
  . It is unclear
  at this point if this is required by the public
  API header. Otherwise, this might be moved to
   instead.

- Rename builds/unix/ftconfig.in to
  builds/unix/ftconfig.h.in since we are no longer
  limited to 8.3 file names (yeah!). Also make
  the file's content drastically shorter since
  it can now include the other config/ headers
  listed above.

- Update builds/vms/ftconfig.h as well.

NOTE: This patch does not try to move the definitions
of HAVE_UNISTD_H and HAVE_FCNTL_H from the public
ftconfig.h header generated by `configure` on Unix.
However, these values have no place in a public
header, and should probably be moved to compiler
flags instead. Maybe in a future patch.
---
 builds/unix/configure.raw   |  22 +-
 builds/unix/ftconfig.h.in   |  77 +++
 builds/unix/ftconfig.in | 602 
 builds/vms/ftconfig.h   | 491 +---
 include/freetype/config/compiler_macros.h   |  89 +++
 include/freetype/config/ftconfig.h  | 531 +
 include/freetype/config/integer_types.h | 245 
 include/freetype/config/mac_support.h   |  49 ++
 include/freetype/internal/compiler_macros.h | 271 +
 include/freetype/internal/ftcalc.h  |   1 +
 include/freetype/internal/ftdebug.h |   2 +
 include/freetype/internal/ftdrv.h   |   1 +
 include/freetype/internal/ftmemory.h|   1 +
 include/freetype/internal/ftobjs.h  |   1 +
 include/freetype/internal/ftserv.h  |   1 +
 include/freetype/internal/ftvalid.h |   3 +-
 src/raster/ftraster.h   |   1 +
 17 files changed, 754 insertions(+), 1634 deletions(-)
 create mode 100644 builds/unix/ftconfig.h.in
 delete mode 100644 builds/unix/ftconfig.in
 create mode 100644 include/freetype/config/compiler_macros.h
 create mode 100644 include/freetype/config/integer_types.h
 create mode 100644 include/freetype/config/mac_support.h
 create mode 100644 include/freetype/internal/compiler_macros.h

diff --git a/builds/unix/configure.raw b/builds/unix/configure.raw
index 50f270119..f04c4c2b3 100644
--- a/builds/unix/configure.raw
+++ b/builds/unix/configure.raw
@@ -12,7 +12,7 @@
 # fully.
 
 AC_INIT([FreeType], [@VERSION@], [freet...@nongnu.org], [freetype])
-AC_CONFIG_SRCDIR([ftconfig.in])
+AC_CONFIG_SRCDIR([ftconfig.h.in])
 
 
 # Don't forget to update `docs/VERSIONS.TXT'!
@@ -109,11 +109,11 @@ AC_CHECK_SIZEOF([long])
 AC_TYPE_LONG_LONG_INT
 
 
-# check whether cpp computation of size of int and long in ftconfig.in works
+# check whether cpp computation of size of int and long in ftconfig.h.in works
 
-AC_MSG_CHECKING([whether cpp computation of bit length in ftconfig.in works])
+AC_MSG_CHECKING([whether cpp computation of bit length in ftconfig.h.in works])
 orig_CPPFLAGS="${CPPFLAGS}"
-CPPFLAGS="-I${srcdir} -I. -I${srcdir}/../../include/freetype/config ${CPPFLAGS}"
+CPPFLAGS="-I${srcdir} -I. -I${srcdir}/../../include ${CPPFLAGS}"
 
 ac_clean_files=
 if test ! -f ft2build.h; then
@@ -124,10 +124,10 @@ fi
 cat > conftest.c <<\_ACEOF
 #include 
 #define FT_CONFIG_OPTIONS_H "ftoption.h"
-#define FT_CONFIG_STANDARD_LIBRARY_H "ftstdlib.h"
+#define FT_CONFIG_STANDARD_LIBRARY_H 
 #define FT_UINT_MAX  UINT_MAX
 #define FT_ULONG_MAX ULONG_MAX
-#include "ftconfig.in"
+#include "ftconfig.h.in"
 _ACEOF
 echo >> conftest.c "#if FT_SIZEOF_INT == "${ac_cv_sizeof_int}
 echo >> conftest.c "ac_cpp_ft_sizeof_int="${ac_cv_sizeof_int}
@@ -1158,15 +1158,7 @@ 

Re: [patch] Simplify ftconfig.h

2020-06-23 Thread Alexei Podtelezhnikov
On Tue, Jun 23, 2020 at 3:05 PM David Turner  wrote:
>
> [build] Simplify 
>
> This patch simplifies the content of ftconfig.h by
> moving things around a little, i.e.:

This greatly consolidates a lot of redundancy in multiple copies of
ftconfig.h too. However, I think you missed the third copy for
ftconfig.h in builds/vms/ftconfig.h. I also wonder if __BORLANDC__,
__WATCOMC__, and __MWERKS__ are still worth mentioning.



[patch] Simplify ftconfig.h

2020-06-23 Thread David Turner
[build] Simplify 

This patch simplifies the content of ftconfig.h by
moving things around a little, i.e.:

- Move public compiler macros needed by the FreeType
  API headers to ,
  while all other macros that are only used by the
  implementation are moved to
   instead.

- Move integer type definitions to
   while allowing
  the header's includer to define FT_SIZEOF_INT and
  FT_SIZEOF_LONG (as required on Unix).

- Move Mac support macro definitions to
  . It is unclear
  at this point if this is required by the public
  API header. Otherwise, this might be moved to
   instead.

- Rename builds/unix/ftconfig.in to
  builds/unix/ftconfig.h.in since we are no longer
  limited to 8.3 file names (yeah!). Also make
  the file's content drastically shorter since
  it can now include the other config/ headers
  listed above.

NOTE: This patch does not try to move the definitions
of HAVE_UNISTD_H and HAVE_FCNTL_H from the public
ftconfig.h header generated by `configure` on Unix.
However, these values have no place in a public
header, and should probably be moved to compiler
flags instead. Maybe in a future patch.
From ea9b5d98169bc9cc67f2ac4acad0af25f38116ab Mon Sep 17 00:00:00 2001
From: David Turner 
Date: Tue, 23 Jun 2020 20:54:41 +0200
Subject: [build] Simplify 

This patch simplifies the content of ftconfig.h by
moving things around a little, i.e.:

- Move public compiler macros needed by the FreeType
  API headers to ,
  while all other macros that are only used by the
  implementation are moved to
   instead.

- Move integer type definitions to
   while allowing
  the header's includer to define FT_SIZEOF_INT and
  FT_SIZEOF_LONG (as required on Unix).

- Move Mac support macro definitions to
  . It is unclear
  at this point if this is required by the public
  API header. Otherwise, this might be moved to
   instead.

- Rename builds/unix/ftconfig.in to
  builds/unix/ftconfig.h.in since we are no longer
  limited to 8.3 file names (yeah!). Also make
  the file's content drastically shorter since
  it can now include the other config/ headers
  listed above.

NOTE: This patch does not try to move the definitions
of HAVE_UNISTD_H and HAVE_FCNTL_H from the public
ftconfig.h header generated by `configure` on Unix.
However, these values have no place in a public
header, and should probably be moved to compiler
flags instead. Maybe in a future patch.
---
 builds/unix/configure.raw   |  22 +-
 builds/unix/ftconfig.h.in   |  77 +++
 builds/unix/ftconfig.in | 602 
 include/freetype/config/compiler_macros.h   |  89 +++
 include/freetype/config/ftconfig.h  | 531 +
 include/freetype/config/integer_types.h | 245 
 include/freetype/config/mac_support.h   |  49 ++
 include/freetype/internal/compiler_macros.h | 271 +
 include/freetype/internal/ftcalc.h  |   1 +
 include/freetype/internal/ftdebug.h |   2 +
 include/freetype/internal/ftdrv.h   |   1 +
 include/freetype/internal/ftmemory.h|   1 +
 include/freetype/internal/ftobjs.h  |   1 +
 include/freetype/internal/ftserv.h  |   1 +
 include/freetype/internal/ftvalid.h |   3 +-
 src/raster/ftraster.h   |   1 +
 16 files changed, 751 insertions(+), 1146 deletions(-)
 create mode 100644 builds/unix/ftconfig.h.in
 delete mode 100644 builds/unix/ftconfig.in
 create mode 100644 include/freetype/config/compiler_macros.h
 create mode 100644 include/freetype/config/integer_types.h
 create mode 100644 include/freetype/config/mac_support.h
 create mode 100644 include/freetype/internal/compiler_macros.h

diff --git a/builds/unix/configure.raw b/builds/unix/configure.raw
index 50f270119..f04c4c2b3 100644
--- a/builds/unix/configure.raw
+++ b/builds/unix/configure.raw
@@ -12,7 +12,7 @@
 # fully.
 
 AC_INIT([FreeType], [@VERSION@], [freet...@nongnu.org], [freetype])
-AC_CONFIG_SRCDIR([ftconfig.in])
+AC_CONFIG_SRCDIR([ftconfig.h.in])
 
 
 # Don't forget to update `docs/VERSIONS.TXT'!
@@ -109,11 +109,11 @@ AC_CHECK_SIZEOF([long])
 AC_TYPE_LONG_LONG_INT
 
 
-# check whether cpp computation of size of int and long in ftconfig.in works
+# check whether cpp computation of size of int and long in ftconfig.h.in works
 
-AC_MSG_CHECKING([whether cpp computation of bit length in ftconfig.in works])
+AC_MSG_CHECKING([whether cpp computation of bit length in ftconfig.h.in works])
 orig_CPPFLAGS="${CPPFLAGS}"
-CPPFLAGS="-I${srcdir} -I. -I${srcdir}/../../include/freetype/config ${CPPFLAGS}"
+CPPFLAGS="-I${srcdir} -I. -I${srcdir}/../../include ${CPPFLAGS}"
 
 ac_clean_files=
 if test ! -f ft2build.h; then
@@ -124,10 +124,10 @@ fi
 cat > conftest.c <<\_ACEOF
 #include 
 #define FT_CONFIG_OPTIONS_H "ftoption.h"
-#define FT_CONFIG_STANDARD_LIBRARY_H "ftstdlib.h"
+#define FT_CONFIG_STANDARD_LIBRARY_H 
 #define FT_UINT_MAX  UINT_MAX
 #define FT_ULONG_MAX ULONG_MAX
-#include "ftconfig.in"
+#include