Merge pull request #17 from whoozle/devel
fixed v8-3.20+ compilation and deprecation warnings.
This commit is contained in:
commit
740da9c733
2 changed files with 41 additions and 24 deletions
|
|
@ -7,22 +7,6 @@
|
||||||
* - $jsmangledtype: mangled type of class
|
* - $jsmangledtype: mangled type of class
|
||||||
* ----------------------------------------------------------------------------- */
|
* ----------------------------------------------------------------------------- */
|
||||||
|
|
||||||
%insert(runtime) %{
|
|
||||||
#if (SWIG_V8_VERSION < 0x031900)
|
|
||||||
typedef v8::Handle<v8::Value> SwigV8ReturnValue;
|
|
||||||
typedef v8::Arguments SwigV8Arguments;
|
|
||||||
typedef v8::AccessorInfo SwigV8PropertyCallbackInfo;
|
|
||||||
#define SWIGV8_RETURN(val) return scope.Close(val)
|
|
||||||
#define SWIGV8_RETURN_INFO(val, info) return scope.Close(val)
|
|
||||||
#else
|
|
||||||
typedef void SwigV8ReturnValue;
|
|
||||||
typedef v8::FunctionCallbackInfo<v8::Value> SwigV8Arguments;
|
|
||||||
typedef v8::PropertyCallbackInfo<v8::Value> SwigV8PropertyCallbackInfo;
|
|
||||||
#define SWIGV8_RETURN(val) return args.GetReturnValue().Set(val)
|
|
||||||
#define SWIGV8_RETURN_INFO(val, info) return args.GetReturnValue().Set(val)
|
|
||||||
#endif
|
|
||||||
%}
|
|
||||||
|
|
||||||
%fragment("js_ctor", "templates") %{
|
%fragment("js_ctor", "templates") %{
|
||||||
SwigV8ReturnValue $jswrapper(const SwigV8Arguments& args) {
|
SwigV8ReturnValue $jswrapper(const SwigV8Arguments& args) {
|
||||||
v8::HandleScope scope;
|
v8::HandleScope scope;
|
||||||
|
|
@ -171,16 +155,25 @@ void $jswrapper(v8::Isolate *isolate, v8::Persistent< v8::Object > * object, SWI
|
||||||
* ----------------------------------------------------------------------------- */
|
* ----------------------------------------------------------------------------- */
|
||||||
%fragment ("js_dtoroverride", "templates")
|
%fragment ("js_dtoroverride", "templates")
|
||||||
%{
|
%{
|
||||||
void $jswrapper(v8::Persistent< v8::Value > object, void *parameter) {
|
#if (SWIG_V8_VERSION < 0x031900)
|
||||||
SWIGV8_Proxy* proxy = (SWIGV8_Proxy*) parameter;
|
void $jswrapper(v8::Persistent< v8::Value > object, void *parameter)
|
||||||
|
{
|
||||||
|
SWIGV8_Proxy *proxy = static_cast<SWIGV8_Proxy *>(parameter);
|
||||||
|
#else
|
||||||
|
void $jswrapper(v8::Isolate *isolate, v8::Persistent< v8::Object > * object, SWIGV8_Proxy *proxy)
|
||||||
|
{
|
||||||
|
#endif
|
||||||
if(proxy->swigCMemOwn && proxy->swigCObject) {
|
if(proxy->swigCMemOwn && proxy->swigCObject) {
|
||||||
$jstype arg1 = ($jstype)proxy->swigCObject;
|
$jstype arg1 = ($jstype)proxy->swigCObject;
|
||||||
${destructor_action}
|
${destructor_action}
|
||||||
}
|
}
|
||||||
delete proxy;
|
delete proxy;
|
||||||
|
|
||||||
object.Clear();
|
#if (SWIG_V8_VERSION < 0x031900)
|
||||||
object.Dispose();
|
object.Dispose();
|
||||||
|
#else
|
||||||
|
object->Dispose(isolate);
|
||||||
|
#endif
|
||||||
}
|
}
|
||||||
%}
|
%}
|
||||||
|
|
||||||
|
|
@ -214,7 +207,7 @@ fail:
|
||||||
%fragment("js_setter", "templates")
|
%fragment("js_setter", "templates")
|
||||||
%{
|
%{
|
||||||
void $jswrapper(v8::Local<v8::String> property, v8::Local<v8::Value> value,
|
void $jswrapper(v8::Local<v8::String> property, v8::Local<v8::Value> value,
|
||||||
const SwigV8PropertyCallbackInfo& info) {
|
const SwigV8PropertyCallbackInfoVoid& info) {
|
||||||
v8::HandleScope scope;
|
v8::HandleScope scope;
|
||||||
$jslocals
|
$jslocals
|
||||||
$jscode
|
$jscode
|
||||||
|
|
|
||||||
|
|
@ -35,6 +35,22 @@
|
||||||
%insert(runtime) "swigrun.swg"; /* SWIG API */
|
%insert(runtime) "swigrun.swg"; /* SWIG API */
|
||||||
%insert(runtime) "swigerrors.swg"; /* SWIG errors */
|
%insert(runtime) "swigerrors.swg"; /* SWIG errors */
|
||||||
|
|
||||||
|
%insert(runtime) %{
|
||||||
|
#if (SWIG_V8_VERSION < 0x031900)
|
||||||
|
typedef v8::Handle<v8::Value> SwigV8ReturnValue;
|
||||||
|
typedef v8::Arguments SwigV8Arguments;
|
||||||
|
typedef v8::AccessorInfo SwigV8PropertyCallbackInfo;
|
||||||
|
#define SWIGV8_RETURN(val) return scope.Close(val)
|
||||||
|
#define SWIGV8_RETURN_INFO(val, info) return scope.Close(val)
|
||||||
|
#else
|
||||||
|
typedef void SwigV8ReturnValue;
|
||||||
|
typedef v8::FunctionCallbackInfo<v8::Value> SwigV8Arguments;
|
||||||
|
typedef v8::PropertyCallbackInfo<v8::Value> SwigV8PropertyCallbackInfo;
|
||||||
|
#define SWIGV8_RETURN(val) args.GetReturnValue().Set(val); return
|
||||||
|
#define SWIGV8_RETURN_INFO(val, info) info.GetReturnValue().Set(val); return
|
||||||
|
#endif
|
||||||
|
%}
|
||||||
|
|
||||||
%insert(runtime) %{
|
%insert(runtime) %{
|
||||||
#define SWIG_Error(code, msg) SWIGV8_ErrorHandler.error(code, msg)
|
#define SWIG_Error(code, msg) SWIGV8_ErrorHandler.error(code, msg)
|
||||||
#define SWIG_exception(code, msg) SWIGV8_ErrorHandler.error(code, msg)
|
#define SWIG_exception(code, msg) SWIGV8_ErrorHandler.error(code, msg)
|
||||||
|
|
@ -274,7 +290,11 @@ v8::Handle<v8::Object> SWIG_V8_NewPointerObj(void *ptr, swig_type_info *info, in
|
||||||
|
|
||||||
#define SWIG_GetInstancePtr(obj, ptr) SWIG_V8_GetInstancePtr(obj, ptr)
|
#define SWIG_GetInstancePtr(obj, ptr) SWIG_V8_GetInstancePtr(obj, ptr)
|
||||||
|
|
||||||
|
#if (SWIG_V8_VERSION < 0x031900)
|
||||||
v8::Handle<v8::Value> _wrap_equals(const v8::Arguments &args) {
|
v8::Handle<v8::Value> _wrap_equals(const v8::Arguments &args) {
|
||||||
|
#else
|
||||||
|
void _wrap_equals(const v8::FunctionCallbackInfo<v8::Value>& args) {
|
||||||
|
#endif
|
||||||
v8::HandleScope scope;
|
v8::HandleScope scope;
|
||||||
v8::Handle<v8::Value> jsresult;
|
v8::Handle<v8::Value> jsresult;
|
||||||
void *arg1 = (void *) 0 ;
|
void *arg1 = (void *) 0 ;
|
||||||
|
|
@ -297,13 +317,17 @@ v8::Handle<v8::Value> _wrap_equals(const v8::Arguments &args) {
|
||||||
result = (bool)(arg1 == arg2);
|
result = (bool)(arg1 == arg2);
|
||||||
jsresult = v8::Boolean::New(result);
|
jsresult = v8::Boolean::New(result);
|
||||||
|
|
||||||
return scope.Close(jsresult);
|
SWIGV8_RETURN(jsresult);
|
||||||
goto fail;
|
goto fail;
|
||||||
fail:
|
fail:
|
||||||
return scope.Close(v8::Undefined());
|
SWIGV8_RETURN(v8::Undefined());
|
||||||
}
|
}
|
||||||
|
|
||||||
|
#if (SWIG_V8_VERSION < 0x031900)
|
||||||
v8::Handle<v8::Value> _wrap_getCPtr(const v8::Arguments &args) {
|
v8::Handle<v8::Value> _wrap_getCPtr(const v8::Arguments &args) {
|
||||||
|
#else
|
||||||
|
void _wrap_getCPtr(const v8::FunctionCallbackInfo<v8::Value>& args) {
|
||||||
|
#endif
|
||||||
v8::HandleScope scope;
|
v8::HandleScope scope;
|
||||||
v8::Handle<v8::Value> jsresult;
|
v8::Handle<v8::Value> jsresult;
|
||||||
void *arg1 = (void *) 0 ;
|
void *arg1 = (void *) 0 ;
|
||||||
|
|
@ -318,9 +342,9 @@ v8::Handle<v8::Value> _wrap_getCPtr(const v8::Arguments &args) {
|
||||||
result = (long)arg1;
|
result = (long)arg1;
|
||||||
jsresult = v8::Number::New(result);
|
jsresult = v8::Number::New(result);
|
||||||
|
|
||||||
return scope.Close(jsresult);
|
SWIGV8_RETURN(jsresult);
|
||||||
goto fail;
|
goto fail;
|
||||||
fail:
|
fail:
|
||||||
return scope.Close(v8::Undefined());
|
SWIGV8_RETURN(v8::Undefined());
|
||||||
}
|
}
|
||||||
%}
|
%}
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue