Wrapping code with #ifdef-#endif

If you need to wrap an operation with an #ifdef #endif pair, add a compiler-specific keyword, or add a #pragma directive, you can set the SpecificationProlog, SpecificationEpilog, ImplementationProlog, and ImplementationEpilog properties for the operation.

About this task

For example, to specify that an operation is available only when the code is compiled with _DEBUG:

  • Set SpecificationProlog to #ifdef _DEBUG <CR>.
  • Set SpecificationEpilog to #endif.
  • Set ImplementationProlog to #ifdef _DEBUG <CR>.
  • Set ImplementationEpilog to #endif.

The same properties are available for configurations, packages, classes, and attributes. For detailed definitions of these properties, see the property definitions displayed in the Features window.