freetype-devel
[Top][All Lists]
Advanced

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

Re: [ft-devel] freetype-2.3.7 -- ftconfig.h for biarch systems


From: Peter Breitenlohner
Subject: Re: [ft-devel] freetype-2.3.7 -- ftconfig.h for biarch systems
Date: Wed, 9 Jul 2008 10:00:14 +0200 (CEST)
User-agent: Alpine 1.10 (LNX 962 2008-03-14)

On Tue, 8 Jul 2008, Antoine Leca wrote:

So, I think, using traditional ANSI C header "limits.h"
is more generic than using modern headers "bits/wordsize.h", like...

This is a very good point. I just looked at our i686/x86_64 glibc /usr/include/limits.h header and found these lines:

        #include <bits/wordsize.h>

        #  if __WORDSIZE == 64
        #   define LONG_MAX     9223372036854775807L
        #  else
        #   define LONG_MAX     2147483647L
        #  endif
        #  define LONG_MIN      (-LONG_MAX - 1L)

        #  if __WORDSIZE == 64
        #   define ULONG_MAX    18446744073709551615UL
        #  else
        #   define ULONG_MAX    4294967295UL
        #  endif

Thus, assuming that other biarch versions of <limits.h> do something
analogous (as they certainly do for glibc), testing LONG_MAX should do the
job and there is no need to use <bits/wordsize.h> (that may or may not
exist).

And there should be no problems with
        #if LONG_MAX == 9223372036854775807L
in 32 bit mode, because 9223372036854775807L=0x7fffffffffffffff is truncated
to 0xffffffff whereas LONG_MAX=0x7fffffff.

Best regards
Peter Breitenlohner <address@hidden>




reply via email to

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