Click here to Skip to main content
15,881,882 members
Articles / Programming Languages / C++

Wave: a Standard conformant C++ preprocessor library

Rate me:
Please Sign up or sign in to vote.
4.96/5 (58 votes)
10 Jan 200413 min read 394.7K   4.4K   81  
Describes a free and fully Standard conformant C++ preprocessor library
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
<head>
<title>Predefined Macros</title>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
<link href="theme/style.css" rel="stylesheet" type="text/css">
</head>

<body>
<table width="100%" border="0" cellspacing="2" background="theme/bkd2.gif">
  <tr> 
    <td width="21"> <h1></h1></td>
    <td width="885"> <font face="Verdana, Arial, Helvetica, sans-serif"><b><font size="6">Predefined 
      Macros </font></b></font></td>
    <td width="96"><a href="http://spirit.sf.net"><img src="theme/wave.gif" width="93" height="68" align="right" border="0"></a></td>
  </tr>
</table>
<br>
<table border="0">
  <tr> 
    <td width="10"></td>
    <td width="30"><a href="index.html"><img src="theme/u_arr.gif" border="0"></a></td>
    <td width="30"><a href="class_reference_inputpolicy.html"><img src="theme/l_arr.gif" width="20" height="19" border="0"></a></td>
    <td width="20"><a href="supported_pragmas.html"><img src="theme/r_arr.gif" border="0"></a></td>
  </tr>
</table>
<p dir="ltr">The following table lists the macros, which are predefined by the 
  <tt>Wave</tt> library. Some of these (all except the <code class="keyword">__LINE__</code>, 
  <code class="keyword">__FILE__</code>, <code class="keyword">__DATE__</code>, 
  <code class="keyword">__TIME__</code>, <code class="keyword">__STDC__, __INCLUDE_LEVEL__</code> 
  and <code class="keyword">__cplusplus</code> macros, in C++0x mode the <code><tt>__STDC_GLOBAL__</tt></code>, 
  <tt>__STDC_FULL_REGION__</tt> and <tt>__STDC__CURRENT_REGION__</tt> macros are 
  not undefinable too) may be undefined from the command line of the driver executable 
  (<a href="wave_driver.html">see</a> the -U option) or through the function <a href="class_reference_context.html#remove_macro_definition">remove_macro_definition()</a>.</p>
<p dir="ltr">In C++0x mode the predefined macros are available at every macro 
  scope (except <tt>__STDC_GLOBAL__</tt>, which is available at global macro scope 
  only).</p>
