Debian Codegraph @

engine/swigwrappers/python/fifechan.i.templ

raw
1 %{
2 /**
3 * This is a workaround for a minor swig bug when building on gcc 4.6.1 and above.
4 * Prior to gcc 4.6.1 the STL headers like vector, string, etc. used to
5 * automatically pull in the cstddef header but starting with gcc 4.6.1 they no
6 * longer do. This leads to swig generated a file that does not compile so we
7 * explicitly include cstddef so the swig generated file will compile.
8 */
9 #include <cstddef>
10 %}
11
12 %module(directors="1") fifechan
13 $imports
14
15 %include "std_string.i"
16 %include "std_vector.i"
17
18 /* Signed. */
19 typedef signed char int8_t;
20 typedef short int int16_t;
21 typedef int int32_t;
22 #if defined(SWIGWORDSIZE64)
23 typedef long int int64_t;
24 #else
25 typedef long long int int64_t;
26 #endif
27
28 /* Unsigned. */
29 typedef unsigned char uint8_t;
30 typedef unsigned short int uint16_t;
31 typedef unsigned int uint32_t;
32 #if defined(SWIGWORDSIZE64)
33 typedef unsigned long int uint64_t;
34 #else
35 typedef unsigned long long int uint64_t;
36 #endif
37
38 /*%include "exception.i"
39
40 %{
41 #define _FCN_EXC_HANDLER() \
42 catch (fcn::Exception& _e) { \
43 PyErr_Clear(); \
44 char _err_line[12]; \
45 sprintf(_err_line, ":%u", _e.getLine()); \
46 std::string _err_msg = "Caught a gcn exception thrown in " + _e.getFilename() + _err_line + " in function " + _e.getFunction() + ": " + _e.getMessage(); \
47 SWIG_exception(SWIG_RuntimeError, _err_msg.c_str()); \
48 }
49 %}
50
51 %exception {
52 try {
53 $$action
54 }
55 _FCN_EXC_HANDLER()
56 }
57 */
58
59 $inclusions
60