From: angico Date: 2009-10-12T23:35:33+09:00 Subject: Re: Does ruby.h overrides C "enum"? Hi, ------ On Monday 12 October 2009 11:17:08 Iñaki Baz Castillo wrote: > El Lunes, 12 de Octubre de 2009, Iñaki Baz Castillo escribió: > > Hi, writting a Ruby C extension (for 1.8 or 1.9) I get an error when > > using "enum": > > > > #include "ruby.h" > > int void(void) { > > enum kk {ONE, TWO, THREE}; // line 3 > > } > > > > line 3: error: expected identifier before ‘(’ token > > > > > > It doesn't occur if I quit "ruby.h". What is happening? > > opss, the same error occurs if I add "#include ". Are you sure the typo was only in the mail? If I copy and paste this code in a file and try to compile it, the compiler complains about the same error, because void is a reserved keyword in C. But when I change that "void(void)" into "main(void)" it compiles ok. -- angico ------ Site: angico.org Blog: angico.org/blog Gnu/Linux, FLOSS, Espiritismo, e eu por mim mesmo 8^I == Cooperação é _muito_ melhor que competição == ------ contatos: email: angico@angico.org skype: angico00