[vtk-developers] Added __WRAP__ preprocessor macro to replace BTX

David Gobbi david.gobbi at gmail.com
Tue Oct 12 13:07:47 EDT 2010


On Tue, Oct 12, 2010 at 10:48 AM, Sean McBride <sean at rogue-research.com> wrote:
> On Tue, 12 Oct 2010 10:21:23 -0600, David Gobbi said:
>
>>Inspired by the "#ifndef__GCCXML__" blocks in ITK, I have added a new
>>"__WRAP__" preprocessor symbol that can be used to block off code:
>>
>>#if !defined(__WRAP__)
>>// code exclusion section
>>#endif
>
> Instead of "__WRAP__", something like "VTK_WRAP" would be better
> because, from the 2003 C++ Standard:
>
> 17.4.3.2.1 Global names [lib.global.names]
> Certain sets of names and function signatures are always reserved to the
> implementation:
>
>  - Each name that contains a double underscore (_ _) or begins with an
> underscore followed by an uppercase letter is reserved to the
> implementation for any use.
>
>  - Each name that begins with an underscore is reserved to the
> implementation for use as a name in the global namespace.
>
> See also:
>
> <http://stackoverflow.com/questions/228783/what-are-the-rules-about-
> using-an-underscore-in-a-c-identifier>
>
> <https://www.securecoding.cert.org/confluence/display/seccode/DCL37-C.+Do
> +not+use+identifiers+that+are+reserved+for+the+implementation>

The wrappers-generators are, in fact, an "implementation," so I don't
see this as an issue.  Nowhere in any code will you see a "#define
__WRAP__".  The wrapper-generator predefines this symbol, just like
any compiler will predefine its implementation-specific macros.

  David



More information about the vtk-developers mailing list