]> git.tdb.fi Git - ext/sigc++-2.0.git/blob - tools/pragma_push_pop_macro.cc
Adjust the name of the library to match upstream
[ext/sigc++-2.0.git] / tools / pragma_push_pop_macro.cc
1 // Configuration-time test program, used in Meson build.
2 // Corresponds to the M4 macro SIGC_CXX_PRAGMA_PUSH_POP_MACRO.
3
4 #define BEGIN {
5 #define END   }
6 #pragma push_macro("BEGIN")
7 #pragma push_macro("END")
8 #undef BEGIN
9 #undef END
10
11 // BEGIN and END are not prepreprocessor macros
12 struct Test1
13 {
14   int BEGIN;
15   double END;
16 };
17
18 #pragma pop_macro("BEGIN")
19 #pragma pop_macro("END")
20
21 // BEGIN and END are prepreprocessor macros
22 struct Test2
23 BEGIN
24   int i;
25   double d;
26 END;
27
28 void func1(Test1& x);
29 void func2(Test2& x);
30
31 int main()
32 {
33   Test1 test1;
34   Test2 test2;
35   func1(test1);
36   func2(test2);
37   return 0;
38 }