[MOAB-dev] portability issue/question

Paul Wilson wilsonp at engr.wisc.edu
Thu Jul 29 07:00:57 CDT 2010


Hello,

I am integrating MOAB/DAGMC into a c++ code that includes a header that 
defines index() as a macro, apparently through some combination of 
system headers. 
This creates a problem with including moab/Range.hpp because it attempts 
to define a member function index().  Fortunately it creates a compile 
time failure because the signature of the Range::index() is different 
from the macro, otherwise who knows what would happen???

I haven't bothered to track it down yet, but the short solution has been 
to add the following immediately prior to the include:

#ifdef index
#undef index
#endif

I have resisted committing this to the repo because it seems like a 
little presumptious/overbearing.  Any other solutions?

Paul

-- 
Paul Wilson

-- ------------------------------------------------------------------ --
Paul P.H. Wilson              419 Engineering Research Building
wilsonp at engr.wisc.edu                       1500 Engineering Dr
ph/fax: 608/263-0807                          Madison, WI 53706

           My calendar: http://bit.ly/pphw-calendar

       Computational Nuclear Engineering Research Group
               http://cnerg.engr.wisc.edu

          Associate Professor, Nuclear Engineering
              Engineering Physics Department     
               http://www.engr.wisc.edu/ep       

        Chair, Energy Analysis & Policy Certificate
         Nelson Institute for Environmental Studies
                http://nelson.wisc.edu/eap/

          Contributing to the joy and improvement
                  of all those around me

-------------- next part --------------
A non-text attachment was scrubbed...
Name: smime.p7s
Type: application/x-pkcs7-signature
Size: 3297 bytes
Desc: S/MIME Cryptographic Signature
URL: <http://lists.mcs.anl.gov/pipermail/moab-dev/attachments/20100729/3385b96f/attachment.bin>


More information about the moab-dev mailing list