
Manuel M T Chakravarty wrote:
In the meantime, as a stop gap measure, we can use the C pre-processor to get rid of the pesky __asm__ and __attribute__ annotations by passing the following additional arguments to the pre-processor
Another option is to call the preprocessor as "cpp", not as "gcc". This way cpp will only see standard code, without GNU extensions. Incidentally, I stumbled upon this in connection with libdb. It references types named u_int8_t, u_int32_t and so on, which are typedef'd as "unsigned int" with some obscure and afaict undocumented __attribute__. C2hs throws the __attribute__ away and consequently thinks sizeof(u_int8_t)==4. Ouch. Passing -c cpp to c2hs, I get more standard definitions and everything works, apart from u_int64_t going missing. I'm not sure how to fix this in general and whether we should try at all. Maybe these integer types need special treatment... and special cases are ugly. Udo. -- I guess it's time I learnt how to interface to foreign code, any pointers?