freetype
[Top][All Lists]
Advanced

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

Re: [ft] Why is FT_F26Dot6 defined as a signed long


From: armin
Subject: Re: [ft] Why is FT_F26Dot6 defined as a signed long
Date: Fri, 15 Feb 2019 09:24:37 -0000

>> > Interesting, but on a 32bit platform, with long == 32 bits, that 
>> > wouldn't work.
>>
>> There is this thing called “LP64” versus “LLP64”, for describing code 
>> generation on 64-bit architectures. GCC (and I think all the other 
>> compilers that work on Linux) is “LP64”, which means that “long” and 
>> pointers are both 64 bits. On Windows, it seems “LLP64” is the norm, 
>> where “long” is 32 bits and you need to say “long long” to get 64 bits.
>>
>> C99 introduced the stdint.h include file, which gives explicit names 
>> to you can use to request particular sizes of integers, to avoid this 
>> discrepancy.
>
> Yes, In my update-types.patch experiment I used stdint.h and changed the
> typedef's of FT_{U}Int{16, 32, 64) to use {u}int{16, 32, 64}. But doing that
> caused some warnings, which after "fixing" the resulting library failed with a
> memory corruption fault loading a font.
>
> So unless the maintainers think it would be worth putting more effort in this
> direction, I'll just leave it as a starting point for some future date.

It does sound very interesting indeed!  @Werner:  has something like that been 
tried already at some point and where/why would it fail?




reply via email to

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