More fix for warnings, and add some of the ideas of the Bill's 'labels' patch

git-svn-id: https://swig.svn.sourceforge.net/svnroot/swig/trunk/SWIG@6998 626c5289-ae23-0410-ae9c-e8d60b6d4f22
This commit is contained in:
Marcelo Matus 2005-02-24 23:48:20 +00:00
commit 192e00615d
18 changed files with 177 additions and 141 deletions

View file

@ -46,7 +46,7 @@
#ifdef SWIGPYTHON #ifdef SWIGPYTHON
%{ %{
static void SWIG_exception_(int code, const char *msg) { SWIGINTERN void SWIG_exception_(int code, const char *msg) {
switch(code) { switch(code) {
case SWIG_MemoryError: case SWIG_MemoryError:
PyErr_SetString(PyExc_MemoryError,msg); PyErr_SetString(PyExc_MemoryError,msg);
@ -90,7 +90,7 @@ static void SWIG_exception_(int code, const char *msg) {
#ifdef SWIGGUILE #ifdef SWIGGUILE
%{ %{
static void SWIG_exception_ (int code, const char *msg, SWIGINTERN void SWIG_exception_ (int code, const char *msg,
const char *subr) { const char *subr) {
#define ERROR(scmerr) \ #define ERROR(scmerr) \
scm_error(gh_symbol2scm((char *) (scmerr)), \ scm_error(gh_symbol2scm((char *) (scmerr)), \
@ -125,7 +125,7 @@ static void SWIG_exception_(int code, const char *msg) {
#ifdef SWIGMZSCHEME #ifdef SWIGMZSCHEME
%{ %{
static void SWIG_exception_ (int code, const char *msg) { SWIGINTERN void SWIG_exception_ (int code, const char *msg) {
#define ERROR(errname) \ #define ERROR(errname) \
scheme_signal_error(errname " (%s)", msg); scheme_signal_error(errname " (%s)", msg);
#define MAP(swigerr, errname) \ #define MAP(swigerr, errname) \
@ -156,7 +156,7 @@ static void SWIG_exception_(int code, const char *msg) {
#ifdef SWIGJAVA #ifdef SWIGJAVA
%{ %{
static void SWIG_JavaException(JNIEnv *jenv, int code, const char *msg) { SWIGINTERN void SWIG_JavaException(JNIEnv *jenv, int code, const char *msg) {
SWIG_JavaExceptionCodes exception_code = SWIG_JavaUnknownError; SWIG_JavaExceptionCodes exception_code = SWIG_JavaUnknownError;
switch(code) { switch(code) {
case SWIG_MemoryError: case SWIG_MemoryError:
@ -195,7 +195,7 @@ static void SWIG_JavaException(JNIEnv *jenv, int code, const char *msg) {
#ifdef SWIGOCAML #ifdef SWIGOCAML
%{ %{
#define OCAML_MSG_BUF_LEN 1024 #define OCAML_MSG_BUF_LEN 1024
static void SWIG_exception_(int code, const char *msg) { SWIGINTERN void SWIG_exception_(int code, const char *msg) {
char msg_buf[OCAML_MSG_BUF_LEN]; char msg_buf[OCAML_MSG_BUF_LEN];
sprintf( msg_buf, "Exception(%d): %s\n", code, msg ); sprintf( msg_buf, "Exception(%d): %s\n", code, msg );
failwith( msg_buf ); failwith( msg_buf );
@ -206,7 +206,7 @@ static void SWIG_exception_(int code, const char *msg) {
#ifdef SWIGRUBY #ifdef SWIGRUBY
%{ %{
static void SWIG_exception_(int code, const char *msg) { SWIGINTERN void SWIG_exception_(int code, const char *msg) {
switch (code) { switch (code) {
case SWIG_MemoryError: case SWIG_MemoryError:
rb_raise(rb_eNoMemError, msg); rb_raise(rb_eNoMemError, msg);
@ -253,7 +253,7 @@ static void SWIG_exception_(int code, const char *msg) {
#ifdef SWIGCHICKEN #ifdef SWIGCHICKEN
%{ %{
#define CHICKEN_MSG_BUF_LEN 1024 #define CHICKEN_MSG_BUF_LEN 1024
static void SWIG_exception_(int code, const char *msg) { SWIGINTERN void SWIG_exception_(int code, const char *msg) {
char msg_buf[CHICKEN_MSG_BUF_LEN]; char msg_buf[CHICKEN_MSG_BUF_LEN];
C_word *a; C_word *a;
C_word scmmsg; C_word scmmsg;
@ -270,7 +270,7 @@ static void SWIG_exception_(int code, const char *msg) {
#ifdef SWIGCSHARP #ifdef SWIGCSHARP
%{ %{
static void SWIG_CSharpException(int code, const char *msg) { SWIGINTERN void SWIG_CSharpException(int code, const char *msg) {
if (code == SWIG_ValueError) { if (code == SWIG_ValueError) {
SWIG_CSharpExceptionArgumentCodes exception_code = SWIG_CSharpArgumentOutOfRangeException; SWIG_CSharpExceptionArgumentCodes exception_code = SWIG_CSharpArgumentOutOfRangeException;
SWIG_CSharpSetPendingExceptionArgument(exception_code, msg, 0); SWIG_CSharpSetPendingExceptionArgument(exception_code, msg, 0);

View file

@ -25,28 +25,29 @@ extern "C" {
namespace Swig { namespace Swig {
/* base class for director exceptions */ /* base class for director exceptions */
class DirectorException { class DirectorException {
protected: protected:
std::string swig_msg; std::string swig_msg;
public: public:
DirectorException(const char* msg="") { DirectorException(const char* /* msg */ ="") {
} }
const char *getMessage() const {
return swig_msg.c_str(); const char *getMessage() const {
} return swig_msg.c_str();
virtual ~DirectorException(); }
virtual ~DirectorException();
}; };
/* type mismatch in the return value from a python method call */ /* type mismatch in the return value from a python method call */
class DirectorTypeMismatchException : public Swig::DirectorException { class DirectorTypeMismatchException : public Swig::DirectorException {
public: public:
DirectorTypeMismatchException(const char* msg="") { DirectorTypeMismatchException(const char* msg="") {
if (!PyErr_Occurred()) { if (!PyErr_Occurred()) {
swig_msg = "Swig director type mismatch: "; swig_msg = "Swig director type mismatch: ";
swig_msg += msg; swig_msg += msg;
PyErr_SetString(PyExc_TypeError, getMessage()); PyErr_SetString(PyExc_TypeError, getMessage());
}
} }
}
}; };
/* any python exception that occurs during a director method call */ /* any python exception that occurs during a director method call */
@ -73,116 +74,116 @@ namespace Swig {
/* director base class */ /* director base class */
class Director { class Director {
private: private:
/* pointer to the wrapped python object */ /* pointer to the wrapped python object */
PyObject* swig_self; PyObject* swig_self;
/* flag indicating whether the object is owned by python or c++ */ /* flag indicating whether the object is owned by python or c++ */
mutable bool swig_disown_flag; mutable bool swig_disown_flag;
/* shared flag for breaking recursive director calls */ /* shared flag for breaking recursive director calls */
static bool swig_up; static bool swig_up;
#ifdef __PTHREAD__ #ifdef __PTHREAD__
/* locks for sharing the swig_up flag in a threaded environment */ /* locks for sharing the swig_up flag in a threaded environment */
static pthread_mutex_t swig_mutex_up; static pthread_mutex_t swig_mutex_up;
static bool swig_mutex_active; static bool swig_mutex_active;
static pthread_t swig_mutex_thread; static pthread_t swig_mutex_thread;
#endif #endif
/* decrement the reference count of the wrapped python object */ /* decrement the reference count of the wrapped python object */
void swig_decref() const { void swig_decref() const {
if (swig_disown_flag) { if (swig_disown_flag) {
Py_DECREF(swig_self); Py_DECREF(swig_self);
}
} }
}
/* reset the swig_up flag once the routing direction has been determined */ /* reset the swig_up flag once the routing direction has been determined */
#ifdef __PTHREAD__ #ifdef __PTHREAD__
void swig_clear_up() const { void swig_clear_up() const {
Swig::Director::swig_up = false; Swig::Director::swig_up = false;
Swig::Director::swig_mutex_active = false; Swig::Director::swig_mutex_active = false;
pthread_mutex_unlock(&swig_mutex_up); pthread_mutex_unlock(&swig_mutex_up);
} }
#else #else
void swig_clear_up() const { void swig_clear_up() const {
Swig::Director::swig_up = false; Swig::Director::swig_up = false;
} }
#endif #endif
public: public:
/* wrap a python object, optionally taking ownership */ /* wrap a python object, optionally taking ownership */
Director(PyObject* self) : swig_self(self), swig_disown_flag(false) { Director(PyObject* self) : swig_self(self), swig_disown_flag(false) {
swig_incref(); swig_incref();
} }
/* discard our reference at destruction */ /* discard our reference at destruction */
virtual ~Director(); virtual ~Director();
/* return a pointer to the wrapped python object */ /* return a pointer to the wrapped python object */
PyObject *swig_get_self() const { PyObject *swig_get_self() const {
return swig_self; return swig_self;
} }
/* get the swig_up flag to determine if the method call should be routed /* get the swig_up flag to determine if the method call should be routed
* to the c++ base class or through the wrapped python object * to the c++ base class or through the wrapped python object
*/ */
#ifdef __PTHREAD__ #ifdef __PTHREAD__
bool swig_get_up() const { bool swig_get_up() const {
if (Swig::Director::swig_mutex_active) { if (Swig::Director::swig_mutex_active) {
if (pthread_equal(Swig::Director::swig_mutex_thread, pthread_self())) { if (pthread_equal(Swig::Director::swig_mutex_thread, pthread_self())) {
bool up = swig_up; bool up = swig_up;
swig_clear_up(); swig_clear_up();
return up; return up;
} }
}
return 0;
} }
return 0;
}
#else #else
bool swig_get_up() const { bool swig_get_up() const {
bool up = swig_up; bool up = swig_up;
swig_up = false; swig_up = false;
return up; return up;
} }
#endif #endif
/* set the swig_up flag if the next method call should be directed to /* set the swig_up flag if the next method call should be directed to
* the c++ base class rather than the wrapped python object * the c++ base class rather than the wrapped python object
*/ */
#ifdef __PTHREAD__ #ifdef __PTHREAD__
void swig_set_up() const { void swig_set_up() const {
pthread_mutex_lock(&Swig::Director::swig_mutex_up); pthread_mutex_lock(&Swig::Director::swig_mutex_up);
Swig::Director::swig_mutex_thread = pthread_self(); Swig::Director::swig_mutex_thread = pthread_self();
Swig::Director::swig_mutex_active = true; Swig::Director::swig_mutex_active = true;
Swig::Director::swig_up = true; Swig::Director::swig_up = true;
} }
#else #else
void swig_set_up() const { void swig_set_up() const {
Swig::Director::swig_up = true; Swig::Director::swig_up = true;
} }
#endif #endif
/* acquire ownership of the wrapped python object (the sense of "disown" /* acquire ownership of the wrapped python object (the sense of "disown"
* is from python) */ * is from python) */
void swig_disown() const { void swig_disown() const {
if (!swig_disown_flag) { if (!swig_disown_flag) {
swig_disown_flag=true; swig_disown_flag=true;
swig_incref(); swig_incref();
} }
} }
/* increase the reference count of the wrapped python object */ /* increase the reference count of the wrapped python object */
void swig_incref() const { void swig_incref() const {
if (swig_disown_flag) { if (swig_disown_flag) {
Py_INCREF(swig_self); Py_INCREF(swig_self);
}
} }
}
/* methods to implement pseudo protected director members */ /* methods to implement pseudo protected director members */
virtual bool swig_get_inner(const char* name) const { virtual bool swig_get_inner(const char* /* name */) const {
return true; return true;
} }
virtual void swig_set_inner(const char* name, bool val) const { virtual void swig_set_inner(const char* /* name */, bool /* val */) const {
} }
}; };
} }

View file

@ -28,7 +28,7 @@ SWIG_AsValFilePtr(PyObject *obj, FILE **val) {
} }
%fragment("SWIG_AsFilePtr","header",fragment="SWIG_AsValFilePtr") { %fragment("SWIG_AsFilePtr","header",fragment="SWIG_AsValFilePtr") {
SWIGINTERNSHORT FILE* SWIGINTERNINLINE FILE*
SWIG_AsFilePtr(PyObject *obj) { SWIG_AsFilePtr(PyObject *obj) {
FILE *val = 0; FILE *val = 0;
SWIG_AsValFilePtr(obj, &val); SWIG_AsValFilePtr(obj, &val);
@ -37,7 +37,7 @@ SWIG_AsFilePtr(PyObject *obj) {
} }
%fragment("SWIG_CheckFilePtr","header",fragment="SWIG_AsValFilePtr") { %fragment("SWIG_CheckFilePtr","header",fragment="SWIG_AsValFilePtr") {
SWIGINTERNSHORT int SWIGINTERNINLINE int
SWIG_CheckFilePtr(PyObject *obj) { SWIG_CheckFilePtr(PyObject *obj) {
return SWIG_AsValFilePtr(obj, (FILE **)(0)); return SWIG_AsValFilePtr(obj, (FILE **)(0));
} }

View file

@ -14,8 +14,8 @@ extern "C" {
# define SWIGINTERN static SWIGUNUSED # define SWIGINTERN static SWIGUNUSED
#endif #endif
#ifndef SWIGINTERNSHORT #ifndef SWIGINTERNINLINE
# define SWIGINTERNSHORT SWIGINTERN SWIGINLINE # define SWIGINTERNINLINE SWIGINTERN SWIGINLINE
#endif #endif
/* /*

View file

@ -11,7 +11,7 @@
%define %swig_fromcplx_conv(Type, Real, Imag) %define %swig_fromcplx_conv(Type, Real, Imag)
%fragment(SWIG_From_frag(Type),"header") %fragment(SWIG_From_frag(Type),"header")
%{ %{
SWIGINTERNSHORT PyObject* SWIGINTERNINLINE PyObject*
SWIG_From(Type)(SWIG_cplusplus(const Type&, Type) c) SWIG_From(Type)(SWIG_cplusplus(const Type&, Type) c)
{ {
return PyComplex_FromDoubles(Real(c), Imag(c)); return PyComplex_FromDoubles(Real(c), Imag(c));

View file

@ -140,11 +140,12 @@ namespace swig
return swig::as<T>(item, true); return swig::as<T>(item, true);
} catch (std::exception& e) { } catch (std::exception& e) {
char msg[1024]; char msg[1024];
sprintf(msg,"in sequence element %d", _index); sprintf(msg,"in sequence element %d ", _index);
if (!PyErr_Occurred()) { if (!PyErr_Occurred()) {
SWIG_type_error(swig::type_name<T>(), item); SWIG_type_error(swig::type_name<T>(), item);
} }
SWIG_append_errmsg(msg); SWIG_append_errmsg(msg);
SWIG_append_errmsg(e.what());
throw; throw;
} }
} }

View file

@ -7,7 +7,7 @@
For example, if you add: For example, if you add:
%fragment(SWIG_AsVal_frag(int),"header") { %fragment(SWIG_AsVal_frag(int),"header") {
SWIGINTERNSHORT int SWIGINTERNINLINE int
SWIG_AsVal(int)(PyObject *obj, int *val) SWIG_AsVal(int)(PyObject *obj, int *val)
{ {
<your code here>; <your code here>;

View file

@ -131,7 +131,7 @@ SWIG_Python_newvarlink(void) {
return ((PyObject*) result); return ((PyObject*) result);
} }
static void static SWIGUNUSED void
SWIG_Python_addvarlink(PyObject *p, char *name, PyObject *(*get_attr)(void), int (*set_attr)(PyObject *p)) { SWIG_Python_addvarlink(PyObject *p, char *name, PyObject *(*get_attr)(void), int (*set_attr)(PyObject *p)) {
swig_varlinkobject *v; swig_varlinkobject *v;
swig_globalvar *gv; swig_globalvar *gv;

View file

@ -103,7 +103,7 @@ SWIGINTERN int
%fragment("SWIG_CheckUnsignedLongInRange","header", %fragment("SWIG_CheckUnsignedLongInRange","header",
fragment="<limits.h>") { fragment="<limits.h>") {
SWIGINTERNSHORT int SWIGINTERNINLINE int
SWIG_CheckUnsignedLongInRange(unsigned long value, SWIG_CheckUnsignedLongInRange(unsigned long value,
unsigned long max_value, unsigned long max_value,
const char *errmsg) const char *errmsg)
@ -178,7 +178,7 @@ SWIGINTERN int
%fragment(SWIG_From_frag(long long),"header", %fragment(SWIG_From_frag(long long),"header",
fragment="<limits.h>") { fragment="<limits.h>") {
SWIGINTERNSHORT PyObject* SWIGINTERNINLINE PyObject*
SWIG_From(long long)(long long value) SWIG_From(long long)(long long value)
{ {
return ((value < LONG_MIN) || (value > LONG_MAX)) ? return ((value < LONG_MIN) || (value > LONG_MAX)) ?
@ -190,7 +190,7 @@ SWIGINTERNSHORT PyObject*
%fragment(SWIG_From_frag(unsigned long long),"header", %fragment(SWIG_From_frag(unsigned long long),"header",
fragment="<limits.h>") { fragment="<limits.h>") {
SWIGINTERNSHORT PyObject* SWIGINTERNINLINE PyObject*
SWIG_From(unsigned long long)(unsigned long long value) SWIG_From(unsigned long long)(unsigned long long value)
{ {
return (value > LONG_MAX) ? return (value > LONG_MAX) ?
@ -254,7 +254,7 @@ SWIGINTERN int
} }
%fragment(SWIG_From_frag(unsigned long),"header") { %fragment(SWIG_From_frag(unsigned long),"header") {
SWIGINTERNSHORT PyObject* SWIGINTERNINLINE PyObject*
SWIG_From(unsigned long)(unsigned long value) SWIG_From(unsigned long)(unsigned long value)
{ {
return (value > LONG_MAX) ? return (value > LONG_MAX) ?
@ -340,7 +340,7 @@ SWIGINTERN int
return 0; return 0;
} }
%#else %#else
SWIGINTERNSHORT int SWIGINTERNINLINE int
SWIG_AsVal(int)(PyObject *obj, int *val) SWIG_AsVal(int)(PyObject *obj, int *val)
{ {
return SWIG_AsVal(long)(obj,(long*)val); return SWIG_AsVal(long)(obj,(long*)val);
@ -371,7 +371,7 @@ SWIGINTERN int
return 0; return 0;
} }
%#else %#else
SWIGINTERNSHORT unsigned int SWIGINTERNINLINE unsigned int
SWIG_AsVal(unsigned int)(PyObject *obj, unsigned int *val) SWIG_AsVal(unsigned int)(PyObject *obj, unsigned int *val)
{ {
return SWIG_AsVal(unsigned long)(obj,(unsigned long *)val); return SWIG_AsVal(unsigned long)(obj,(unsigned long *)val);
@ -491,7 +491,7 @@ SWIGINTERN int
} }
%fragment(SWIG_From_frag(char),"header") { %fragment(SWIG_From_frag(char),"header") {
SWIGINTERNSHORT PyObject* SWIGINTERNINLINE PyObject*
SWIG_From(char)(char c) SWIG_From(char)(char c)
{ {
return PyString_FromStringAndSize(&c,1); return PyString_FromStringAndSize(&c,1);
@ -522,7 +522,7 @@ SWIGINTERN int
} }
%fragment(SWIG_From_frag(wchar_t),"header") { %fragment(SWIG_From_frag(wchar_t),"header") {
SWIGINTERNSHORT PyObject* SWIGINTERNINLINE PyObject*
SWIG_From(wchar_t)(wchar_t c) SWIG_From(wchar_t)(wchar_t c)
{ {
return PyUnicode_FromWideChar(&c, 1); return PyUnicode_FromWideChar(&c, 1);
@ -554,7 +554,7 @@ SWIGINTERN int
} }
%fragment(SWIG_From_frag(bool),"header") { %fragment(SWIG_From_frag(bool),"header") {
SWIGINTERNSHORT PyObject* SWIGINTERNINLINE PyObject*
SWIG_From(bool)(bool value) SWIG_From(bool)(bool value)
{ {
PyObject *obj = value ? Py_True : Py_False; PyObject *obj = value ? Py_True : Py_False;

View file

@ -115,7 +115,7 @@
%define %typemap_asptrfrom(CheckCode, AsPtrMeth, FromMeth, AsPtrFrag, FromFrag, Type...) %define %typemap_asptrfrom(CheckCode, AsPtrMeth, FromMeth, AsPtrFrag, FromFrag, Type...)
%fragment(SWIG_AsVal_frag(Type),"header", %fragment(SWIG_AsVal_frag(Type),"header",
fragment=SWIG_AsPtr_frag(Type)) %{ fragment=SWIG_AsPtr_frag(Type)) %{
SWIGINTERNSHORT int SWIGINTERNINLINE int
SWIG_AsVal(Type)(PyObject* obj, Type *val) SWIG_AsVal(Type)(PyObject* obj, Type *val)
{ {
Type *v = (Type *)0; Type *v = (Type *)0;
@ -130,7 +130,7 @@
%} %}
%fragment(SWIG_As_frag(Type),"header", %fragment(SWIG_As_frag(Type),"header",
fragment=SWIG_AsVal_frag(Type)) %{ fragment=SWIG_AsVal_frag(Type)) %{
SWIGINTERNSHORT Type SWIGINTERNINLINE Type
SWIG_As(Type)(PyObject* obj) SWIG_As(Type)(PyObject* obj)
{ {
Type v; Type v;

View file

@ -78,7 +78,7 @@ namespace swig {
if (val) { if (val) {
Type *p = 0; Type *p = 0;
int res = traits_asptr<Type>::asptr(obj, &p); int res = traits_asptr<Type>::asptr(obj, &p);
if (res && p) { if ((res != 0) && p) {
typedef typename noconst_traits<Type>::noconst_type noconst_type; typedef typename noconst_traits<Type>::noconst_type noconst_type;
*(const_cast<noconst_type*>(val)) = *p; *(const_cast<noconst_type*>(val)) = *p;
if (res == SWIG_NEWOBJ) delete p; if (res == SWIG_NEWOBJ) delete p;

View file

@ -37,7 +37,7 @@ SWIG_AsCharPtrAndSize(PyObject *obj, char** cptr, size_t* psize)
%fragment("SWIG_AsCharPtr","header", %fragment("SWIG_AsCharPtr","header",
fragment="SWIG_AsCharPtrAndSize") { fragment="SWIG_AsCharPtrAndSize") {
SWIGINTERNSHORT int SWIGINTERNINLINE int
SWIG_AsCharPtr(PyObject *obj, char **val) SWIG_AsCharPtr(PyObject *obj, char **val)
{ {
if (SWIG_AsCharPtrAndSize(obj, val, (size_t*)(0))) { if (SWIG_AsCharPtrAndSize(obj, val, (size_t*)(0))) {
@ -134,7 +134,7 @@ SWIG_AsCharArray(PyObject *obj, char *val, size_t size)
} }
%fragment("SWIG_FromCharArray","header") { %fragment("SWIG_FromCharArray","header") {
SWIGINTERNSHORT PyObject * SWIGINTERNINLINE PyObject *
SWIG_FromCharArray(const char* carray, size_t size) SWIG_FromCharArray(const char* carray, size_t size)
{ {
if (size > INT_MAX) { if (size > INT_MAX) {

View file

@ -127,7 +127,7 @@
%define %typemap_asvaln(CheckCode, Type...) %define %typemap_asvaln(CheckCode, Type...)
%fragment(SWIG_As_frag(Type),"header", %fragment(SWIG_As_frag(Type),"header",
fragment=SWIG_AsVal_frag(Type)) %{ fragment=SWIG_AsVal_frag(Type)) %{
SWIGINTERNSHORT Type SWIGINTERNINLINE Type
SWIG_As(Type)(PyObject* obj) SWIG_As(Type)(PyObject* obj)
{ {
Type v; Type v;
@ -142,7 +142,7 @@ SWIG_As(Type)(PyObject* obj)
%} %}
%fragment(SWIG_Check_frag(Type),"header", %fragment(SWIG_Check_frag(Type),"header",
fragment=SWIG_AsVal_frag(Type)) %{ fragment=SWIG_AsVal_frag(Type)) %{
SWIGINTERNSHORT int SWIGINTERNINLINE int
SWIG_Check(Type)(PyObject* obj) SWIG_Check(Type)(PyObject* obj)
{ {
return SWIG_AsVal(Type)(obj, (Type*)0); return SWIG_AsVal(Type)(obj, (Type*)0);

View file

@ -128,7 +128,7 @@ SWIG_AsWCharArray(PyObject *obj, wchar_t *val, size_t size)
} }
%fragment("SWIG_FromWCharArray","header") { %fragment("SWIG_FromWCharArray","header") {
SWIGINTERNSHORT PyObject * SWIGINTERNINLINE PyObject *
SWIG_FromWCharArray(const wchar_t * carray, size_t size) SWIG_FromWCharArray(const wchar_t * carray, size_t size)
{ {
if (size > INT_MAX) { if (size > INT_MAX) {

View file

@ -38,7 +38,7 @@
%fragment(SWIG_From_frag(std::basic_string<char>),"header", %fragment(SWIG_From_frag(std::basic_string<char>),"header",
fragment="SWIG_FromCharArray") { fragment="SWIG_FromCharArray") {
SWIGINTERNSHORT PyObject* SWIGINTERNINLINE PyObject*
SWIG_From(std::basic_string<char>)(const std::string& s) SWIG_From(std::basic_string<char>)(const std::string& s)
{ {
return SWIG_FromCharArray(s.data(), s.size()); return SWIG_FromCharArray(s.data(), s.size());
@ -80,7 +80,7 @@ SWIGINTERN int
%fragment(SWIG_From_frag(std::basic_string<wchar_t>),"header", %fragment(SWIG_From_frag(std::basic_string<wchar_t>),"header",
fragment="SWIG_FromWCharArray") { fragment="SWIG_FromWCharArray") {
SWIGINTERNSHORT PyObject* SWIGINTERNINLINE PyObject*
SWIG_From(std::basic_string<wchar_t>)(const std::wstring& s) SWIG_From(std::basic_string<wchar_t>)(const std::wstring& s)
{ {
return SWIG_FromWCharArray(s.data(), s.size()); return SWIG_FromWCharArray(s.data(), s.size());

View file

@ -51,7 +51,7 @@ namespace std
%fragment(SWIG_From_frag(std::string),"header", %fragment(SWIG_From_frag(std::string),"header",
fragment="SWIG_FromCharArray") { fragment="SWIG_FromCharArray") {
SWIGINTERNSHORT PyObject* SWIGINTERNINLINE PyObject*
SWIG_From(std::string)(const std::string& s) SWIG_From(std::string)(const std::string& s)
{ {
return SWIG_FromCharArray(s.data(), s.size()); return SWIG_FromCharArray(s.data(), s.size());
@ -65,7 +65,7 @@ SWIGINTERN int
{ {
std::string* s; std::string* s;
int res = SWIG_AsPtr(std::string)(obj, &s); int res = SWIG_AsPtr(std::string)(obj, &s);
if (res && s) { if ((res != 0) && s) {
if (val) *val = *s; if (val) *val = *s;
if (res == SWIG_NEWOBJ) delete s; if (res == SWIG_NEWOBJ) delete s;
return res; return res;

View file

@ -53,7 +53,7 @@ SWIGINTERN int
%fragment(SWIG_From_frag(std::wstring),"header", %fragment(SWIG_From_frag(std::wstring),"header",
fragment="SWIG_FromWCharArray") { fragment="SWIG_FromWCharArray") {
SWIGINTERNSHORT PyObject* SWIGINTERNINLINE PyObject*
SWIG_From(std::wstring)(const std::wstring& s) SWIG_From(std::wstring)(const std::wstring& s)
{ {
return SWIG_FromWCharArray(s.data(), s.size()); return SWIG_FromWCharArray(s.data(), s.size());
@ -68,7 +68,7 @@ SWIGINTERN int
{ {
std::wstring *s; std::wstring *s;
int res = SWIG_AsPtr(std::wstring)(obj, &s); int res = SWIG_AsPtr(std::wstring)(obj, &s);
if (res && s) { if ((res != 0) && s) {
if (val) *val = *s; if (val) *val = *s;
if (res == SWIG_NEWOBJ) delete s; if (res == SWIG_NEWOBJ) delete s;
return res; return res;

View file

@ -473,3 +473,37 @@ static int NAME(TYPE x) {
#endif #endif
%} %}
/* Common labels and attributes for the internal SWIG methods */
%insert("runtime") %{
/* inline attribute */
#ifndef SWIGINLINE
#if defined(__cplusplus) || (defined(__GNUC__) && !defined(__STRICT_ANSI__))
# define SWIGINLINE inline
#else
# define SWIGINLINE
#endif
#endif
/* attritbute passed for some compilers to avoid unused method warnings */
#ifndef SWIGUNUSED
#ifdef __GNUC__
#define SWIGUNUSED __attribute__ ((unused))
#else
#define SWIGUNUSED
#endif
#endif
/* internal SWIG method */
#ifndef SWIGINTERN
#define SWIGINTERN static SWIGUNUSED
#endif
/* internal inline SWIG method */
#ifndef SWIGINTERNINLINE
#define SWIGINTERNINLINE SWIGINTERN SWIGINLINE
#endif
%}