[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
RE: [Devel] FT_PtrDist is badly defined and should be abolished
From: |
Turner, David |
Subject: |
RE: [Devel] FT_PtrDist is badly defined and should be abolished |
Date: |
Wed, 13 Oct 2004 13:29:22 +0200 |
> <<<<<<
> Actually, the definition is wrong, because size_t should _always_ be
> unsigned. The line should read instead:
>
> typedef ptrdiff_t FT_PtrDist
>
> or more correctly:
>
> typedef ft_ptrdiff_t FT_PtrDist
>
> and define ft_ptrdiff_t in <freetype/config/ftstdlib.h as:
>
> #include <stddef.h>
>
> typedef ptrdiff_t ft_ptrdiff_t
>
> to allow the thing to compile on weird environments where the
> standard C library and its definitions aren't necessarily
> available. (e.g. the XFree86 module runtime environment)
> >>>>>>
>
> That won't handle the case of environments where ptrdiff_t
> doesn't exist; in
> those environments one would have to define it as a long integer.
>
Well, the point of the 'ftstdlib.h' header file is to receive
all definitions that should normally come from a standard C library.
This allows one porter to provide its own header without touching
a single bit of the rest of the source code. The example I gave
was for the current ftstdlib.h, which relies on the usual C library,
which should have ptrdiff_t in <stddef.h>
for other environments, you can easily replace it with something
else. And that's what the XFree86 people have done to be able to
compile the engine as a loadable module. Since their idea is to
have a single binary object per architecture, they can't rely on
a given C library implementation.
- David Turner
- The FreeType Project (www.freetype.org)