Commit b8431ed776cbb63cbd60cbc5a52e77a7660183cf

Werner Lemberg 2000-08-01T01:34:18

Use the ANSI offsetof() macro instead of something home-brewn.

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
diff --git a/include/freetype/internal/ftstream.h b/include/freetype/internal/ftstream.h
index 49543fe..7b35a53 100644
--- a/include/freetype/internal/ftstream.h
+++ b/include/freetype/internal/ftstream.h
@@ -20,6 +20,7 @@
 #define FTSTREAM_H
 
 #include <freetype/internal/ftobjs.h>
+#include <stddef.h>                     /* for offsetof() macro */
 
 
 #ifdef __cplusplus
@@ -95,7 +96,7 @@
 #define FT_FIELD_SIZE_DELTA( f ) \
           (FT_Byte)sizeof ( ((FT_STRUCTURE*)0)->f[0] )
 #define FT_FIELD_OFFSET( f ) \
-          (FT_UShort)( (char*)&(((FT_STRUCTURE*)0)->f) - (char*)0 )
+          (FT_UShort)( offsetof( FT_STRUCTURE, f ) )
 
 #define FT_FRAME_FIELD( frame_op, field ) \
           {                               \