From: Gabor Csardi Date: 2007-07-03T23:08:01+09:00 Subject: Re: Name clash in C extension Alex, i'm an igraph developer, and there is an easy solution for this i think, all you need is to append #ifdef TYPE #undef TYPE #endif #ifdef FUNCTION #undef FUNCTION #endif to the file igraph_pmt_off.h. (This was an igraph bug, not having these there.) Please feel free to contact me if you need any help. Best, Gabor Alex Gutteridge wrote: > Hi, > > I'm trying to write an extension interfacing with the C iGraph > library (http://cneurocvs.rmki.kfki.hu/igraph/). Unfortunately the > iGraph header files define a macro called TYPE which clashes with the > TYPE macro defined in ruby.h. Both headers are obviously required to > compile my extension. > > What is the best practice for dealing with name clashes like this? My > current solution is to do a search and replace in the iGraph source > changing TYPE to IGRAPH_TYPE and recompile the library. That works > for now, but implies anyone else wanting to build my extension will > have to manually hack iGraph themselves which seems a bit off. Am I > missing some obvious solution other than emailing iGraph/Ruby core > and asking for them to play a bit nicer with their names? > > Alex Gutteridge > > Bioinformatics Center > Kyoto University -- Posted via http://www.ruby-forum.com/.