Parallel build on SMP machines, added cppunit-devel to build requirements, proper...
[libt2n] / codegen / codegen-stubhead.hxx
1 /*
2 The software in this package is distributed under the GNU General
3 Public License version 2 (with a special exception described below).
4
5 A copy of GNU General Public License (GPL) is included in this distribution,
6 in the file COPYING.GPL.
7
8 As a special exception, if other files instantiate templates or use macros
9 or inline functions from this file, or you compile this file and link it
10 with other works to produce a work based on this file, this file
11 does not by itself cause the resulting work to be covered
12 by the GNU General Public License.
13
14 However the source code for this file must still be made available
15 in accordance with section (3) of the GNU General Public License.
16
17 This exception does not invalidate any other reasons why a work based
18 on this file might be covered by the GNU General Public License.
19 */
20 #ifndef MINIMALISTIC_STUB_HXX
21 #define MINIMALISTIC_STUB_HXX
22
23 #include <boost/archive/binary_oarchive.hpp>
24 #include <boost/archive/binary_iarchive.hpp>
25 #include <boost/archive/xml_oarchive.hpp>
26 #include <boost/archive/xml_iarchive.hpp>
27 #include <boost/serialization/serialization.hpp>
28
29 #include <string>
30 #include <t2n_exception.hxx>
31 #include <command.hxx>
32
33 #ifdef __GCCXML__
34 // used during parsing run with gccxml
35
36 /** @brief mark a function to export it via libt2n
37     @par Example
38     @code
39     LIBT2N_EXPORT std::string testfunc(const std::string &str)
40     {
41         // your code here
42     }
43     @endcode
44 */
45 #define LIBT2N_EXPORT __attribute((gccxml("libt2n-default")))
46
47
48 /** @brief tell libt2n about a default argument
49     @param type type of the default argument
50     @param value default value
51     @par Example
52     @code
53     LIBT2N_EXPORT std::string testfunc(LIBT2N_DEFAULT_ARG(const std::string str&,"hello world"))
54     {
55         // your code here
56     }
57     @endcode
58     @remarks Codegen gets default arguments via this define (gccxml-attribute) because gccxml
59              does not correctly output them (e.g. the namespace is ambiguous)
60 */
61 #define LIBT2N_DEFAULT_ARG(type,value) __attribute((gccxml("libt2n-default-arg",#value))) type = value
62
63 #else
64 // used during regular compile
65
66 #define LIBT2N_EXPORT
67 #define LIBT2N_DEFAULT_ARG(type,value) type = value
68
69 #endif
70
71 #endif