1 | <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"> |
---|
2 | <html> |
---|
3 | <head> |
---|
4 | <title>Supported Pragma Directives</title> |
---|
5 | <meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1"> |
---|
6 | <link href="theme/style.css" rel="stylesheet" type="text/css"> |
---|
7 | </head> |
---|
8 | |
---|
9 | <body> |
---|
10 | <table width="100%" border="0" cellspacing="2" background="theme/bkd2.gif"> |
---|
11 | <tr> |
---|
12 | <td width="21"> <h1></h1></td> |
---|
13 | <td width="885"> <font face="Verdana, Arial, Helvetica, sans-serif"><b><font size="6">Supported |
---|
14 | Pragma Directives</font></b></font></td> |
---|
15 | <td width="96"><a href="http://www.boost.org"><img src="theme/wave.gif" width="93" height="68" align="right" border="0"></a></td> |
---|
16 | </tr> |
---|
17 | </table> |
---|
18 | <br> |
---|
19 | <table border="0"> |
---|
20 | <tr> |
---|
21 | <td width="10"></td> |
---|
22 | <td width="30"><a href="../index.html"><img src="theme/u_arr.gif" border="0"></a></td> |
---|
23 | <td width="30"><a href="predefined_macros.html"><img src="theme/l_arr.gif" border="0"></a></td> |
---|
24 | <td width="30"><a href="macro_expansion_process.html"><img src="theme/r_arr.gif" border="0"></a></td> |
---|
25 | </tr> |
---|
26 | </table> |
---|
27 | <p>The Wave preprocessor library supports a couple of specific <tt>#pragma</tt> |
---|
28 | directives, which may be used to control some of the library features. All directives |
---|
29 | described here are usable as conventional <tt>#pragma</tt> directives and as |
---|
30 | <tt>operator _Pragma</tt> (if variadics are enabled). So for instance the |
---|
31 | following directives are functionally identical:</p> |
---|
32 | <pre> #pragma wave trace(enable) </pre> |
---|
33 | <p>and </p> |
---|
34 | <pre> _Pragma("wave trace(enable)")</pre> |
---|
35 | <p>All <tt>Wave</tt> specific pragma's must have the general form <tt>'wave option[(value)]'</tt>, |
---|
36 | where <tt>'wave'</tt> is the specific keyword, <tt>'option'</tt> is the concrete |
---|
37 | pragma functionality to trigger and <tt>'value'</tt> is an optional value to |
---|
38 | be supplied to the <tt>'option'</tt> functionality. The following table lists |
---|
39 | all possible pragma functions supported by the <tt>Wave</tt> library. For all recognised pragmas of this general form the interpret_pragma hook function from inside the context_policies are call, so that the user of the library is responsible for </p> |
---|
40 | <table width="77%" border="0" align="center"> |
---|
41 | <tr> |
---|
42 | <td colspan="4"> <p class="table_title">Supported pragma's</p></td> |
---|
43 | </tr> |
---|
44 | <tr> |
---|
45 | <td> <p class="toc_title" width="36%">pragma option</p></td> |
---|
46 | <td> <p class="toc_title" width="28%">pragma value</p></td> |
---|
47 | <td> <p class="toc_title" width="36%">description</p></td> |
---|
48 | <td> <p class="toc_title" width="36%">supported by</p></td> |
---|
49 | </tr> |
---|
50 | <tr> |
---|
51 | <td class="table_cells" width="19%"> <p>trace</p></td> |
---|
52 | <td class="table_cells" width="18%"> <p>enable/on/1<br> |
---|
53 | disable/off/0</p></td> |
---|
54 | <td class="table_cells" width="43%"><p>Enable or disable the tracing of the |
---|
55 | macro expansion process. This is needed, even if there is given the --trace |
---|
56 | command line option, because the trace output is generated only, if there |
---|
57 | is at least one trace(enable) pragma found.</p></td> |
---|
58 | <td class="table_cells" width="20%"><p>Wave driver</p></td> |
---|
59 | </tr> |
---|
60 | <tr> |
---|
61 | <td class="table_cells"><p>stop</p></td> |
---|
62 | <td class="table_cells"><p>message</p></td> |
---|
63 | <td class="table_cells"><p>Stop the execution of <tt>Wave</tt> and print out |
---|
64 | the given message. This is very helpful for direct debugging purposes.</p></td> |
---|
65 | <td class="table_cells"><p>Wave driver</p></td> |
---|
66 | </tr> |
---|
67 | |
---|
68 | <tr> |
---|
69 | <td class="table_cells"><p>system</p></td> |
---|
70 | <td class="table_cells"><p>command</p></td> |
---|
71 | <td class="table_cells"><p>Try to spawn the 'command' as a new operating system |
---|
72 | command and intercept the generated stdout and stderr. The stdout output |
---|
73 | of this command (if any) is retokenized and used as the replacement text |
---|
74 | for the whole pragma, the stderr output is ignored. The command is considered |
---|
75 | to be successful, if/when the return value is zero, otherwise an error |
---|
76 | is reported. <br> |
---|
77 | </p></td> |
---|
78 | <td class="table_cells"><p>Wave driver</p></td> |
---|
79 | </tr> |
---|
80 | <tr> |
---|
81 | <td class="table_cells"><p>timer</p></td> |
---|
82 | <td class="table_cells"><p> restart/0<br> |
---|
83 | <no value> <br> |
---|
84 | suspend<br> |
---|
85 | resume </p></td> |
---|
86 | <td class="table_cells"><p>The value <tt>restart</tt> set the current elapsed |
---|
87 | time to 0 and restarts the timer.<br> |
---|
88 | If no value is provided, the current elpsed time is printed to the std::cerr |
---|
89 | stream.<br> |
---|
90 | The values <tt>suspend</tt> and <tt>resume</tt> allow to temporarily stop |
---|
91 | the timing.</p></td> |
---|
92 | <td class="table_cells"><p>Wave driver</p></td> |
---|
93 | </tr> |
---|
94 | </table> |
---|
95 | <p>All pragma's not listed here but flagged as <tt>'wave'</tt> are reported as |
---|
96 | errors. The handling of all remaining pragma's depends on the compilation constant |
---|
97 | <code><tt>WAVE_RETURN_PRAGMA_DIRECTIVES</tt></code>, which allows to specify, |
---|
98 | if those pragmas are left unchanged in the output stream or not. Please note, |
---|
99 | that the operator _Pragma variant is always subject to full preprocessing, before |
---|
100 | the pragma itself is evaluated. The #pragma variant is subject to preprocessing |
---|
101 | only, if the <code><tt>WAVE_PREPROCESS_PRAGMA_BODY</tt></code> compilation constant |
---|
102 | was specified during compilation. For more information about the possible compilation |
---|
103 | constants look <a href="compiletime_config.html">here</a>.</p> |
---|
104 | <p>Additionally the Wave preprocessor supports the <tt>#pragma once</tt> directive, |
---|
105 | which specifies that the file, in which the pragma resides, will be included |
---|
106 | (opened) only once by the compiler in a build. This may be used to optimize |
---|
107 | the preprocessing of larger compilation units, which include a lot of files. Note though, that the #pragma once directive is supported only, if the compile time constant <tt>WAVE_SUPPORT_PRAGMA_ONCE</tt> was given during compilation of the library</span>.</p> |
---|
108 | <p>It is fairly easy to implement your own <tt>#pragma wave ... </tt> directives. All you have to do is to implement your own <tt>interpret_pragma</tt> function (see <a href="class_reference_ctxpolicy.html#interpret_pragma">here</a>) which should the handle additional directives. For an example of how to do it, you may have a look at the Wave driver application, which implements the <tt>#pragma wave timer()</tt> directive with the help of a supplied <tt>interpret_pragma</tt> function. </p> |
---|
109 | <table border="0"> |
---|
110 | <tr> |
---|
111 | <td width="10"></td> |
---|
112 | <td width="30"><a href="../index.html"><img src="theme/u_arr.gif" border="0"></a></td> |
---|
113 | <td width="30"><a href="predefined_macros.html"><img src="theme/l_arr.gif" border="0"></a></td> |
---|
114 | <td width="30"><a href="macro_expansion_process.html"><img src="theme/r_arr.gif" border="0"></a></td> |
---|
115 | </tr> |
---|
116 | </table> |
---|
117 | <hr size="1"> |
---|
118 | <p class="copyright">Copyright © 2003-2005 Hartmut Kaiser<br> |
---|
119 | <br> |
---|
120 | <font size="2">Distributed under the Boost Software License, Version 1.0. (See accompanying file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) </font> </p> |
---|
121 | <span class="updated"></span> |
---|
122 | <p class="copyright"><span class="updated">Last updated: |
---|
123 | <!-- #BeginDate format:fcAm1m -->Sunday, May 15, 2005 12:23<!-- #EndDate --> |
---|
124 | </span> |
---|
125 | </p> |
---|
126 | <p> </p> |
---|
127 | </body> |
---|
128 | </html> |
---|