maradydd: (Default)
maradydd ([personal profile] maradydd) wrote2005-04-05 02:30 am
Entry tags:

(no subject)

I have written compiler-specific code. Cf. "mood".

[identity profile] maradydd.livejournal.com 2005-04-05 08:05 am (UTC)(link)
I'm working on a SWIG wrapper for a function which (at the moment) has a float** as one of its arguments. In one of my rewrite attempts, I exploited the fact that gcc will let you specify the bounds of an array parameter as variables within the scope of a function declaration, as long as those variables are passed in first. Evidently this is a gcc-specific extension, though I'd be surprised if other compilers didn't do it too.

It compiles, but the generated wrapper doesn't (before, both the C and the wrapper compiled, but there was a runtime complaint in the interpreter about expecting a pointer type). Reading through the docs more closely, I see that I actually need to use a typemap, which should make things considerably less ugly, so now I'm working on wrapping my head around that.