[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: Problem with ftview on DEC Alpha (traced to t2gload.c)
From: |
David Turner |
Subject: |
Re: Problem with ftview on DEC Alpha (traced to t2gload.c) |
Date: |
Wed, 05 Jul 2000 15:00:52 +0200 |
Hi Tom,
>
> Hi,
>
> Yes, I think that changing the various header/source files to use
> FT_Int32 (FT_UInt32) for 32 bit quantitites, FT_Int16... for 16 bit
> quantities would *definitely* ease library maintenence. One could
> then use autoconf magic on UNIX-like boxes to get the correct types.
> For instance, on the DEC alphas I work with, FT_Int32 would be
> "typedef signed int FT_Int32;", provided one has a freetypeh.in (or
> some such) for autoconf to run sed on...
>
You don't need autoconf to detect the size of integers. The ANSI header
file <limits.h> is sufficient, as proven by the code below taken from
<freetype/config/ftconfig.h>. Fortunately, we only target ANSI compilers,
and this works on all platforms :-)
When it comes to compiling the library, autoconf is mainly useful to
determine wether an "mmap" implementation is present on Unix, and provide
the libtool/install stuff (well, at least in theory, it's still not
completed in "freetype2/config/unix").
Note that I want to separate the demo programs from the main FreeType 2
source hierarchy. They could also use autoconf/automake more deeply in
order to compile the executables (detect X11, etc..).. It'd be nice if we
could do this quickly, because I want to make the last beta next week
(with the auto-hinter !!, if everything goes well..)
Cheers,
- David
----------------------------------------------------------------------
/* We use <limits.h> values to know the sizes of the types. */
#include <limits.h>
/* The number of bytes in an `int' type. */
#if UINT_MAX == 0xFFFFFFFF
#define FT_SIZEOF_INT 4
#elif UINT_MAX == 0xFFFF
#define FT_SIZEOF_INT 2
#elif UINT_MAX > 0xFFFFFFFF && UINT_MAX == 0xFFFFFFFFFFFFFFFF
#define FT_SIZEOF_INT 8
#else
#error "Unsupported number of bytes in `int' type!"
#endif
/* The number of bytes in a `long' type. */
#if ULONG_MAX == 0xFFFFFFFF
#define FT_SIZEOF_LONG 4
#elif ULONG_MAX > 0xFFFFFFFF && ULONG_MAX == 0xFFFFFFFFFFFFFFFF
#define FT_SIZEOF_LONG 8
#else
#error "Unsupported number of bytes in `long' type!"
#endif
... later ...
typedef signed short FT_Int16;
typedef unsigned short FT_UInt16;
#if FT_SIZEOF_INT == 4
typedef signed int FT_Int32;
typedef unsigned int FT_UInt32;
#elif FT_SIZEOF_LONG == 4
typedef signed long FT_Int32;
typedef unsigned long FT_UInt32;
#else
#error "no 32bit type found - please check your configuration files"
#endif
> >
> > Other than that, I don't think we really need to make FT_Pos a 32-bit
> > quantity, just take care of what we're doing in the library. But
> > maybe this would ease the engine's maintenance ?
> >
>
> Regards,
>
> Tom