• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1 /*=============================================================================
2     Boost.Wave: A Standard compliant C++ preprocessor library
3     Example demonstrating how to preprocess the token stream generated by a
4     #pragma directive
5 
6     http://www.boost.org/
7 
8     Copyright (c) 2001-2010 Hartmut Kaiser. Distributed under the Boost
9     Software License, Version 1.0. (See accompanying file
10     LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
11 =============================================================================*/
12 
13 ///////////////////////////////////////////////////////////////////////////////
14 //  This special pragma is implemented by the interpret_pragma hook function
15 //  provided in the preprocess_pragma_output_hooks policy class. This
16 //  #pragma preprocesses the provided arguments in the current context.
17 #pragma wave pp (                                                             \
18         "#define A() \"some text\" and more\n"                                \
19         "#define B() 1.0\n"                                                   \
20     )                                                                         \
21     /**/
22 
23 A()   // this should produce: "some text" and more
24 B()   // and this expands to 1.0
25