commit
6b95df74a9
16 changed files with 150 additions and 64 deletions
|
|
@ -250,7 +250,9 @@ the functions <tt>SWIG_TypeQuery</tt>, <tt>SWIG_NewPointerObj</tt>, and others s
|
|||
to be called. Calling these functions from a typemap is supported, since the typemap code
|
||||
is embedded into the <tt>_wrap.c</tt> file, which has those declarations available. If you need
|
||||
to call the SWIG run-time functions from another C file, there is one header you need
|
||||
to include. To generate the header that needs to be included, run the following command:
|
||||
to include. To generate the header that needs to be included, SWIG can be run in a different
|
||||
mode via <tt>-external-runtime</tt> to generate the run-time instead of the normal mode of
|
||||
processing an input interface file. For example:
|
||||
|
||||
<div class="shell"><pre>
|
||||
$ swig -python -external-runtime <filename>
|
||||
|
|
|
|||
|
|
@ -1774,12 +1774,12 @@ GCCGOOPT = @GCCGOOPT@
|
|||
GOVERSIONOPTION = @GOVERSIONOPTION@
|
||||
|
||||
GOSWIGARG = `if $(GOGCC) ; then echo -gccgo; fi`
|
||||
GOCOMPILEARG = `if $(GO1) ; then echo tool $(GOC:c=g) ; fi` `if $(GO13) || $(GO15); then echo -pack ; fi`
|
||||
GOCOMPILEARG = `if $(GO15); then echo tool compile; elif $(GO1) ; then echo tool $(GOC:c=g) ; fi` `if $(GO13) || $(GO15); then echo -pack ; fi`
|
||||
|
||||
GOSRCS = $(INTERFACE:.i=.go)
|
||||
GOCSRCS = $(INTERFACE:.i=_gc.c)
|
||||
|
||||
GOLD = $(GOC:c=l)
|
||||
GOLD = `if $(GO15); then echo link; else echo $(GOC:c=l); fi`
|
||||
GOTOOL = `if $(GO1) ; then echo go tool; fi`
|
||||
GOPACK = `if $(GO1) ; then echo go tool pack; else echo gopack; fi`
|
||||
|
||||
|
|
@ -1787,7 +1787,7 @@ GOPACKAGE = $(notdir $(INTERFACE:.i=.a))
|
|||
|
||||
GOPATHDIR = gopath/src/$(INTERFACE:.i=)
|
||||
|
||||
GOOBJEXT = $(GOC:c=)
|
||||
GOOBJEXT = `if $(GO15); then echo o; else echo $(GOC:c=); fi`
|
||||
GOGCOBJS = $(GOSRCS:.go=.$(GOOBJEXT))
|
||||
GOGCCOBJS = $(GOSRCS:.go=.@OBJEXT@)
|
||||
|
||||
|
|
@ -1863,7 +1863,7 @@ go: $(SRCDIR_SRCS)
|
|||
$(COMPILETOOL) $(GCCGO) -c -g $(SRCDIR)$(RUNME).go; \
|
||||
$(COMPILETOOL) $(GCCGO) -o $(RUNME) $(RUNME).@OBJEXT@ $(dir $(INTERFACE))/$(GOPACKAGE); \
|
||||
elif $(GO12) || $(GO13) || $(GO15); then \
|
||||
$(COMPILETOOL) $(GO) $(GOCOMPILEARG) $(SRCDIR)$(RUNME).go; \
|
||||
$(COMPILETOOL) $(GO) $(GOCOMPILEARG) -o $(RUNME).$(GOOBJEXT) $(SRCDIR)$(RUNME).go; \
|
||||
$(COMPILETOOL) $(GOTOOL) $(GOLD) -linkmode external -extld "$(CC)" -extldflags "$(CFLAGS) $(LDFLAGS)" -o $(RUNME) $(RUNME).$(GOOBJEXT); \
|
||||
else \
|
||||
$(COMPILETOOL) $(GO) $(GOCOMPILEARG) $(SRCDIR)$(RUNME).go; \
|
||||
|
|
@ -1960,7 +1960,7 @@ go_cpp: $(SRCDIR_SRCS)
|
|||
$(COMPILETOOL) $(GCCGO) -g -c $(SRCDIR)$(RUNME).go; \
|
||||
$(COMPILETOOL) $(GCCGO) -o $(RUNME) $(RUNME).@OBJEXT@ $(dir $(INTERFACE))/$(GOPACKAGE) -lstdc++; \
|
||||
elif $(GO12) || $(GO13) || $(GO15); then \
|
||||
$(COMPILETOOL) $(GO) $(GOCOMPILEARG) $(SRCDIR)$(RUNME).go; \
|
||||
$(COMPILETOOL) $(GO) $(GOCOMPILEARG) -o $(RUNME).$(GOOBJEXT) $(SRCDIR)$(RUNME).go; \
|
||||
$(COMPILETOOL) $(GOTOOL) $(GOLD) -linkmode external -extld "$(CXX)" -extldflags "$(CXXFLAGS) $(LDFLAGS)" -o $(RUNME) $(RUNME).$(GOOBJEXT); \
|
||||
else \
|
||||
$(COMPILETOOL) $(GO) $(GOCOMPILEARG) $(SRCDIR)$(RUNME).go; \
|
||||
|
|
|
|||
|
|
@ -246,6 +246,7 @@ CPP_TEST_CASES += \
|
|||
ignore_parameter \
|
||||
import_nomodule \
|
||||
inherit \
|
||||
inherit_member \
|
||||
inherit_missing \
|
||||
inherit_same_name \
|
||||
inherit_target_language \
|
||||
|
|
|
|||
|
|
@ -2,9 +2,13 @@
|
|||
%module cpp11_template_typedefs
|
||||
|
||||
%warnfilter(SWIGWARN_CPP11_ALIAS_TEMPLATE) TypedefName;
|
||||
%warnfilter(SWIGWARN_CPP11_ALIAS_TEMPLATE) TypedefNamePtr;
|
||||
%warnfilter(SWIGWARN_CPP11_ALIAS_TEMPLATE) MyIntKeyClass;
|
||||
%warnfilter(SWIGWARN_CPP11_ALIAS_DECLARATION) PF;
|
||||
|
||||
// This warning should go away when type aliasing is supported
|
||||
#pragma SWIG nowarn=SWIGWARN_PARSE_USING_UNDEF // Nothing known about 'p.SomeType< char *,T2,4 >'.
|
||||
|
||||
%inline %{
|
||||
template< typename T1, typename T2, int >
|
||||
class SomeType {
|
||||
|
|
@ -16,6 +20,8 @@ class SomeType {
|
|||
// template aliasing
|
||||
template< typename T2 >
|
||||
using TypedefName = SomeType<char*, T2, 5>;
|
||||
template< typename T2 >
|
||||
using TypedefNamePtr = SomeType<char*, T2, 4>*;
|
||||
|
||||
// type aliasing
|
||||
typedef void (*PFD)(double); // Old style
|
||||
|
|
@ -28,5 +34,8 @@ class MyCPP11Class {
|
|||
};
|
||||
template<typename VAL> using MyIntKeyClass = MyCPP11Class<int,VAL>;
|
||||
MyIntKeyClass<char> intchar;
|
||||
|
||||
TypedefName<int> alias1(TypedefName<int> a) { return a; }
|
||||
TypedefNamePtr<int> alias1(TypedefNamePtr<int> a = nullptr) { return a; }
|
||||
%}
|
||||
|
||||
|
|
|
|||
|
|
@ -3,9 +3,15 @@
|
|||
// Type aliasing seg fault : Github issue #424
|
||||
|
||||
%warnfilter(SWIGWARN_CPP11_ALIAS_DECLARATION) Target;
|
||||
%warnfilter(SWIGWARN_CPP11_ALIAS_DECLARATION) Int;
|
||||
%warnfilter(SWIGWARN_CPP11_ALIAS_DECLARATION) IntRef;
|
||||
%warnfilter(SWIGWARN_CPP11_ALIAS_DECLARATION) IntPtrRef;
|
||||
%warnfilter(SWIGWARN_CPP11_ALIAS_DECLARATION) IntRValueRef;
|
||||
%warnfilter(SWIGWARN_CPP11_ALIAS_DECLARATION) IntArray;
|
||||
%warnfilter(SWIGWARN_CPP11_ALIAS_DECLARATION) HalideTargetPtr1;
|
||||
%warnfilter(SWIGWARN_CPP11_ALIAS_DECLARATION) HalideTargetPtr2;
|
||||
|
||||
%inline %{
|
||||
|
||||
namespace Halide {
|
||||
|
||||
struct Target {
|
||||
|
|
@ -44,3 +50,17 @@ public:
|
|||
%}
|
||||
|
||||
%template(Halide_Target) Halide::Internal::GeneratorParam<Halide::Target>;
|
||||
|
||||
|
||||
%inline %{
|
||||
using Int = int;
|
||||
using IntRef = int&;
|
||||
using IntPtrRef = int*&;
|
||||
using IntRValueRef = int&&;
|
||||
using IntArray = int[];
|
||||
|
||||
using HalideTargetPtr1 = Halide::Target*;
|
||||
namespace Halide {
|
||||
using HalideTargetPtr2 = Target*;
|
||||
}
|
||||
%}
|
||||
|
|
|
|||
|
|
@ -13,12 +13,12 @@ GO15 = @GO15@
|
|||
GOC = @GOC@
|
||||
SCRIPTSUFFIX = _runme.go
|
||||
|
||||
GOCOMPILEARG = `if $(GO1) ; then echo tool $(GOC:c=g) ; fi`
|
||||
GOLD = $(GOC:c=l)
|
||||
GOCOMPILEARG = `if $(GO15); then echo tool compile; elif $(GO1); then echo tool $(GOC:c=g); fi`
|
||||
GOLD = `if $(GO15); then echo link; else echo $(GOC:c=l); fi`
|
||||
GOTOOL = `if $(GO1) ; then echo go tool; fi`
|
||||
GOPACK = `if $(GO1) ; then echo go tool pack; else echo gopack; fi`
|
||||
|
||||
GOOBJEXT = $(GOC:c=)
|
||||
GOOBJEXT = `if $(GO15); then echo o; else echo $(GOC:c=); fi`
|
||||
|
||||
SO = @SO@
|
||||
|
||||
|
|
|
|||
15
Examples/test-suite/go/inherit_member_runme.go
Normal file
15
Examples/test-suite/go/inherit_member_runme.go
Normal file
|
|
@ -0,0 +1,15 @@
|
|||
package main
|
||||
|
||||
import wrap "./inherit_member"
|
||||
|
||||
func main() {
|
||||
s := wrap.NewChild()
|
||||
s.SetPvar("p")
|
||||
s.SetCvar("c")
|
||||
if s.GetPvar() != "p" {
|
||||
panic(s.GetPvar())
|
||||
}
|
||||
if s.GetCvar() != "c" {
|
||||
panic(s.GetCvar())
|
||||
}
|
||||
}
|
||||
17
Examples/test-suite/inherit_member.i
Normal file
17
Examples/test-suite/inherit_member.i
Normal file
|
|
@ -0,0 +1,17 @@
|
|||
// Based on https://github.com/swig/swig/issues/339 .
|
||||
|
||||
%module inherit_member
|
||||
|
||||
%include <std_string.i>
|
||||
|
||||
%inline %{
|
||||
|
||||
struct parent {
|
||||
std::string pvar;
|
||||
};
|
||||
|
||||
struct child : public parent {
|
||||
std::string cvar;
|
||||
};
|
||||
|
||||
%}
|
||||
|
|
@ -14,12 +14,9 @@
|
|||
SWIGINTERN int
|
||||
SWIG_SciString_AsChar(void *pvApiCtx, int iVar, char *pcValue, char *fname) {
|
||||
SciErr sciErr;
|
||||
int iType = 0;
|
||||
int iRows = 0;
|
||||
int iCols = 0;
|
||||
int *piAddrVar = NULL;
|
||||
char *pstStrings = NULL;
|
||||
int piLength = 0;
|
||||
char *pstValue = NULL;
|
||||
int iRet;
|
||||
|
||||
sciErr = getVarAddressFromPosition(pvApiCtx, iVar, &piAddrVar);
|
||||
if (sciErr.iErr) {
|
||||
|
|
@ -27,30 +24,22 @@ SWIG_SciString_AsChar(void *pvApiCtx, int iVar, char *pcValue, char *fname) {
|
|||
return SWIG_ERROR;
|
||||
}
|
||||
|
||||
sciErr = getVarType(pvApiCtx, piAddrVar, &iType);
|
||||
if (sciErr.iErr) {
|
||||
printError(&sciErr, 0);
|
||||
return SWIG_ERROR;
|
||||
if (isStringType(pvApiCtx, piAddrVar) == 0)
|
||||
{
|
||||
Scierror(SCILAB_API_ARGUMENT_ERROR, _("%s: Wrong type for input argument #%d: A single string expected.\n"), fname, iVar);
|
||||
return SWIG_TypeError;
|
||||
}
|
||||
if (iType != sci_strings) {
|
||||
Scierror(SCILAB_API_ARGUMENT_ERROR, _("%s: Wrong type for input argument #%d: A string expected.\n"), fname, iVar);
|
||||
|
||||
iRet = getAllocatedSingleString(pvApiCtx, piAddrVar, &pstValue);
|
||||
if (iRet) {
|
||||
return SWIG_ERROR;
|
||||
}
|
||||
|
||||
pstStrings = (char *)malloc(sizeof(char));
|
||||
sciErr = getMatrixOfString(pvApiCtx, piAddrVar, &iRows, &iCols, &piLength, (char **)&pstStrings);
|
||||
if (sciErr.iErr) {
|
||||
printError(&sciErr, 0);
|
||||
return SWIG_ERROR;
|
||||
if (pcValue != NULL) {
|
||||
*pcValue = pstValue[0];
|
||||
}
|
||||
if (iRows * iCols != 1) {
|
||||
Scierror(SCILAB_API_ARGUMENT_ERROR, _("%s: Wrong size for input argument #%d: A string expected.\n"), fname, iVar);
|
||||
return SWIG_ERROR;
|
||||
}
|
||||
*pcValue = pstStrings[0];
|
||||
|
||||
free(pstStrings);
|
||||
|
||||
freeAllocatedSingleString(pstValue);
|
||||
return SWIG_OK;
|
||||
}
|
||||
}
|
||||
|
|
@ -103,8 +92,7 @@ SWIG_SciString_AsCharPtr(void *pvApiCtx, int iVar, char *pcValue, int iLength, c
|
|||
strncpy(pcValue, pcTmpValue, iLength);
|
||||
}
|
||||
|
||||
free(pcTmpValue);
|
||||
|
||||
freeAllocatedSingleString(pcTmpValue);
|
||||
return SWIG_OK;
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -66,11 +66,13 @@ static void SWIG_Scilab_SetApiContext(void *apiCtx) {
|
|||
|
||||
#if SWIG_SCILAB_VERSION >= 540
|
||||
#define SWIG_CheckInputArgument(pvApiCtx, minInputArgument, maxInputArgument) CheckInputArgument(pvApiCtx, minInputArgument, maxInputArgument)
|
||||
#define SWIG_CheckInputArgumentAtLeast(pvApiCtx, minInputArgument) CheckInputArgumentAtLeast(pvApiCtx, minInputArgument)
|
||||
#define SWIG_CheckOutputArgument(pvApiCtx, minOutputArgument, maxOutputArgument) CheckOutputArgument(pvApiCtx, minOutputArgument, maxOutputArgument)
|
||||
#define SWIG_NbInputArgument(pvApiCtx) nbInputArgument(pvApiCtx)
|
||||
#define SWIG_AssignOutputArgument(pvApiCtx, outputArgumentPos, argumentPos) AssignOutputVariable(pvApiCtx, outputArgumentPos) = argumentPos
|
||||
#else
|
||||
#define SWIG_CheckInputArgument(pvApiCtx, minInputArgument, maxInputArgument) CheckRhs(minInputArgument, maxInputArgument)
|
||||
#define SWIG_CheckInputArgumentAtLeast(pvApiCtx, minInputArgument) CheckRhs(minInputArgument, 256)
|
||||
#define SWIG_CheckOutputArgument(pvApiCtx, minOutputArgument, maxOutputArgument) CheckLhs(minOutputArgument, maxOutputArgument)
|
||||
#define SWIG_NbInputArgument(pvApiCtx) Rhs
|
||||
#define SWIG_AssignOutputArgument(pvApiCtx, outputArgumentPos, argumentPos) LhsVar(outputArgumentPos) = argumentPos
|
||||
|
|
@ -148,7 +150,8 @@ SWIGRUNTIME int
|
|||
SWIG_Scilab_ConvertPacked(void *pvApiCtx, int iVar, void *ptr, int sz, swig_type_info *ty, char *fname) {
|
||||
swig_cast_info *tc;
|
||||
int *piAddrVar = NULL;
|
||||
char *pstStrings = NULL;
|
||||
char *pstString = NULL;
|
||||
char *pstStringPtr = NULL;
|
||||
SciErr sciErr;
|
||||
|
||||
sciErr = getVarAddressFromPosition(pvApiCtx, iVar, &piAddrVar);
|
||||
|
|
@ -157,27 +160,33 @@ SWIG_Scilab_ConvertPacked(void *pvApiCtx, int iVar, void *ptr, int sz, swig_type
|
|||
return SWIG_ERROR;
|
||||
}
|
||||
|
||||
if (getAllocatedSingleString(pvApiCtx, piAddrVar, &pstStrings)) {
|
||||
if (getAllocatedSingleString(pvApiCtx, piAddrVar, &pstString)) {
|
||||
return SWIG_ERROR;
|
||||
}
|
||||
|
||||
/* Pointer values must start with leading underscore */
|
||||
if (*pstStrings != '_') {
|
||||
if (*pstString != '_') {
|
||||
freeAllocatedSingleString(pstString);
|
||||
return SWIG_ERROR;
|
||||
}
|
||||
|
||||
pstStrings++;
|
||||
pstStrings = (char*)SWIG_UnpackData(pstStrings, ptr, sz);
|
||||
pstStringPtr = pstString;
|
||||
pstStringPtr++;
|
||||
pstStringPtr = (char*)SWIG_UnpackData(pstStringPtr, ptr, sz);
|
||||
|
||||
if (ty) {
|
||||
if (!pstStrings) {
|
||||
if (!pstStringPtr) {
|
||||
freeAllocatedSingleString(pstString);
|
||||
return SWIG_ERROR;
|
||||
}
|
||||
tc = SWIG_TypeCheck(pstStrings, ty);
|
||||
tc = SWIG_TypeCheck(pstStringPtr, ty);
|
||||
if (!tc) {
|
||||
freeAllocatedSingleString(pstString);
|
||||
return SWIG_ERROR;
|
||||
}
|
||||
}
|
||||
|
||||
freeAllocatedSingleString(pstString);
|
||||
return SWIG_OK;
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -1438,7 +1438,7 @@ static void mark_nodes_as_extend(Node *n) {
|
|||
%type <str> pragma_arg;
|
||||
%type <loc> includetype;
|
||||
%type <type> pointer primitive_type;
|
||||
%type <decl> declarator direct_declarator notso_direct_declarator parameter_declarator typemap_parameter_declarator;
|
||||
%type <decl> declarator direct_declarator notso_direct_declarator parameter_declarator plain_declarator;
|
||||
%type <decl> abstract_declarator direct_abstract_declarator ctor_end;
|
||||
%type <tmap> typemap_type;
|
||||
%type <str> idcolon idcolontail idcolonnt idcolontailnt idtemplate stringbrace stringbracesemi;
|
||||
|
|
@ -2466,7 +2466,7 @@ tm_tail : COMMA typemap_parm tm_tail {
|
|||
| empty { $$ = 0;}
|
||||
;
|
||||
|
||||
typemap_parm : type typemap_parameter_declarator {
|
||||
typemap_parm : type plain_declarator {
|
||||
Parm *parm;
|
||||
SwigType_push($1,$2.type);
|
||||
$$ = new_node("typemapitem");
|
||||
|
|
@ -2850,9 +2850,10 @@ c_declaration : c_decl {
|
|||
Swig_warning(WARN_CPP11_LAMBDA, cparse_file, cparse_line, "Lambda expressions and closures are not fully supported yet.\n");
|
||||
SWIG_WARN_NODE_END($$);
|
||||
}
|
||||
| USING idcolon EQUAL idcolon {
|
||||
| USING idcolon EQUAL type plain_declarator SEMI {
|
||||
$$ = new_node("using");
|
||||
Setattr($$,"name",$2);
|
||||
SwigType_push($4,$5.type);
|
||||
Setattr($$,"uname",$4);
|
||||
add_symbols($$);
|
||||
SWIG_WARN_NODE_BEGIN($$);
|
||||
|
|
@ -2861,15 +2862,17 @@ c_declaration : c_decl {
|
|||
|
||||
$$ = 0; /* TODO - ignored for now */
|
||||
}
|
||||
| TEMPLATE LESSTHAN template_parms GREATERTHAN USING idcolon EQUAL identifier {
|
||||
skip_decl();
|
||||
| TEMPLATE LESSTHAN template_parms GREATERTHAN USING idcolon EQUAL type plain_declarator SEMI {
|
||||
$$ = new_node("using");
|
||||
Setattr($$,"uname",$8);
|
||||
Setattr($$,"name",$6);
|
||||
SwigType_push($8,$9.type);
|
||||
Setattr($$,"uname",$8);
|
||||
add_symbols($$);
|
||||
SWIG_WARN_NODE_BEGIN($$);
|
||||
Swig_warning(WARN_CPP11_ALIAS_TEMPLATE, cparse_file, cparse_line, "The 'using' keyword in template aliasing is not fully supported yet.\n");
|
||||
SWIG_WARN_NODE_END($$);
|
||||
|
||||
$$ = 0; /* TODO - ignored for now */
|
||||
}
|
||||
;
|
||||
|
||||
|
|
@ -4880,7 +4883,7 @@ parameter_declarator : declarator def_args {
|
|||
}
|
||||
;
|
||||
|
||||
typemap_parameter_declarator : declarator {
|
||||
plain_declarator : declarator {
|
||||
$$ = $1;
|
||||
if (SwigType_isfunction($1.type)) {
|
||||
Delete(SwigType_pop_function($1.type));
|
||||
|
|
|
|||
|
|
@ -3160,15 +3160,26 @@ private:
|
|||
Setattr(var, "type", var_type);
|
||||
|
||||
SwigType *vt = Copy(var_type);
|
||||
if (SwigType_isclass(vt)) {
|
||||
SwigType_add_pointer(vt);
|
||||
}
|
||||
|
||||
int flags = Extend | SmartPointer | use_naturalvar_mode(var);
|
||||
if (isNonVirtualProtectedAccess(var)) {
|
||||
flags |= CWRAP_ALL_PROTECTED_ACCESS;
|
||||
}
|
||||
|
||||
// Copied from Swig_wrapped_member_var_type.
|
||||
if (SwigType_isclass(vt)) {
|
||||
if (flags & CWRAP_NATURAL_VAR) {
|
||||
if (CPlusPlus) {
|
||||
if (!SwigType_isconst(vt)) {
|
||||
SwigType_add_qualifier(vt, "const");
|
||||
}
|
||||
SwigType_add_reference(vt);
|
||||
}
|
||||
} else {
|
||||
SwigType_add_pointer(vt);
|
||||
}
|
||||
}
|
||||
|
||||
String *mname = Swig_name_member(getNSpace(), Getattr(var_class, "sym:name"), var_name);
|
||||
|
||||
if (is_assignable(var)) {
|
||||
|
|
|
|||
|
|
@ -2714,7 +2714,7 @@ public:
|
|||
Printv(f->locals, " char * kwnames[] = ", kwargs, ";\n", NIL);
|
||||
}
|
||||
|
||||
if (builtin && in_class && tuple_arguments == 0) {
|
||||
if (builtin && !funpack && in_class && tuple_arguments == 0) {
|
||||
Printf(parse_args, " if (args && PyTuple_Check(args) && PyTuple_GET_SIZE(args) > 0) SWIG_exception_fail(SWIG_TypeError, \"%s takes no arguments\");\n", iname);
|
||||
} else if (use_parse || allow_kwargs || !modernargs) {
|
||||
Printf(parse_args, ":%s\"", iname);
|
||||
|
|
@ -4658,7 +4658,7 @@ public:
|
|||
Printv(f_shadow, pythoncode(pythonprepend(n), tab8), "\n", NIL);
|
||||
Printv(f_shadow, pass_self, NIL);
|
||||
if (fastinit) {
|
||||
Printv(f_shadow, tab8, module, ".", class_name, "_swiginit(self,", funcCall(Swig_name_construct(NSPACE_TODO, symname), callParms), ")\n", NIL);
|
||||
Printv(f_shadow, tab8, module, ".", class_name, "_swiginit(self, ", funcCall(Swig_name_construct(NSPACE_TODO, symname), callParms), ")\n", NIL);
|
||||
} else {
|
||||
Printv(f_shadow,
|
||||
tab8, "this = ", funcCall(Swig_name_construct(NSPACE_TODO, symname), callParms), "\n",
|
||||
|
|
|
|||
|
|
@ -346,14 +346,18 @@ public:
|
|||
emit_attach_parmmaps(functionParamsList, wrapper);
|
||||
Setattr(node, "wrap:parms", functionParamsList);
|
||||
|
||||
/* Check arguments */
|
||||
/* Check input/output arguments count */
|
||||
int maxInputArguments = emit_num_arguments(functionParamsList);
|
||||
int minInputArguments = emit_num_required(functionParamsList);
|
||||
int minOutputArguments = 0;
|
||||
int maxOutputArguments = 0;
|
||||
|
||||
/* Insert calls to CheckInputArgument and CheckOutputArgument */
|
||||
Printf(wrapper->code, "SWIG_CheckInputArgument(pvApiCtx, $mininputarguments, $maxinputarguments);\n");
|
||||
if (!emit_isvarargs(functionParamsList)) {
|
||||
Printf(wrapper->code, "SWIG_CheckInputArgument(pvApiCtx, $mininputarguments, $maxinputarguments);\n");
|
||||
}
|
||||
else {
|
||||
Printf(wrapper->code, "SWIG_CheckInputArgumentAtLeast(pvApiCtx, $mininputarguments-1);\n");
|
||||
}
|
||||
Printf(wrapper->code, "SWIG_CheckOutputArgument(pvApiCtx, $minoutputarguments, $maxoutputarguments);\n");
|
||||
|
||||
/* Set context */
|
||||
|
|
|
|||
|
|
@ -1,6 +1,3 @@
|
|||
os:
|
||||
- Windows Server 2012 R2
|
||||
|
||||
platform:
|
||||
- x86
|
||||
- x64
|
||||
|
|
|
|||
18
configure.ac
18
configure.ac
|
|
@ -2426,8 +2426,15 @@ else
|
|||
if test -n "$GO" ; then
|
||||
GO1=true
|
||||
GOVERSIONOPTION=version
|
||||
GOC=$(sh -c "$(go env) && echo \$GOCHAR")c
|
||||
go_version=$($GO $GOVERSIONOPTION | sed -e 's/go version //')
|
||||
case "$go_version" in
|
||||
go1 | go1.[[01234]]*)
|
||||
GOC=$(sh -c "$(go env) && echo \$GOCHAR")c
|
||||
;;
|
||||
*)
|
||||
GOC=compile
|
||||
;;
|
||||
esac
|
||||
AC_MSG_CHECKING([whether go version is too old])
|
||||
case $go_version in
|
||||
go1.0* | go1 )
|
||||
|
|
@ -2437,11 +2444,14 @@ else
|
|||
;;
|
||||
*)
|
||||
AC_MSG_RESULT([no])
|
||||
if test "$GOC" = "6c"; then
|
||||
case "$(go env GOARCH)" in
|
||||
amd64 | arm64 | ppc64*)
|
||||
GOOPT="-intgosize 64"
|
||||
else
|
||||
;;
|
||||
*)
|
||||
GOOPT="-intgosize 32"
|
||||
fi
|
||||
;;
|
||||
esac
|
||||
;;
|
||||
esac
|
||||
case $go_version in
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue