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
|
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
|
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 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>
|
<div class="shell"><pre>
|
||||||
$ swig -python -external-runtime <filename>
|
$ swig -python -external-runtime <filename>
|
||||||
|
|
|
||||||
|
|
@ -1774,12 +1774,12 @@ GCCGOOPT = @GCCGOOPT@
|
||||||
GOVERSIONOPTION = @GOVERSIONOPTION@
|
GOVERSIONOPTION = @GOVERSIONOPTION@
|
||||||
|
|
||||||
GOSWIGARG = `if $(GOGCC) ; then echo -gccgo; fi`
|
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)
|
GOSRCS = $(INTERFACE:.i=.go)
|
||||||
GOCSRCS = $(INTERFACE:.i=_gc.c)
|
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`
|
GOTOOL = `if $(GO1) ; then echo go tool; fi`
|
||||||
GOPACK = `if $(GO1) ; then echo go tool pack; else echo gopack; 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=)
|
GOPATHDIR = gopath/src/$(INTERFACE:.i=)
|
||||||
|
|
||||||
GOOBJEXT = $(GOC:c=)
|
GOOBJEXT = `if $(GO15); then echo o; else echo $(GOC:c=); fi`
|
||||||
GOGCOBJS = $(GOSRCS:.go=.$(GOOBJEXT))
|
GOGCOBJS = $(GOSRCS:.go=.$(GOOBJEXT))
|
||||||
GOGCCOBJS = $(GOSRCS:.go=.@OBJEXT@)
|
GOGCCOBJS = $(GOSRCS:.go=.@OBJEXT@)
|
||||||
|
|
||||||
|
|
@ -1863,7 +1863,7 @@ go: $(SRCDIR_SRCS)
|
||||||
$(COMPILETOOL) $(GCCGO) -c -g $(SRCDIR)$(RUNME).go; \
|
$(COMPILETOOL) $(GCCGO) -c -g $(SRCDIR)$(RUNME).go; \
|
||||||
$(COMPILETOOL) $(GCCGO) -o $(RUNME) $(RUNME).@OBJEXT@ $(dir $(INTERFACE))/$(GOPACKAGE); \
|
$(COMPILETOOL) $(GCCGO) -o $(RUNME) $(RUNME).@OBJEXT@ $(dir $(INTERFACE))/$(GOPACKAGE); \
|
||||||
elif $(GO12) || $(GO13) || $(GO15); then \
|
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); \
|
$(COMPILETOOL) $(GOTOOL) $(GOLD) -linkmode external -extld "$(CC)" -extldflags "$(CFLAGS) $(LDFLAGS)" -o $(RUNME) $(RUNME).$(GOOBJEXT); \
|
||||||
else \
|
else \
|
||||||
$(COMPILETOOL) $(GO) $(GOCOMPILEARG) $(SRCDIR)$(RUNME).go; \
|
$(COMPILETOOL) $(GO) $(GOCOMPILEARG) $(SRCDIR)$(RUNME).go; \
|
||||||
|
|
@ -1960,7 +1960,7 @@ go_cpp: $(SRCDIR_SRCS)
|
||||||
$(COMPILETOOL) $(GCCGO) -g -c $(SRCDIR)$(RUNME).go; \
|
$(COMPILETOOL) $(GCCGO) -g -c $(SRCDIR)$(RUNME).go; \
|
||||||
$(COMPILETOOL) $(GCCGO) -o $(RUNME) $(RUNME).@OBJEXT@ $(dir $(INTERFACE))/$(GOPACKAGE) -lstdc++; \
|
$(COMPILETOOL) $(GCCGO) -o $(RUNME) $(RUNME).@OBJEXT@ $(dir $(INTERFACE))/$(GOPACKAGE) -lstdc++; \
|
||||||
elif $(GO12) || $(GO13) || $(GO15); then \
|
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); \
|
$(COMPILETOOL) $(GOTOOL) $(GOLD) -linkmode external -extld "$(CXX)" -extldflags "$(CXXFLAGS) $(LDFLAGS)" -o $(RUNME) $(RUNME).$(GOOBJEXT); \
|
||||||
else \
|
else \
|
||||||
$(COMPILETOOL) $(GO) $(GOCOMPILEARG) $(SRCDIR)$(RUNME).go; \
|
$(COMPILETOOL) $(GO) $(GOCOMPILEARG) $(SRCDIR)$(RUNME).go; \
|
||||||
|
|
|
||||||
|
|
@ -246,6 +246,7 @@ CPP_TEST_CASES += \
|
||||||
ignore_parameter \
|
ignore_parameter \
|
||||||
import_nomodule \
|
import_nomodule \
|
||||||
inherit \
|
inherit \
|
||||||
|
inherit_member \
|
||||||
inherit_missing \
|
inherit_missing \
|
||||||
inherit_same_name \
|
inherit_same_name \
|
||||||
inherit_target_language \
|
inherit_target_language \
|
||||||
|
|
|
||||||
|
|
@ -2,9 +2,13 @@
|
||||||
%module cpp11_template_typedefs
|
%module cpp11_template_typedefs
|
||||||
|
|
||||||
%warnfilter(SWIGWARN_CPP11_ALIAS_TEMPLATE) TypedefName;
|
%warnfilter(SWIGWARN_CPP11_ALIAS_TEMPLATE) TypedefName;
|
||||||
|
%warnfilter(SWIGWARN_CPP11_ALIAS_TEMPLATE) TypedefNamePtr;
|
||||||
%warnfilter(SWIGWARN_CPP11_ALIAS_TEMPLATE) MyIntKeyClass;
|
%warnfilter(SWIGWARN_CPP11_ALIAS_TEMPLATE) MyIntKeyClass;
|
||||||
%warnfilter(SWIGWARN_CPP11_ALIAS_DECLARATION) PF;
|
%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 %{
|
%inline %{
|
||||||
template< typename T1, typename T2, int >
|
template< typename T1, typename T2, int >
|
||||||
class SomeType {
|
class SomeType {
|
||||||
|
|
@ -16,6 +20,8 @@ class SomeType {
|
||||||
// template aliasing
|
// template aliasing
|
||||||
template< typename T2 >
|
template< typename T2 >
|
||||||
using TypedefName = SomeType<char*, T2, 5>;
|
using TypedefName = SomeType<char*, T2, 5>;
|
||||||
|
template< typename T2 >
|
||||||
|
using TypedefNamePtr = SomeType<char*, T2, 4>*;
|
||||||
|
|
||||||
// type aliasing
|
// type aliasing
|
||||||
typedef void (*PFD)(double); // Old style
|
typedef void (*PFD)(double); // Old style
|
||||||
|
|
@ -28,5 +34,8 @@ class MyCPP11Class {
|
||||||
};
|
};
|
||||||
template<typename VAL> using MyIntKeyClass = MyCPP11Class<int,VAL>;
|
template<typename VAL> using MyIntKeyClass = MyCPP11Class<int,VAL>;
|
||||||
MyIntKeyClass<char> intchar;
|
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
|
// Type aliasing seg fault : Github issue #424
|
||||||
|
|
||||||
%warnfilter(SWIGWARN_CPP11_ALIAS_DECLARATION) Target;
|
%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 %{
|
%inline %{
|
||||||
|
|
||||||
namespace Halide {
|
namespace Halide {
|
||||||
|
|
||||||
struct Target {
|
struct Target {
|
||||||
|
|
@ -44,3 +50,17 @@ public:
|
||||||
%}
|
%}
|
||||||
|
|
||||||
%template(Halide_Target) Halide::Internal::GeneratorParam<Halide::Target>;
|
%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@
|
GOC = @GOC@
|
||||||
SCRIPTSUFFIX = _runme.go
|
SCRIPTSUFFIX = _runme.go
|
||||||
|
|
||||||
GOCOMPILEARG = `if $(GO1) ; then echo tool $(GOC:c=g) ; fi`
|
GOCOMPILEARG = `if $(GO15); then echo tool compile; elif $(GO1); then echo tool $(GOC:c=g); fi`
|
||||||
GOLD = $(GOC:c=l)
|
GOLD = `if $(GO15); then echo link; else echo $(GOC:c=l); fi`
|
||||||
GOTOOL = `if $(GO1) ; then echo go tool; fi`
|
GOTOOL = `if $(GO1) ; then echo go tool; fi`
|
||||||
GOPACK = `if $(GO1) ; then echo go tool pack; else echo gopack; 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@
|
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
|
SWIGINTERN int
|
||||||
SWIG_SciString_AsChar(void *pvApiCtx, int iVar, char *pcValue, char *fname) {
|
SWIG_SciString_AsChar(void *pvApiCtx, int iVar, char *pcValue, char *fname) {
|
||||||
SciErr sciErr;
|
SciErr sciErr;
|
||||||
int iType = 0;
|
|
||||||
int iRows = 0;
|
|
||||||
int iCols = 0;
|
|
||||||
int *piAddrVar = NULL;
|
int *piAddrVar = NULL;
|
||||||
char *pstStrings = NULL;
|
char *pstValue = NULL;
|
||||||
int piLength = 0;
|
int iRet;
|
||||||
|
|
||||||
sciErr = getVarAddressFromPosition(pvApiCtx, iVar, &piAddrVar);
|
sciErr = getVarAddressFromPosition(pvApiCtx, iVar, &piAddrVar);
|
||||||
if (sciErr.iErr) {
|
if (sciErr.iErr) {
|
||||||
|
|
@ -27,30 +24,22 @@ SWIG_SciString_AsChar(void *pvApiCtx, int iVar, char *pcValue, char *fname) {
|
||||||
return SWIG_ERROR;
|
return SWIG_ERROR;
|
||||||
}
|
}
|
||||||
|
|
||||||
sciErr = getVarType(pvApiCtx, piAddrVar, &iType);
|
if (isStringType(pvApiCtx, piAddrVar) == 0)
|
||||||
if (sciErr.iErr) {
|
{
|
||||||
printError(&sciErr, 0);
|
Scierror(SCILAB_API_ARGUMENT_ERROR, _("%s: Wrong type for input argument #%d: A single string expected.\n"), fname, iVar);
|
||||||
return SWIG_ERROR;
|
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;
|
return SWIG_ERROR;
|
||||||
}
|
}
|
||||||
|
|
||||||
pstStrings = (char *)malloc(sizeof(char));
|
if (pcValue != NULL) {
|
||||||
sciErr = getMatrixOfString(pvApiCtx, piAddrVar, &iRows, &iCols, &piLength, (char **)&pstStrings);
|
*pcValue = pstValue[0];
|
||||||
if (sciErr.iErr) {
|
|
||||||
printError(&sciErr, 0);
|
|
||||||
return SWIG_ERROR;
|
|
||||||
}
|
}
|
||||||
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;
|
return SWIG_OK;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
@ -103,8 +92,7 @@ SWIG_SciString_AsCharPtr(void *pvApiCtx, int iVar, char *pcValue, int iLength, c
|
||||||
strncpy(pcValue, pcTmpValue, iLength);
|
strncpy(pcValue, pcTmpValue, iLength);
|
||||||
}
|
}
|
||||||
|
|
||||||
free(pcTmpValue);
|
freeAllocatedSingleString(pcTmpValue);
|
||||||
|
|
||||||
return SWIG_OK;
|
return SWIG_OK;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -66,11 +66,13 @@ static void SWIG_Scilab_SetApiContext(void *apiCtx) {
|
||||||
|
|
||||||
#if SWIG_SCILAB_VERSION >= 540
|
#if SWIG_SCILAB_VERSION >= 540
|
||||||
#define SWIG_CheckInputArgument(pvApiCtx, minInputArgument, maxInputArgument) CheckInputArgument(pvApiCtx, minInputArgument, maxInputArgument)
|
#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_CheckOutputArgument(pvApiCtx, minOutputArgument, maxOutputArgument) CheckOutputArgument(pvApiCtx, minOutputArgument, maxOutputArgument)
|
||||||
#define SWIG_NbInputArgument(pvApiCtx) nbInputArgument(pvApiCtx)
|
#define SWIG_NbInputArgument(pvApiCtx) nbInputArgument(pvApiCtx)
|
||||||
#define SWIG_AssignOutputArgument(pvApiCtx, outputArgumentPos, argumentPos) AssignOutputVariable(pvApiCtx, outputArgumentPos) = argumentPos
|
#define SWIG_AssignOutputArgument(pvApiCtx, outputArgumentPos, argumentPos) AssignOutputVariable(pvApiCtx, outputArgumentPos) = argumentPos
|
||||||
#else
|
#else
|
||||||
#define SWIG_CheckInputArgument(pvApiCtx, minInputArgument, maxInputArgument) CheckRhs(minInputArgument, maxInputArgument)
|
#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_CheckOutputArgument(pvApiCtx, minOutputArgument, maxOutputArgument) CheckLhs(minOutputArgument, maxOutputArgument)
|
||||||
#define SWIG_NbInputArgument(pvApiCtx) Rhs
|
#define SWIG_NbInputArgument(pvApiCtx) Rhs
|
||||||
#define SWIG_AssignOutputArgument(pvApiCtx, outputArgumentPos, argumentPos) LhsVar(outputArgumentPos) = argumentPos
|
#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_Scilab_ConvertPacked(void *pvApiCtx, int iVar, void *ptr, int sz, swig_type_info *ty, char *fname) {
|
||||||
swig_cast_info *tc;
|
swig_cast_info *tc;
|
||||||
int *piAddrVar = NULL;
|
int *piAddrVar = NULL;
|
||||||
char *pstStrings = NULL;
|
char *pstString = NULL;
|
||||||
|
char *pstStringPtr = NULL;
|
||||||
SciErr sciErr;
|
SciErr sciErr;
|
||||||
|
|
||||||
sciErr = getVarAddressFromPosition(pvApiCtx, iVar, &piAddrVar);
|
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;
|
return SWIG_ERROR;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (getAllocatedSingleString(pvApiCtx, piAddrVar, &pstStrings)) {
|
if (getAllocatedSingleString(pvApiCtx, piAddrVar, &pstString)) {
|
||||||
return SWIG_ERROR;
|
return SWIG_ERROR;
|
||||||
}
|
}
|
||||||
|
|
||||||
/* Pointer values must start with leading underscore */
|
/* Pointer values must start with leading underscore */
|
||||||
if (*pstStrings != '_') {
|
if (*pstString != '_') {
|
||||||
|
freeAllocatedSingleString(pstString);
|
||||||
return SWIG_ERROR;
|
return SWIG_ERROR;
|
||||||
}
|
}
|
||||||
|
|
||||||
pstStrings++;
|
pstStringPtr = pstString;
|
||||||
pstStrings = (char*)SWIG_UnpackData(pstStrings, ptr, sz);
|
pstStringPtr++;
|
||||||
|
pstStringPtr = (char*)SWIG_UnpackData(pstStringPtr, ptr, sz);
|
||||||
|
|
||||||
if (ty) {
|
if (ty) {
|
||||||
if (!pstStrings) {
|
if (!pstStringPtr) {
|
||||||
|
freeAllocatedSingleString(pstString);
|
||||||
return SWIG_ERROR;
|
return SWIG_ERROR;
|
||||||
}
|
}
|
||||||
tc = SWIG_TypeCheck(pstStrings, ty);
|
tc = SWIG_TypeCheck(pstStringPtr, ty);
|
||||||
if (!tc) {
|
if (!tc) {
|
||||||
|
freeAllocatedSingleString(pstString);
|
||||||
return SWIG_ERROR;
|
return SWIG_ERROR;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
freeAllocatedSingleString(pstString);
|
||||||
return SWIG_OK;
|
return SWIG_OK;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -1438,7 +1438,7 @@ static void mark_nodes_as_extend(Node *n) {
|
||||||
%type <str> pragma_arg;
|
%type <str> pragma_arg;
|
||||||
%type <loc> includetype;
|
%type <loc> includetype;
|
||||||
%type <type> pointer primitive_type;
|
%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 <decl> abstract_declarator direct_abstract_declarator ctor_end;
|
||||||
%type <tmap> typemap_type;
|
%type <tmap> typemap_type;
|
||||||
%type <str> idcolon idcolontail idcolonnt idcolontailnt idtemplate stringbrace stringbracesemi;
|
%type <str> idcolon idcolontail idcolonnt idcolontailnt idtemplate stringbrace stringbracesemi;
|
||||||
|
|
@ -2466,7 +2466,7 @@ tm_tail : COMMA typemap_parm tm_tail {
|
||||||
| empty { $$ = 0;}
|
| empty { $$ = 0;}
|
||||||
;
|
;
|
||||||
|
|
||||||
typemap_parm : type typemap_parameter_declarator {
|
typemap_parm : type plain_declarator {
|
||||||
Parm *parm;
|
Parm *parm;
|
||||||
SwigType_push($1,$2.type);
|
SwigType_push($1,$2.type);
|
||||||
$$ = new_node("typemapitem");
|
$$ = 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_warning(WARN_CPP11_LAMBDA, cparse_file, cparse_line, "Lambda expressions and closures are not fully supported yet.\n");
|
||||||
SWIG_WARN_NODE_END($$);
|
SWIG_WARN_NODE_END($$);
|
||||||
}
|
}
|
||||||
| USING idcolon EQUAL idcolon {
|
| USING idcolon EQUAL type plain_declarator SEMI {
|
||||||
$$ = new_node("using");
|
$$ = new_node("using");
|
||||||
Setattr($$,"name",$2);
|
Setattr($$,"name",$2);
|
||||||
|
SwigType_push($4,$5.type);
|
||||||
Setattr($$,"uname",$4);
|
Setattr($$,"uname",$4);
|
||||||
add_symbols($$);
|
add_symbols($$);
|
||||||
SWIG_WARN_NODE_BEGIN($$);
|
SWIG_WARN_NODE_BEGIN($$);
|
||||||
|
|
@ -2861,15 +2862,17 @@ c_declaration : c_decl {
|
||||||
|
|
||||||
$$ = 0; /* TODO - ignored for now */
|
$$ = 0; /* TODO - ignored for now */
|
||||||
}
|
}
|
||||||
| TEMPLATE LESSTHAN template_parms GREATERTHAN USING idcolon EQUAL identifier {
|
| TEMPLATE LESSTHAN template_parms GREATERTHAN USING idcolon EQUAL type plain_declarator SEMI {
|
||||||
skip_decl();
|
|
||||||
$$ = new_node("using");
|
$$ = new_node("using");
|
||||||
Setattr($$,"uname",$8);
|
|
||||||
Setattr($$,"name",$6);
|
Setattr($$,"name",$6);
|
||||||
|
SwigType_push($8,$9.type);
|
||||||
|
Setattr($$,"uname",$8);
|
||||||
add_symbols($$);
|
add_symbols($$);
|
||||||
SWIG_WARN_NODE_BEGIN($$);
|
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_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($$);
|
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;
|
$$ = $1;
|
||||||
if (SwigType_isfunction($1.type)) {
|
if (SwigType_isfunction($1.type)) {
|
||||||
Delete(SwigType_pop_function($1.type));
|
Delete(SwigType_pop_function($1.type));
|
||||||
|
|
|
||||||
|
|
@ -3160,15 +3160,26 @@ private:
|
||||||
Setattr(var, "type", var_type);
|
Setattr(var, "type", var_type);
|
||||||
|
|
||||||
SwigType *vt = Copy(var_type);
|
SwigType *vt = Copy(var_type);
|
||||||
if (SwigType_isclass(vt)) {
|
|
||||||
SwigType_add_pointer(vt);
|
|
||||||
}
|
|
||||||
|
|
||||||
int flags = Extend | SmartPointer | use_naturalvar_mode(var);
|
int flags = Extend | SmartPointer | use_naturalvar_mode(var);
|
||||||
if (isNonVirtualProtectedAccess(var)) {
|
if (isNonVirtualProtectedAccess(var)) {
|
||||||
flags |= CWRAP_ALL_PROTECTED_ACCESS;
|
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);
|
String *mname = Swig_name_member(getNSpace(), Getattr(var_class, "sym:name"), var_name);
|
||||||
|
|
||||||
if (is_assignable(var)) {
|
if (is_assignable(var)) {
|
||||||
|
|
|
||||||
|
|
@ -2714,7 +2714,7 @@ public:
|
||||||
Printv(f->locals, " char * kwnames[] = ", kwargs, ";\n", NIL);
|
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);
|
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) {
|
} else if (use_parse || allow_kwargs || !modernargs) {
|
||||||
Printf(parse_args, ":%s\"", iname);
|
Printf(parse_args, ":%s\"", iname);
|
||||||
|
|
@ -4658,7 +4658,7 @@ public:
|
||||||
Printv(f_shadow, pythoncode(pythonprepend(n), tab8), "\n", NIL);
|
Printv(f_shadow, pythoncode(pythonprepend(n), tab8), "\n", NIL);
|
||||||
Printv(f_shadow, pass_self, NIL);
|
Printv(f_shadow, pass_self, NIL);
|
||||||
if (fastinit) {
|
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 {
|
} else {
|
||||||
Printv(f_shadow,
|
Printv(f_shadow,
|
||||||
tab8, "this = ", funcCall(Swig_name_construct(NSPACE_TODO, symname), callParms), "\n",
|
tab8, "this = ", funcCall(Swig_name_construct(NSPACE_TODO, symname), callParms), "\n",
|
||||||
|
|
|
||||||
|
|
@ -346,14 +346,18 @@ public:
|
||||||
emit_attach_parmmaps(functionParamsList, wrapper);
|
emit_attach_parmmaps(functionParamsList, wrapper);
|
||||||
Setattr(node, "wrap:parms", functionParamsList);
|
Setattr(node, "wrap:parms", functionParamsList);
|
||||||
|
|
||||||
/* Check arguments */
|
/* Check input/output arguments count */
|
||||||
int maxInputArguments = emit_num_arguments(functionParamsList);
|
int maxInputArguments = emit_num_arguments(functionParamsList);
|
||||||
int minInputArguments = emit_num_required(functionParamsList);
|
int minInputArguments = emit_num_required(functionParamsList);
|
||||||
int minOutputArguments = 0;
|
int minOutputArguments = 0;
|
||||||
int maxOutputArguments = 0;
|
int maxOutputArguments = 0;
|
||||||
|
|
||||||
/* Insert calls to CheckInputArgument and CheckOutputArgument */
|
if (!emit_isvarargs(functionParamsList)) {
|
||||||
Printf(wrapper->code, "SWIG_CheckInputArgument(pvApiCtx, $mininputarguments, $maxinputarguments);\n");
|
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");
|
Printf(wrapper->code, "SWIG_CheckOutputArgument(pvApiCtx, $minoutputarguments, $maxoutputarguments);\n");
|
||||||
|
|
||||||
/* Set context */
|
/* Set context */
|
||||||
|
|
|
||||||
|
|
@ -1,6 +1,3 @@
|
||||||
os:
|
|
||||||
- Windows Server 2012 R2
|
|
||||||
|
|
||||||
platform:
|
platform:
|
||||||
- x86
|
- x86
|
||||||
- x64
|
- x64
|
||||||
|
|
|
||||||
18
configure.ac
18
configure.ac
|
|
@ -2426,8 +2426,15 @@ else
|
||||||
if test -n "$GO" ; then
|
if test -n "$GO" ; then
|
||||||
GO1=true
|
GO1=true
|
||||||
GOVERSIONOPTION=version
|
GOVERSIONOPTION=version
|
||||||
GOC=$(sh -c "$(go env) && echo \$GOCHAR")c
|
|
||||||
go_version=$($GO $GOVERSIONOPTION | sed -e 's/go version //')
|
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])
|
AC_MSG_CHECKING([whether go version is too old])
|
||||||
case $go_version in
|
case $go_version in
|
||||||
go1.0* | go1 )
|
go1.0* | go1 )
|
||||||
|
|
@ -2437,11 +2444,14 @@ else
|
||||||
;;
|
;;
|
||||||
*)
|
*)
|
||||||
AC_MSG_RESULT([no])
|
AC_MSG_RESULT([no])
|
||||||
if test "$GOC" = "6c"; then
|
case "$(go env GOARCH)" in
|
||||||
|
amd64 | arm64 | ppc64*)
|
||||||
GOOPT="-intgosize 64"
|
GOOPT="-intgosize 64"
|
||||||
else
|
;;
|
||||||
|
*)
|
||||||
GOOPT="-intgosize 32"
|
GOOPT="-intgosize 32"
|
||||||
fi
|
;;
|
||||||
|
esac
|
||||||
;;
|
;;
|
||||||
esac
|
esac
|
||||||
case $go_version in
|
case $go_version in
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue