freetype-devel
[Top][All Lists]
Advanced

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

AW: [Devel] on ((s*)0)->f constructs


From: Jörg Pommnitz
Subject: AW: [Devel] on ((s*)0)->f constructs
Date: Thu, 21 Dec 2000 19:33:31 +0100

How about a real pointer variable that happens to
be NULL.

static void *p = 0;
#define FT_FIELD_SIZE( f ) \
          (FT_Byte)sizeof ( ((FT_STRUCTURE*)p)->f )

This should work just fine, I think.

Regards
  Joerg


-----Ursprüngliche Nachricht-----
Von: address@hidden [mailto:address@hidden
Auftrag von Tom Kacvinsky
Gesendet am: Donnerstag, 21. Dezember 2000 19:14
An: address@hidden
Betreff: [Devel] on ((s*)0)->f constructs

I was taking alook in include/freetype/internal/ftstream.h,
and saw this:

#define FT_FIELD_SIZE( f ) \
          (FT_Byte)sizeof ( ((FT_STRUCTURE*)0)->f )

#define FT_FIELD_SIZE_DELTA( f ) \
          (FT_Byte)sizeof ( ((FT_STRUCTURE*)0)->f[0] )

Considering Rich Stephens' report about ((s*)0)->f constructs causing the
AS400
compiler to barf, I tend to think that the above constructs also might cause
problems.  Unfortunately, I can't think of a way to get around use of
((s*)0)->f
in the above macros.








_______________________________________________
Devel mailing list
address@hidden
http://www.freetype.org/mailman/listinfo/devel



reply via email to

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