freetype-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Gitlab-ci? Re: Another c++ compile failure...


From: Hin-Tak Leung
Subject: Re: Gitlab-ci? Re: Another c++ compile failure...
Date: Thu, 23 May 2024 22:32:11 +0000 (UTC)

I think there are three reasons:

- c++ compiler generally does better type checking. "Enums = ints", and "void * = (any type) *" are bad things in c, and their usage should be warned...

- there is at least one library which has inter-dependence with freetype - harfbuzz, which is in c++...

- we have a historical problem where ft2-demos depends on and uses freetype2's configure, without its own. The newer demos (some of them in c++, and depending on qt, etc)aren't even built by default / together with the older ones.

I am really approaching it on a 4th reason, of using skia in ft2-demos, somewhat related to 2nd and the 3rd.

At the moment, it looks as if the only option of generally supporting COLRv1 on Linux /freetype-based system is via skia; until somebody else write a COLRv1 library that interops with freetype, I guess.

Decoupling ft2-demos from freetype, splitting it into "genuine demos" (using public APIs only, can work with system freetype binary library and headers) and "advanced usage" (needing freetype internals) and ft2-demos having its own configure, etc, is probably the long-term way forward...



On Thursday 23 May 2024 at 06:45:26 BST, Vincent Torri <vincent.torri@gmail.com> wrote:


hello

I don't understand the interest of compiling Freetype with a c++
compiler. The source code is written in C. By convention, CC is
usually for C compilers. To compile C++ code, CXX env var should be
used, not CC

best regards

Vincent Torri

On Thu, May 23, 2024 at 3:16 AM Alexei Podtelezhnikov
<apodtele@gmail.com> wrote:
>
> Hi Hin-Tak,
>
> These macros were never used before. I fixed them. Now I think they
> made the code less readable and I might revert to the old code.
>
> Thanks,
> Alexei
>
> On Wed, May 22, 2024 at 6:12 PM Hin-Tak Leung
> <htl10@users.sourceforge.net> wrote:
> >
> > Actually it might be a good idea to stick CC=g++/clang++ as an additional job in .gitlab-ci.yml ? I mean, it already does gcc and clang.
> >
> > On Wednesday 22 May 2024 at 23:05:47 BST, Hin-Tak Leung <htl10@users.sourceforge.net> wrote:
> >
> >
> > Should be obvious - needs casting from "void *" to "unsigned char *" and etc...
> >
> > Shouldn't be too hard to see yourself with CC=c++ when building...
> >
> > In file included from /__w/freetype2-demos-skia/freetype2-demos-skia/freetype2/src/truetype/truetype.c:22:
> > /__w/freetype2-demos-skia/freetype2-demos-skia/freetype2/src/truetype/ttgload.c:421:14: error: assigning to 'FT_Byte *' (aka 'unsigned char *') from incompatible type 'FT_Pointer' (aka 'void *')
> >  421 |        if ( FT_DUP( exec->glyphIns, p, n_ins ) )
> >      |              ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
> > /__w/freetype2-demos-skia/freetype2-demos-skia/freetype2/include/freetype/internal/ftmemory.h:378:29: note: expanded from macro 'FT_DUP'
> >  378 |          FT_MEM_SET_ERROR( FT_MEM_DUP( dst, address, size ) )
> >      |          ~~~~~~~~~~~~~~~~~~^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
> > /__w/freetype2-demos-skia/freetype2-demos-skia/freetype2/include/freetype/internal/ftmemory.h:375:19: note: expanded from macro 'FT_MEM_DUP'
> >  375 |          (dst) = ft_mem_dup( memory, (address), (FT_ULong)(size), &error )
> >      |                  ^
> > /__w/freetype2-demos-skia/freetype2-demos-skia/freetype2/include/freetype/internal/ftmemory.h:231:38: note: expanded from macro 'FT_MEM_SET_ERROR'
> >  231 | #define FT_MEM_SET_ERROR( cond )  ( (cond), error != 0 )
> >      |                                      ^~~~
> > In file included from /__w/freetype2-demos-skia/freetype2-demos-skia/freetype2/src/truetype/truetype.c:23:
> > /__w/freetype2-demos-skia/freetype2-demos-skia/freetype2/src/truetype/ttgxvar.c:2718:12: error: assigning to 'FT_MM_Var *' (aka 'FT_MM_Var_ *') from incompatible type 'FT_Pointer' (aka 'void *')
> >  2718 |      if ( FT_DUP( mmvar, ttface->blend->mmvar, ttface->blend->mmvar_len ) )
> >      |            ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
> > /__w/freetype2-demos-skia/freetype2-demos-skia/freetype2/include/freetype/internal/ftmemory.h:378:29: note: expanded from macro 'FT_DUP'
> >  378 |          FT_MEM_SET_ERROR( FT_MEM_DUP( dst, address, size ) )
> >      |          ~~~~~~~~~~~~~~~~~~^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
> > /__w/freetype2-demos-skia/freetype2-demos-skia/freetype2/include/freetype/internal/ftmemory.h:375:19: note: expanded from macro 'FT_MEM_DUP'
> >  375 |          (dst) = ft_mem_dup( memory, (address), (FT_ULong)(size), &error )
> >      |                  ^
> > /__w/freetype2-demos-skia/freetype2-demos-skia/freetype2/include/freetype/internal/ftmemory.h:231:38: note: expanded from macro 'FT_MEM_SET_ERROR'
> >  231 | #define FT_MEM_SET_ERROR( cond )  ( (cond), error != 0 )
> >      |                                      ^~~~
> > 2 errors generated.
> > make: *** [/__w/freetype2-demos-skia/freetype2-demos-skia/freetype2/src/truetype/rules.mk:60: /__w/freetype2-demos-skia/freetype2-demos-skia/freetype2/objs/truetype.lo] Error 1
> > /__w/freetype2-demos-skia/freetype2-demos-skia
> > Error: Process completed with exit code 1.
>
>
>
> --
> Alexei A. Podtelezhnikov, PhD
>

reply via email to

[Prev in Thread] Current Thread [Next in Thread]