
20 Jan
2008
20 Jan
'08
5:19 p.m.
Adam Langley wrote:
Since CPP mode removes newlines in the out macro expansion. It appears to be impossible to have a macro expand to a function with an INLINE pragma since it appears to need to be in its own line.
that's because INLINE uses layout like everything else, so you can use semicolons for it too.
For example:
#define GETHOSTWORD(name, m, type) \ {-# INLINE name #-} \ name :: m type ; \ name = getPtr (sizeOf (undefined :: type)) \
something like #define GETHOSTWORD(name, m, type) \ {-# INLINE name #-} ; \ name :: m type ; \ name = getPtr (sizeOf (undefined :: type)) \ ~Isaac