strange preprocessor stuff

Tim Tautges tautges at mcs.anl.gov
Tue Apr 20 20:04:42 CDT 2010


Those sound fine to me.

- tim

Carl Ollivier-Gooch wrote:
> Jason Kraftcheck wrote:
>> iBase.h, iMesh.h, and iGeom.h all appear to contain the following
>> preprocessor statements:
>>
>>   #ifndef ITAPS
>>   #define ITAPS
>>   #endif
>>
>> This is a really generic name for a preprocessor variable.  It will 
>> have the
>> side effect of stripping all instances of the token 'ITAPS' from any code
>> that includes our headers.  One particularly case encountered by 
>> someone at
>> UWisc was as follows:
>>   The directory in which to search for a test file is specified to the
>>     test code at compile time with a preprocessor macro: -DSRCDIR=...
>>   The code does something like:
>>     const char* input_file = STRINGIFY(SRCDIR) "/input.vtk";
>>
>> If the user has the source installed in a location such that one of the
>> components of the path is 'ITAPS' (or in this case 'ITAPS-src'), then the
>> preprocessor will remove the 'ITAPS' string from the path, causing the 
>> test
>> to fail because it cannot load the input file.
>>
>> I cannot find anywhere where this preprocessor macro is used.  Does 
>> anyone
>> know why we have this in the headers?  Can it be removed?  Or if not, 
>> can it
>> be renamed to something like '_ITAPS_INTERFACE'?
> 
> The reason for having -something- like this -somewhere- is so that an 
> implementation can choose to compile things differently when it's not 
> using ITAPS.  Since my implementation does this, it's entirely possible 
> that I started the whole thing.  Changing the name to something sensible 
> would be a good idea, though.  Maybe _ITAPS_iBase, _ITAPS_iMesh, etc?
> 
> Carl
> 

-- 
================================================================
"You will keep in perfect peace him whose mind is
   steadfast, because he trusts in you."               Isaiah 26:3

              Tim Tautges            Argonne National Laboratory
          (tautges at mcs.anl.gov)      (telecommuting from UW-Madison)
          phone: (608) 263-8485      1500 Engineering Dr.
            fax: (608) 263-4499      Madison, WI 53706



More information about the tstt-interface mailing list