freetype-devel
[Top][All Lists]
Advanced

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

Re: Bugs, bugs, bugs.


From: Joerg Pommnitz
Subject: Re: Bugs, bugs, bugs.
Date: Mon, 31 Jul 2000 19:11:40 +0200

Use
#include <stddef.h>

offset = offsetof(type,member);

This is how an ANSI complian program is supposed to
do what you want.


----- Original Message ----- 
From: Werner LEMBERG <address@hidden>
To: <address@hidden>
Cc: <address@hidden>
Sent: Monday, July 31, 2000 6:56 PM
Subject: Re: Bugs, bugs, bugs.


> 
> >         FT_FRAME_USHORT( num_tables ),
> > 
> > The error message is:
> > 
> > Error   : illegal constant expression
> > 
> > I traced it down to this macro:
> > 
> > #define FT_FIELD_OFFSET( f ) \
> >           (FT_UShort)( (char*)&(((FT_STRUCTURE*)0)->f) - (char*)0 )
> > 
> > It's complaining about the (char*)0 bit.
> > 
> > I have no idea how to fix this correctly (it looks pretty hack-ish
> > to me ;-).
> 
> Basically, it isn't `hackish'.  Previously, the macro directly
> converted a (char *) to FT_UShort -- some compilers dislike this.
> Now, we have a substraction of two (char *) pointers which always
> yields an integer.
> 
> How does your compiler defines NULL?  Please try (void*) instead of
> (char*) for both pointers.
> 
> 
>     Werner




reply via email to

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