2 * This file is part of the LibreOffice project.
4 * This Source Code Form is subject to the terms of the Mozilla Public
5 * License, v. 2.0. If a copy of the MPL was not distributed with this
6 * file, You can obtain one at http://mozilla.org/MPL/2.0/.
8 * This file incorporates work covered by the following license notice:
10 * Licensed to the Apache Software Foundation (ASF) under one or more
11 * contributor license agreements. See the NOTICE file distributed
12 * with this work for additional information regarding copyright
13 * ownership. The ASF licenses this file to you under the Apache
14 * License, Version 2.0 (the "License"); you may not use this file
15 * except in compliance with the License. You may obtain a copy of
16 * the License at http://www.apache.org/licenses/LICENSE-2.0 .
31 #define SYMBOL _symbol_
33 < SYMBOL > // < _symbol_ >
35 +SYMBOL- // +_symbol_-
36 >SYMBOL< // >_symbol_<
37 <SYMBOL> // <_symbol_>
41 a = x > 0 ? TRUE : FALSE // a = x > 0 ? !0 : 0
46 T() { a(); return b; } // T() { x(); return y; }
63 #define func abc(func)
64 a = func // a = abc(func)
66 #define func1 func(abc)
67 a = func1 // a = abc(func)(abc)
69 #define args(func, args) func args
70 args(t1, (args(t2, (x, y)))) // t1 (t2 (x, y))
74 int foo __((int x)); // int foo (int x);
79 // Txt_##tail // Txt_##_Test
81 #define z(e,f) e##_##f
82 z ( abc, xyz ) // abc_xyz
85 #define CAT( var ) fix##.var
88 #define CAT3( class, ref ) class##ref::class##ref
89 CAT3( a, b ) // ab::ab
91 #define CAT2( var ) fix##var::fix##var
92 CAT2( a ) // fixa::fixa
96 #define MAKE_X( name ) name##_Test
97 #define MAKE_Y( name ) MAKE_X( name##_Sym )
98 MAKE_Y( Txt ); // Txt_Sym_Test;
104 #ident "(c)# Test.txt"
107 # error illegal machine
113 #define Cfstrcpy Cstrcpy
114 #define Cstrcpy( s1, s2 ) strcpy( s1, s2 )
116 Cfstrcpy(Par1,Par2 ) // blub( Par1, Par2 )