[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [Freetype] Lonely Longs
From: |
Werner LEMBERG |
Subject: |
Re: [Freetype] Lonely Longs |
Date: |
Tue, 27 Jul 2004 01:58:26 +0200 (CEST) |
From: Aurio Sectio <address@hidden>
Subject: [Freetype] Lonely Longs
Date: Tue, 17 Sep 2002 13:08:10 -0700 (PDT)
I know this reply is two years late, but...
> What is the recommended practice for systems that have a
> non-standard number of bytes for the long data type? (A long takes
> 5 bytes on the 6211 DSP!) Compilation crashes in ftconfig.h since
> only 4 and 8 byte longs are supported.
Have you ever found a solution? Currently, we have this in ftconfig.h
which is a bit more sophisticated than two years ago:
----
/* There are systems (like the Texas Instruments 'C54x) where a `char' */
/* has 16 bits. ANSI C says that sizeof(char) is always 1. Since an */
/* `int' has 16 bits also for this system, sizeof(int) gives 1 which */
/* is probably unexpected. */
/* */
/* `CHAR_BIT' (defined in limits.h) gives the number of bits in a */
/* `char' type. */
#ifndef FT_CHAR_BIT
#define FT_CHAR_BIT CHAR_BIT
#endif
/* The size of an `int' type. */
#if FT_UINT_MAX == 0xFFFFFFFFUL
#define FT_SIZEOF_INT (32 / FT_CHAR_BIT)
#elif FT_UINT_MAX == 0xFFFFU
#define FT_SIZEOF_INT (16 / FT_CHAR_BIT)
#elif FT_UINT_MAX > 0xFFFFFFFFU && FT_UINT_MAX == 0xFFFFFFFFFFFFFFFFU
#define FT_SIZEOF_INT (64 / FT_CHAR_BIT)
#else
#error "Unsupported size of `int' type!"
#endif
/* The size of a `long' type. */
#if FT_ULONG_MAX == 0xFFFFFFFFUL
#define FT_SIZEOF_LONG (32 / FT_CHAR_BIT)
#elif FT_ULONG_MAX > 0xFFFFFFFFU && FT_ULONG_MAX == 0xFFFFFFFFFFFFFFFFU
#define FT_SIZEOF_LONG (64 / FT_CHAR_BIT)
#else
#error "Unsupported size of `long' type!"
#endif
----
Can you extend it to cover your particular platform?
Werner
- Re: [Freetype] Lonely Longs,
Werner LEMBERG <=