tags:

views:

46

answers:

1

I was trying to compile a ruby module, and my compiler choked. I think it might have something to do with a line in ruby.h:

void rb_check_type _((VALUE,int));

I've never seen this _ syntax before. What does it mean? Could it cause problems for my compiler (Visual Studio)?

+2  A: 

It strongly looks like a macro invocation with a macro named '_'. Its the double-parens that are the giveaway. You usually only see that in calls to complex macros that want to be able to generate function calls with arbitrary numbers of parameters.

So, the various possibilities would seem to be:

  1. The macro shouldn't be called '_' and something has damaged that line. Maybe rb_check_type_ is the correct name of the macro. Maybe something else is. Look for similar calls and see how they differ.
  2. The macro really is '_' and its not being defined for some reason. That would depend on the header files you include. Have you, perhaps, forgotten one?
  3. The macro exists and really is '_' but its expanding to something wrong. That could be checked by looking at the macro-expanded output of the compiler. Most compilers have a way to request that.

I can't really give you any more advice than that as you didn't give any specifics as to what error was actually produced by your compiler.

swestrup