/*=============================================================================
A Standard compliant C++ preprocessor
Copyright (c) 2001-2004 Hartmut Kaiser
http://spirit.sourceforge.net/
Use, modification and distribution is subject to 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)
See Copyright.txt for full acknowledgements.
=============================================================================*/
// This sample is taken from the C++ standard 16.3.5.6 [cpp.scope] and was
// slightly modified (removed the '#include' directive)
#define str(s) # s
#define xstr(s) str(s)
#define debug(s, t) printf("x" # s "= %d, x" # t "= %s", \
x ## s, x ## t)
#define INCFILE(n) vers ## n /* from previous #include example */
#define glue(a, b) a ## b
#define xglue(a, b) glue(a, b)
#define HIGHLOW "hello"
#define LOW LOW ", world"
debug(1, 2);
fputs(str(strncmp("abc\0d?", "abc", '\4', "\u1234") /* this goes away */
== 0) str(: @\n), s);
/*#include*/ xstr(INCFILE(2).h)
glue(HIGH, LOW);
xglue(HIGH, LOW)
// should expand to
//E #line 27 "test_files/test9.cpp"
//E printf("x" "1" "= %d, x" "2" "= %s", x1, x2);
// printf("x1= %d, x2= %s", x1, x2);
//E fputs( "strncmp(\"abc\\0d\?\", \"abc\", '\\4', \"\\u1234\") == 0" ": @\n", s);
//E "vers2.h"
//E "hello";
//E "hello" ", world"
//R 0