strange preprocessor stuff

Jason Kraftcheck kraftche at cae.wisc.edu
Tue Apr 20 16:26:31 CDT 2010


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'?

- jason





More information about the tstt-interface mailing list