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