<table width="90%" border="0" align="center">
  <tr> 
    <td colspan="3" class="table_title"><b>Summary of predefined macros</b></td>
  </tr>
  <tr class="table_title"> 
    <td width="28%"><b>Name</b></td>
    <td width="62%"><p><code><font face="Verdana, Arial, Helvetica, sans-serif">Value</font></code></p></td>
    <td width="10%">Undefinable</td>
  </tr>
  <tr> 
    <td width="28%" class="table_cells"><code>__STDC__</code></td>
    <td width="62%" class="table_cells"><p> 1 (a decimal constant)</p></td>
    <td width="10%" class="table_cells"><p>yes</p></td>
  </tr>
  <tr> 
    <td width="28%" class="table_cells"><code>__cplusplus</code></td>
    <td width="62%" class="table_cells"> <p>199711L (a decimal constant), this 
        is defined in C++ mode only (C99 mode is off)<br>
        In the C++0x mode this decimal constant is guaranteed to be larger than 
        199711L (the concrete value is to be defined by the C++ committee).</p></td>
    <td width="10%" class="table_cells"><p>no</p></td>
  </tr>
  <tr> 
    <td class="table_cells"><code>__LINE__</code></td>
    <td class="table_cells"><p>The line number of the current source line (a decimal 
        constant)</p></td>
    <td class="table_cells"><p>no</p></td>
  </tr>
  <tr> 
    <td class="table_cells"><code>__FILE__</code></td>
    <td class="table_cells"><p>The presumed name of the source file (a character 
        string literal)</p></td>
    <td class="table_cells"><p>no</p></td>
  </tr>
  <tr> 
    <td class="table_cells"><code>__DATE__</code></td>
    <td class="table_cells"><p>The date of translation of the source file (a character 
        string literal of the form<br>
        &quot;Mmm dd yyyy&quot;, where the names of the months are the same as 
        those generated by the asctime function, and the first character of dd 
        is a space character if the value is less than 10). </p></td>
    <td class="table_cells"><p>no</p></td>
  </tr>
  <tr> 
    <td class="table_cells"><code>__TIME__</code></td>
    <td class="table_cells"><p>The time of translation of the source file (a character 
        string literal of the form &quot;hh:mm:ss&quot;<br>
        as in the time generated by the asctime function).</p></td>
    <td class="table_cells"><p>no</p></td>
  </tr>
  <tr> 
    <td class="table_cells"><code>__INCLUDE_LEVEL__</code></td>
    <td class="table_cells"><p>A decimal integer constant that represents the 
        depth of nesting in include <br>
        files. The value of this macro is incremented on every <tt>#include</tt> 
        directive <br>
        and decremented at every end of file. </p></td>
    <td class="table_cells"><p>no</p></td>
  </tr>
  <tr> 
    <td class="table_cells"><code>__WAVE__</code><br> <code>__SPIRIT_PP__</code></td>
    <td class="table_cells"><p>The version of the driver program (a hexadecinal 
        constant of the form 0xMmrr, where <span class="literal">'M'</span> is 
        the major version number, <span class="literal">'m'</span> the minor version 
        number and <span class="literal">'rr'</span> the release number).</p></td>
    <td class="table_cells"><p>yes</p></td>
  </tr>
  <tr> 
    <td class="table_cells"><code>__WAVE_VERSION__</code><br> <code>__SPIRIT_PP_VERSION__</code></td>
    <td class="table_cells"><p>The full version number of the driver program (a 
        hexadecinal constant of the form 0xMmrrbbbb, where <span class="literal">'M'</span> 
        is the major version number, <span class="literal">'m'</span> the minor 
        version number, <span class="literal">'rr'</span> the release number and 
        <span class="literal">'bbbb'</span> the build number).</p></td>
    <td class="table_cells"><p>yes</p></td>
  </tr>
  <tr> 
    <td class="table_cells"><code>__WAVE_VERSION_STR__</code><br> <code>__SPIRIT_PP_VERSION_STR__</code></td>
    <td class="table_cells"><p>The full version number of the driver program (a 
        character string literal of the form <span class="string">&quot;M.m.rr.bbbb&quot;</span>, 
        where <span class="literal">'M'</span> is the major version number, <span class="literal">'m'</span> 
        the minor version number, <span class="literal">'rr'</span> the release 
        number and <span class="literal">'bbbb'</span> the build number).</p></td>
    <td class="table_cells"><p>yes</p></td>
  </tr>
  <tr> 
    <td class="table_cells"><code>__STDC_VERSION__</code></td>
    <td class="table_cells"><p>199901L (a decimal constant), this is defined in 
        C99 mode only</p></td>
    <td class="table_cells"><p>yes</p></td>
  </tr>
  <tr> 
    <td class="table_cells"><code>__WAVE_HAS_VARIADICS__</code></td>
    <td class="table_cells"><p>1 (a decimal constant), this is defined in C++ 
        mode only, if variadics and placemarkers are enabled, further it is defined 
        in C99 and C++0x modes</p></td>
    <td class="table_cells"><p>no</p></td>
  </tr>
  <tr> 
    <td class="table_cells"><code>__STDC_GLOBAL__</code></td>
    <td class="table_cells"><p>1 (a decimal constant), this is defined in C++0x 
        mode only and only at global macro scope</p></td>
    <td class="table_cells"><p>no</p></td>
  </tr>
  <tr> 
    <td class="table_cells"><code>__STDC_CURRENT_REGION__</code></td>
    <td class="table_cells"><p>The name of the current active macro region (a 
        string literal). This constant does not contain the full qualified scope 
        name, but only it's last part. This macro is defined in C++0x mode only.</p></td>
    <td class="table_cells"><p>no</p></td>
  </tr>
  <tr> 
    <td class="table_cells"><code>__STDC_FULL_REGION__</code></td>
    <td class="table_cells"><p>The name of the current active macro region (a 
        string literal). This constant does contain the full qualified scope name, 
        not only it's last part. This macro is defined in C++0x mode only.</p></td>
    <td class="table_cells"><p>no</p></td>
  </tr>
</table>
<br>
<table border="0">
  <tr> 
    <td width="10"></td>
    <td width="30"><a href="index.html"><img src="theme/u_arr.gif" border="0"></a></td>
    <td width="30"><a href="class_reference_inputpolicy.html"><img src="theme/l_arr.gif" width="20" height="19" border="0"></a></td>
    <td width="20"><a href="supported_pragmas.html"><img src="theme/r_arr.gif" border="0"></a></td>
  </tr>
</table>
<hr size="1">
<p class="copyright">Copyright &copy; 2003 Hartmut Kaiser<br>
  <br>
  <font size="2">Permission to copy, use, modify, sell and distribute this document 
  is granted provided this copyright notice appears in all copies. This document 
  is provided &quot;as is&quot; without express or implied warranty, and with 
  no claim as to its suitability for any purpose. </font> </p>
<span class="updated">Last updated: 
  <!-- #BeginDate format:fcAm1m -->Saturday, May 10, 2003  11:04<!-- #EndDate -->
  </span></body>
</html>

By viewing downloads associated with this article you agree to the Terms of Service and the article's licence.

If a file you wish to view isn't highlighted, and is a text file (not binary), please let us know and we'll add colourisation support for it.

License

This article has no explicit license attached to it but may contain usage terms in the article text or the download files themselves. If in doubt please contact the author via the discussion board below.

A list of licenses authors might use can be found here


Written By
United States United States
Actively involved in Boost and the development of the Spirit parser construction framework.

Comments and Discussions