Ticket #20 (closed defect: fixed)

Opened 5 months ago

Last modified 5 months ago

freetype.fttypes on 64Bit

Reported by: Krox Assigned to:
Priority: major Version:
Keywords: Cc:

Description

I am working with GDC on Linux x86-64 and encountered some bug(s) in freetype.fttypes which resulted in getting a lot of segfaults. The Solution was hard to find but easy to do. Its just some 32 vs 64 Bit problems. With the following modifications it works nicely for me.

* FT_Pos is defined as int, should be size_t

* FT_F26Dot6 and FT_Fixed are defined as int, should be ptrdiff_t (sounds strange, but in the original C-Header its "long", and I think we should match)

* FT_Offset, FT_PtrDiff, FT_Long, FT_ULong are defined according to version=CPU64BIT. Would be better to declare it as size_t/ptrdiff_t. (At least I needed it, cause CPU64BIT wasn't defined. But that may be, because I simply copied some code into my project, and not not used the real derelict lib. But anyway, would be nice to work for that case too)

Change History

05/20/08 04:25:06 changed by Cyborg16

Please see this ticket for an updated version of the freetype bindings: http://www.dsource.org/projects/derelict/ticket/19

Some of the above had already been corrected, but not all. Thanks for the report!

I don't know what CPU64BIT was doing to start with; X86_64 is the compiler set 64-bit identifier. I'd rather not use pointer types for non-pointers, so this should probably do the trick. Please confirm whether it works!

However, I'm not certain that all 64-bit C compilers make long a 64-bit type which might be an issue... but then it would also affect C code compiled with different compilers.

05/20/08 11:16:52 changed by Krox

  • status changed from new to closed.
  • resolution set to fixed.

yeah, those bindings work for me. (an problably its a cleaner approach than mine) Thanks and sorry, I hadn't noticed that patch