Merge branch 'Richie765-master'
Conflicts: CHANGES.current
This commit is contained in:
commit
53d7fc8a16
17 changed files with 590 additions and 305 deletions
|
|
@ -7,12 +7,18 @@ else
|
|||
JSENGINE=node
|
||||
endif
|
||||
|
||||
ifneq (, $(V8_VERSION))
|
||||
JSV8_VERSION=$(V8_VERSION)
|
||||
else
|
||||
JSV8_VERSION=0x031110
|
||||
endif
|
||||
|
||||
EXAMPLES_TOP=../..
|
||||
SWIG_TOP=../../..
|
||||
SWIG = $(SWIG_TOP)/preinst-swig
|
||||
TARGET = example
|
||||
INTERFACE = example.i
|
||||
SWIGOPT=-$(JSENGINE)
|
||||
SWIGOPT=-$(JSENGINE) -DV8_VERSION=$(JSV8_VERSION)
|
||||
|
||||
check: build
|
||||
$(MAKE) -f $(EXAMPLES_TOP)/Makefile SRCDIR='$(SRCDIR)' JSENGINE='$(JSENGINE)' TARGET='$(TARGET)' javascript_run
|
||||
|
|
|
|||
|
|
@ -9,20 +9,20 @@ console.log(example.maxdouble(3.14,2.18));
|
|||
iv = new example.vecint(100);
|
||||
dv = new example.vecdouble(1000);
|
||||
|
||||
for(i=0;i<=100;i++)
|
||||
for(i=0;i<100;i++)
|
||||
iv.setitem(i,2*i);
|
||||
|
||||
for(i=0;i<=1000;i++)
|
||||
for(i=0;i<1000;i++)
|
||||
dv.setitem(i, 1.0/(i+1));
|
||||
|
||||
sum = 0;
|
||||
for(i=0;i<=100;i++)
|
||||
for(i=0;i<100;i++)
|
||||
sum = sum + iv.getitem(i);
|
||||
|
||||
console.log(sum);
|
||||
|
||||
sum = 0.0;
|
||||
for(i=0;i<=1000;i++)
|
||||
for(i=0;i<1000;i++)
|
||||
sum = sum + dv.getitem(i);
|
||||
console.log(sum);
|
||||
|
||||
|
|
|
|||
|
|
@ -19,8 +19,16 @@ else
|
|||
JSENGINE=node
|
||||
endif
|
||||
|
||||
ifneq (, $(V8_VERSION))
|
||||
JSV8_VERSION=$(V8_VERSION)
|
||||
else
|
||||
JSV8_VERSION=0x031110
|
||||
endif
|
||||
|
||||
include $(srcdir)/../common.mk
|
||||
|
||||
SWIGOPT += -DV8_VERSION=$(JSV8_VERSION)
|
||||
|
||||
_setup = \
|
||||
if [ -f $(SCRIPTDIR)/$(SCRIPTPREFIX)$*$(SCRIPTSUFFIX) ]; then \
|
||||
echo "$(ACTION)ing $(LANGUAGE) ($(JSENGINE)) testcase $* (with run test)" ; \
|
||||
|
|
|
|||
|
|
@ -16,7 +16,7 @@
|
|||
// For Javascript V8 we can not use '0' for out typemaps
|
||||
#if defined(SWIG_JAVASCRIPT_V8)
|
||||
%header %{
|
||||
#define OUT_NULL_VALUE v8::Null()
|
||||
#define OUT_NULL_VALUE SWIGV8_NULL()
|
||||
%}
|
||||
#else
|
||||
%header %{
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue