From: simonmar Date: Wed, 24 Jul 2002 09:44:37 +0000 (+0000) Subject: [project @ 2002-07-24 09:44:37 by simonmar] X-Git-Tag: Approx_11550_changesets_converted~1807 X-Git-Url: http://git.megacz.com/?a=commitdiff_plain;h=867771adb857893695710ab6ce2dc9358c6d4189;p=ghc-hetmet.git [project @ 2002-07-24 09:44:37 by simonmar] Add #offset for just grabbing the byte offset of a struct field. --- diff --git a/ghc/utils/hsc2hs/template-hsc.h b/ghc/utils/hsc2hs/template-hsc.h index a77c253..fdd4b76 100644 --- a/ghc/utils/hsc2hs/template-hsc.h +++ b/ghc/utils/hsc2hs/template-hsc.h @@ -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); \