[project @ 2002-07-24 09:44:37 by simonmar]
authorsimonmar <unknown>
Wed, 24 Jul 2002 09:44:37 +0000 (09:44 +0000)
committersimonmar <unknown>
Wed, 24 Jul 2002 09:44:37 +0000 (09:44 +0000)
Add #offset for just grabbing the byte offset of a struct field.

ghc/utils/hsc2hs/template-hsc.h

index a77c253..fdd4b76 100644 (file)
@@ -66,6 +66,9 @@
 #define hsc_ptr(t, f) \
     printf ("(\\hsc_ptr -> hsc_ptr `plusPtr` %ld)", (long) offsetof (t, f));
 
+#define hsc_offset(t, f) \
+    printf("(%ld)", (long) offsetof (t, f));
+
 #define hsc_enum(t, f, print_name, x)         \
     print_name;                               \
     printf (" :: %s\n", #t);                  \