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: mpsuzuki
Subject: Re: [ft-devel] freetype-2.3.7 -- ftconfig.h for biarch systems
Date: Thu, 10 Jul 2008 14:54:06 +0900

On Wed, 9 Jul 2008 23:29:27 +0200
"Antoine Leca" <address@hidden> wrote:

>On Wednesday, July 9th, 2008 , mpsuzuki wrote:
>> Even if we restrict the scope to C99-conforming
>> cpp, there is no portable cpp conditional to check the size
>> of long.
>
>This is a unimportant sidepoint, but you are slightly incorrect here: C99
>requires 64-bit support, so any C99-conforming cpp could correctly detect
>(using your first proposal, among other solutions) 64-bit int's or long's.
>You are correct it is impossible to detect larger than 64-bit architectures
>(for the same reason it is impossible to detect larger-than-32 with C90),
>but on the other hand neither do we care!

Umm, after the checking the public interfaces of FreeType2,
I have to cancel my strong emphasis about the requirement
to check the size of long related to binary compatibilities.

Originally, I was thinking as a few APIs of FreeType2 switch
between single 64bit integer type and a structure including
2 x FT_UInt32, I quote ftcalc.c...

    43  #ifdef FT_LONG64
    44  
    45    typedef FT_INT64  FT_Int64;
    46  
    47  #else
    48  
    49    typedef struct  FT_Int64_
    50    {
    51      FT_UInt32  lo;
    52      FT_UInt32  hi;
    53  
    54    } FT_Int64;
    55  
    56  #endif /* FT_LONG64 */

...

   549    FT_EXPORT_DEF( void )
   550    FT_MulTo64( FT_Int32   x,
   551                FT_Int32   y,
   552                FT_Int64  *z )
   553    {

...

   575    FT_EXPORT_DEF( FT_Int32 )
   576    FT_Div64by32( FT_Int64*  x,
   577                  FT_Int32   y )
   578    {

...

But, when I check the headers to be installed as public APIs of
FreeType2, I found these functions are not declared. They are
no public - rather, they are almost commented out. Oops.

In addition, even on Unix systems with 64-bit integer (LP64 or
gcc's "long long int"), FreeType2 does not enable the implementation
based on native 64-bit integer, by default. Here I quote ftconfig.h...

        #if defined( FT_LONG64 ) && !defined( FT_CONFIG_OPTION_FORCE_INT64 )

        #ifdef __STDC__

          /* Undefine the 64-bit macros in strict ANSI compilation mode.  */
          /* Since `#undef' doesn't survive in configuration header files */
          /* we use the postprocessing facility of AC_CONFIG_HEADERS to   */
          /* replace the leading `/' with `#'.                            */
        #undef FT_LONG64
        #undef FT_INT64

        #endif /* __STDC__ */

        #endif /* FT_LONG64 && !FT_CONFIG_OPTION_FORCE_INT64 */

--

At present, yet I'm not in perfect understand of the utilization
of 64-bit integer in FreeType2 source code, so I want to restrict
my scope to the improvement of FT_SIZEOF_INT & FT_SIZEOF_LONG.
I want to define my task as "how to give their default values as
if we executed configure script". I want to define the utilization
of native 64-bit integer as another task, because more careful
source investigation and source code cleaning-up will be expected.

Yet I've not prepared the environment to do an experiment
"If I execute configure on Unix-like system whose int is 16bit,
how FreeType2 would be configured", but I want to give the correct
values to FT_SIZEOF_INT & FT_SIZEOF_LONG. If they cause some
troubles, basically, the improvement should be done by checking
the calculation algorithm, instead of giving incorrect-but-working
values to FT_SIZEOF_INT & FT_SIZEOF_LONG.

Regards,
mpsuzuki




reply via email to

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