1 #if __GLASGOW_HASKELL__ && __GLASGOW_HASKELL__ < 409
11 #define offsetof(t, f) ((size_t) &((t *)0)->f)
14 #define hsc_const(x) \
16 printf ("%ld", (long)(x)); \
18 printf ("%lu", (unsigned long)(x));
20 #define hsc_const_str(x) \
22 const char *s = (x); \
26 if (*s == '"' || *s == '\\') \
27 printf ("\\%c", *s); \
28 else if (*s >= 0x20 && *s <= 0x7E) \
33 s[1] >= '0' && s[1] <= '9' ? "\\&" : ""); \
40 if ((t)(int)(t)1.4 == (t)1.4) \
42 (t)(-1) < (t)0 ? "Int" : "Word", \
46 sizeof (t) > sizeof (double) ? "LDouble" : \
47 sizeof (t) == sizeof (double) ? "Double" : \
50 #define hsc_peek(t, f) \
51 printf ("(\\hsc_ptr -> peekByteOff hsc_ptr %ld)", (long) offsetof (t, f));
53 #define hsc_poke(t, f) \
54 printf ("(\\hsc_ptr -> pokeByteOff hsc_ptr %ld)", (long) offsetof (t, f));
56 #define hsc_ptr(t, f) \
57 printf ("(\\hsc_ptr -> hsc_ptr `plusPtr` %ld)", (long) offsetof (t, f));