Ross Bamford
11/24/2006 1:41:00 PM
Hi,
Just wondering if there's a way to get Rdoc to run the C preprocessor
over .c files it's documenting? I like to use macros to define method
functions and so on, but I often run up against limitations of Rdoc wrt.
finding comments for functions and so on. Right now I end up doing:
/*
* rdoc comment
*/
static VALUE some_attr_setter(VALUE self, VALUE val) {
OBJ_SETTER(ruby_wrapped_type, val);
}
But I'd rather do:
/*
* rdoc comment
*/
OBJ_SETTER(some_attr_setter, ruby_wrapped_type, val);
which doesn't work. Another one I've found is:
/* rdoc comment */
#ifdef SOMETHING
rb_define_const(cSomeClass, "SOMETHING", INT2FIX(SOMETHING));
#else
rb_define_const(cSomeClass, "SOMETHING", INT2FIX(-1));
#endif
which ends up being documented twice, with both values, neither with the
attached comment.
Obviously there are workarounds but, as I say, I just wondered if this
was possible, or if there was a better way to approach these kinds of
problems.
Cheers,
Ross
--
Ross Bamford - rosco@roscopeco.REMOVE.co.uk