fix -external-runtime and warning arounds in subversion

git-svn-id: https://swig.svn.sourceforge.net/svnroot/swig/trunk@8666 626c5289-ae23-0410-ae9c-e8d60b6d4f22
This commit is contained in:
Marcelo Matus 2006-02-01 08:37:53 +00:00
commit dbdcf4462c
22 changed files with 98 additions and 83 deletions

View file

@ -9,11 +9,6 @@
* ------------------------------------------------------------ */
%include <perlmacros.swg>
/* ------------------------------------------------------------
* Error manipulation
* ------------------------------------------------------------ */
%include <perlerrors.swg>
/* ------------------------------------------------------------
* The runtime part
* ------------------------------------------------------------ */

View file

@ -2,10 +2,6 @@
* error manipulation
* ----------------------------------------------------------------------------- */
%insert("runtime") "swigerrors.swg"
%insert("header") %{
SWIGINTERN const char*
SWIG_Perl_ErrorType(int code) {
const char* type = 0;
@ -49,6 +45,5 @@ SWIG_Perl_ErrorType(int code) {
return type;
}
%}

View file

@ -1,5 +1,6 @@
%runtime "swigrun.swg" // Common C API type-checking code
%runtime "swigerrors.swg" // SWIG errors
%runtime "perlrun.swg" // Perl runtime functions
%runtime "noembed.h" // undefine Perl5 macros

View file

@ -2,9 +2,7 @@
* error manipulation
* ----------------------------------------------------------------------------- */
%insert("header") %{
SWIGINTERN PyObject*
SWIGRUNTIME PyObject*
SWIG_Python_ErrorType(int code) {
PyObject* type = 0;
switch(code) {
@ -47,14 +45,8 @@ SWIG_Python_ErrorType(int code) {
return type;
}
SWIGINTERNINLINE PyObject *
SWIG_Python_ExceptionType(swig_type_info *desc) {
PySwigClientData *data = desc ? (PySwigClientData *) desc->clientdata : 0;
PyObject *klass = data ? data->klass : 0;
return (klass ? klass : PyExc_RuntimeError);
}
SWIGINTERN void
SWIGRUNTIME void
SWIG_Python_AddErrorMsg(const char* mesg)
{
PyObject *type = 0;
@ -74,5 +66,4 @@ SWIG_Python_AddErrorMsg(const char* mesg)
}
}
%}

View file

@ -215,6 +215,13 @@ SWIG_Python_CheckImplicit(swig_type_info *ty)
return data ? data->implicitconv : 0;
}
SWIGRUNTIMEINLINE PyObject *
SWIG_Python_ExceptionType(swig_type_info *desc) {
PySwigClientData *data = desc ? (PySwigClientData *) desc->clientdata : 0;
PyObject *klass = data ? data->klass : 0;
return (klass ? klass : PyExc_RuntimeError);
}
SWIGRUNTIME PySwigClientData *
PySwigClientData_New(PyObject* obj)
@ -965,15 +972,15 @@ SWIG_Python_ConvertPtrAndOwn(PyObject *obj, void **ptr, swig_type_info *ty, int
impconv = 0;
}
if (impconv) {
PySwigObject *sobj = SWIG_Python_GetSwigThis(impconv);
if (sobj) {
PySwigObject *iobj = SWIG_Python_GetSwigThis(impconv);
if (iobj) {
void *vptr;
res = SWIG_Python_ConvertPtrAndOwn((PyObject*)sobj, &vptr, ty, 0, 0);
res = SWIG_Python_ConvertPtrAndOwn((PyObject*)iobj, &vptr, ty, 0, 0);
if (SWIG_IsOK(res)) {
if (ptr) {
*ptr = vptr;
/* transfer the ownership to 'ptr' */
sobj->own = 0;
iobj->own = 0;
res = SWIG_AddNewMask(SWIG_AddCast(res));
} else {
res = SWIG_AddCast(res);

View file

@ -4,8 +4,9 @@
%}
%insert(runtime) "swigrun.swg"; /* SWIG API */
%insert(runtime) "swigerrors.swg" /* SWIG errors */
%insert(runtime) "pyhead.swg"
%insert(runtime) "swigerrors.swg"; /* SWIG errors */
%insert(runtime) "pyhead.swg";
%insert(runtime) "pyerrors.swg";
%insert(runtime) "pythreads.swg"; /* Python thread code */
%insert(runtime) "pyapi.swg"; /* Pyton API */
%insert(runtime) "pyrun.swg"; /* Python run-time code */

View file

@ -9,10 +9,6 @@
* ------------------------------------------------------------ */
%include <pymacros.swg>
/* ------------------------------------------------------------
* Error manipulation
* ------------------------------------------------------------ */
%include <pyerrors.swg>
/* ------------------------------------------------------------
* The runtime part

View file

@ -32,10 +32,6 @@
* ------------------------------------------------------------ */
%include <rubymacros.swg>
/* ------------------------------------------------------------
* Error manipulation
* ------------------------------------------------------------ */
%include <rubyerrors.swg>
/* ------------------------------------------------------------
* The runtime part

View file

@ -0,0 +1 @@
/* empty file added for backward comp. */

View file

@ -2,20 +2,17 @@
* error manipulation
* ----------------------------------------------------------------------------- */
%insert("runtime") "swigerrors.swg"
/* Define some additional error types */
%insert("runtime") %{
#define SWIG_ObjectPreviouslyDeletedError -100
%}
%insert("header") %{
/* Define custom exceptions for errors that do not map to existing Ruby
exceptions. Note this only works for C++ since a global cannot be
initialized by a funtion in C. For C, fallback to rb_eRuntimeError.*/
VALUE getNullReferenceError() {
SWIGINTERN VALUE
getNullReferenceError(void) {
static int init = 0;
static VALUE rb_eNullReferenceError ;
if (!init) {
@ -25,7 +22,8 @@ VALUE getNullReferenceError() {
return rb_eNullReferenceError;
}
VALUE getObjectPreviouslyDeletedError() {
SWIGINTERN VALUE
getObjectPreviouslyDeletedError(void) {
static int init = 0;
static VALUE rb_eObjectPreviouslyDeleted ;
if (!init) {
@ -35,15 +33,6 @@ VALUE getObjectPreviouslyDeletedError() {
return rb_eObjectPreviouslyDeleted;
}
VALUE getExceptionClass() {
static int init = 0;
static VALUE rubyExceptionClass ;
if (!init) {
init = 1;
rubyExceptionClass = rb_const_get(_mSWIG, rb_intern("Exception"));
}
return rubyExceptionClass;
}
SWIGINTERN VALUE
SWIG_Ruby_ErrorType(int SWIG_code) {
@ -98,18 +87,4 @@ SWIG_Ruby_ErrorType(int SWIG_code) {
}
/* This code checks to see if the Ruby object being raised as part
of an exception inherits from the Ruby class Exception. If so,
the object is simply returned. If not, then a new Ruby exception
object is created and that will be returned to Ruby.*/
SWIGINTERN VALUE
SWIG_Ruby_ExceptionType(swig_type_info *desc, VALUE obj) {
VALUE exceptionClass = getExceptionClass();
if (rb_obj_is_kind_of(obj, exceptionClass)) {
return obj;
} else {
return rb_exc_new3(rb_eRuntimeError, rb_obj_as_string(obj));
}
}
%}

View file

@ -7,7 +7,7 @@
%fragment("SWIG_ruby_failed","header")
{
SWIGINTERN VALUE
SWIG_ruby_failed()
SWIG_ruby_failed(void)
{
return Qnil;
}

View file

@ -80,6 +80,31 @@ static VALUE _mSWIG = Qnil;
static VALUE _cSWIG_Pointer = Qnil;
static VALUE swig_runtime_data_type_pointer = Qnil;
SWIGRUNTIME VALUE
getExceptionClass(void) {
static int init = 0;
static VALUE rubyExceptionClass ;
if (!init) {
init = 1;
rubyExceptionClass = rb_const_get(_mSWIG, rb_intern("Exception"));
}
return rubyExceptionClass;
}
/* This code checks to see if the Ruby object being raised as part
of an exception inherits from the Ruby class Exception. If so,
the object is simply returned. If not, then a new Ruby exception
object is created and that will be returned to Ruby.*/
SWIGRUNTIME VALUE
SWIG_Ruby_ExceptionType(swig_type_info *desc, VALUE obj) {
VALUE exceptionClass = getExceptionClass();
if (rb_obj_is_kind_of(obj, exceptionClass)) {
return obj;
} else {
return rb_exc_new3(rb_eRuntimeError, rb_obj_as_string(obj));
}
}
/* Initialize Ruby runtime support */
SWIGRUNTIME void
SWIG_Ruby_InitRuntime(void)
@ -294,7 +319,7 @@ SWIG_Ruby_ConvertPacked(VALUE obj, void *ptr, int sz, swig_type_info *ty) {
}
SWIGRUNTIME swig_module_info *
SWIG_Ruby_GetModule()
SWIG_Ruby_GetModule(void)
{
VALUE pointer;
swig_module_info *ret = 0;

View file

@ -1,5 +1,9 @@
%runtime "swiglabels.swg" /* Common C API type-checking code */
%runtime "swigrun.swg" /* Common C API type-checking code */
%runtime "swigerrors.swg" /* SWIG errors */
%runtime "rubyhead.swg"
%runtime "rubyerrors.swg"
%runtime "rubytracking.swg" /* API for tracking C++ classes to Ruby objects */
%runtime "rubyapi.swg"
%runtime "rubyrun.swg"

View file

@ -22,7 +22,7 @@ static VALUE swig_ruby_trackings;
static ID swig_ruby_hash_delete = 0;
/* Setup a Ruby hash table to store Trackings */
SWIGRUNTIME void SWIG_RubyInitializeTrackings() {
SWIGRUNTIME void SWIG_RubyInitializeTrackings(void) {
/* Create a ruby hash table to store Trackings from C++
objects to Ruby objects. Also make sure to tell
the garabage collector about the hash table. */

View file

@ -9,11 +9,6 @@
* ------------------------------------------------------------ */
%include <tclmacros.swg>
/* ------------------------------------------------------------
* Error manipulation
* ------------------------------------------------------------ */
%include <tclerrors.swg>
/* ------------------------------------------------------------
* The runtime part
* ------------------------------------------------------------ */

View file

@ -2,11 +2,6 @@
* error manipulation
* ----------------------------------------------------------------------------- */
%insert("runtime") "swigerrors.swg"
%insert("header") %{
SWIGINTERN const char*
SWIG_Tcl_ErrorType(int code) {
const char* type = 0;
@ -76,5 +71,3 @@ SWIG_Tcl_AddErrorMsg(Tcl_Interp *interp, const char* mesg)
}
%}

View file

@ -9,5 +9,7 @@
%}
%insert(runtime) "swigrun.swg"; /* Common C API type-checking code */
%insert(runtime) "tclapi.swg"; /* SWIG/Tcl API */
%insert(runtime) "swigerrors.swg" /* SWIG errors */
%insert(runtime) "tclerrors.swg"; /* Tcl Errors */
%insert(runtime) "tclapi.swg"; /* Tcl API */
%insert(runtime) "tclrun.swg"; /* Tcl run-time code */

View file

@ -370,6 +370,13 @@ static void SWIG_dump_runtime() {
Printf(runtime, "%s", s);
Delete(s);
s = Swig_include_sys("swigerrors.swg");
if (!s) {
Printf(stderr, "*** Unable to open 'swigerrors.swg'\n");
Close(runtime);
SWIG_exit(EXIT_FAILURE);
}
Printf(runtime, "%s", s);
s = Swig_include_sys("swigrun.swg");
if (!s) {
Printf(stderr, "*** Unable to open 'swigrun.swg'\n");

View file

@ -1668,10 +1668,20 @@ public:
}
String *runtimeCode() {
String *s = Swig_include_sys("perlrun.swg");
if (!s) {
String *s = NewString("");
String *serrors = Swig_include_sys("perlerrors.swg");
if (!serrors) {
Printf(stderr, "*** Unable to open 'perlerrors.swg'\n");
} else {
Append(s, serrors);
Delete(serrors);
}
String *srun = Swig_include_sys("perlrun.swg");
if (!srun) {
Printf(stderr, "*** Unable to open 'perlrun.swg'\n");
s = NewString("");
} else {
Append(s, srun);
Delete(srun);
}
return s;
}

View file

@ -3172,6 +3172,13 @@ public:
Append(s, shead);
Delete(shead);
}
String *serrors = Swig_include_sys("pyerrors.swg");
if (!serrors) {
Printf(stderr, "*** Unable to open 'pyerrors.swg'\n");
} else {
Append(s, serrors);
Delete(serrors);
}
String *sthread = Swig_include_sys("pythreads.swg");
if (!sthread) {
Printf(stderr, "*** Unable to open 'pythreads.swg'\n");

View file

@ -2644,6 +2644,13 @@ public:
Append(s, shead);
Delete(shead);
}
String *serrors = Swig_include_sys("rubyerrors.swg");
if (!serrors) {
Printf(stderr, "*** Unable to open 'rubyerrors.swg'\n");
} else {
Append(s, serrors);
Delete(serrors);
}
String *strack = Swig_include_sys("rubytracking.swg");
if (!strack) {
Printf(stderr, "*** Unable to open 'rubytracking.swg'\n");

View file

@ -1274,6 +1274,13 @@ public:
String *runtimeCode() {
String *s = NewString("");
String *serrors = Swig_include_sys("tclerrors.swg");
if (!serrors) {
Printf(stderr, "*** Unable to open 'tclerrors.swg'\n");
} else {
Append(s, serrors);
Delete(serrors);
}
String *sapi = Swig_include_sys("tclapi.swg");
if (!sapi) {
Printf(stderr, "*** Unable to open 'tclapi.swg'\n");