Supported Pragma Directives |
The Wave preprocessor library supports a couple of specific #pragma directives, which may be used to control some of the library features. All directives described here are usable as conventional #pragma directives and as operator _Pragma (if variadics are enabled). So for instance the following directives are functionally identical.
#pragma wave trace(enable)
and
_Pragma("wave trace(enable)")
All Wave specific pragma's must have the general form 'wave option[(value)]', where 'wave' is the specific keyword, 'option' is the concrete pragma functionality to trigger and 'value' is an optional value to be supplied to the 'option' functionality. The following table lists all possible pragma functions supported by the Wave library.
Supported pragma's |
||
pragma option |
pragma value |
description |
trace |
enable/disable |
Enable or disable the tracing of the macro expansion process. This is needed, even if there is given the --trace command line option, because the trace output is generated only, if there is at least one trace(enable) pragma found. |
stop |
message |
Stop the execution of Wave and print out the given message. This is very helpful for direct debugging purposes. |
system |
command |
Try to spawn the 'command' as a new operating system
command and intercept the generated stdout and stderr. The stdout output
of this command (if any) is retokenized and used as the replacement text
for the whole pragma, the stderr output is ignored. The command is considered
to be successful, if/when the return value is zero, otherwise an error
is reported. |
All pragma's not listed here but flagged as 'wave' are reported as
errors. The handling of all remaining pragma's depends on the compilation constant
WAVE_RETURN_PRAGMA_DIRECTIVES
, which allows to specify,
if those pragmas are left unchanged in the output stream or not. Please note,
that the operator _Pragma variant is always subject to full preprocessing, before
the pragma itself is evaluated. The #pragma variant is subject to preprocessing
only, if the WAVE_PREPROCESS_PRAGMA_BODY
compilation constant
was specified during compilation.For more information about the possible compilation
constants look here.
Copyright © 2003 Hartmut Kaiser
Permission to copy, use, modify, sell and distribute this document
is granted provided this copyright notice appears in all copies. This document
is provided "as is" without express or implied warranty, and with
no claim as to its suitability for any purpose.