23 Feb
2001
23 Feb
'01
10:09 p.m.
On Fri, 23 Feb 2001, Fergus Henderson wrote:
OK, now how about things where you need to #define symbols before including the header file?
Choose one: 1. Write a forwarding header which #defines and #includes. 2. Use compiler-specific switches to get #defines (-D and -optc-D in ghc). 3. Extend the proposed FFI to have define as well as include.
Unfortunately option 1 doesn't always work well on ghc, because Stg.h (included into .hc files) indirectly includes headers like <stdlib.h> *before* user-specified -#include options, so symbols like _BSD_SOURCE are defined too late to have any effects. This should be fixed.
I agree. Would it be fixed by just #including Stg.h after any -#includes, or would that create more problems? Cheers, Simon