When I include ruby.h, I’m getting new macros defined such as
strcmpcase,
and close on the Windows platform. This is conflicting with macros and
function names in my own project. Is there a way to disable these macro
definitions?
Am Donnerstag, 12. Feb 2009, 09:11:18 +0900 schrieb John Ky:
When I include ruby.h, I’m getting new macros defined such as strcmpcase,
and close on the Windows platform. This is conflicting with macros and
function names in my own project. Is there a way to disable these macro
definitions?
In my humble opinion, it were a lucky decision to name it
“rb_strcmpcase” instead of “strcmpcase”. (Besides that,
“strcmpcase” is a bad example as it does’t occur.) Anyhow, you
should yourself name your functions like “jk_strcmpcase”.
This is a poor answer, I know. But C isn’t an object-oriented
language and there’s no namespace solution provided.
At Thu, 12 Feb 2009 09:11:18 +0900,
John Ky wrote in [ruby-talk:327815]:
When I include ruby.h, I’m getting new macros defined such as strcmpcase,
and close on the Windows platform. This is conflicting with macros and
function names in my own project. Is there a way to disable these macro
definitions?
There is no strcmpcase, so I guess you meant strcasecmp in
win32.h, right?
These definitions are specific for MSVCRT which doesn’t provide
these standard functions, and if you have same functions, you
can #undef them of course.
This forum is not affiliated to the Ruby language, Ruby on Rails framework, nor any Ruby applications discussed here.