fixes for 'typedef unsigned long size_t'

git-svn-id: https://swig.svn.sourceforge.net/svnroot/swig/trunk/SWIG@7939 626c5289-ae23-0410-ae9c-e8d60b6d4f22
This commit is contained in:
Marcelo Matus 2005-12-07 07:38:09 +00:00
commit 28df9d1049
6 changed files with 40 additions and 18 deletions

View file

@ -16,6 +16,8 @@
char cvsroot_perl5_cxx[] = "$Header$";
#include "swigmod.h"
#include "cparse.h"
static int treduce = SWIG_cparse_template_reduce(1);
#include <ctype.h>
@ -128,6 +130,7 @@ public:
int cppcast = 1;
SWIG_library_directory("perl5");
for (i = 1; i < argc; i++) {
if (argv[i]) {
if(strcmp(argv[i],"-package") == 0) {

View file

@ -13,6 +13,7 @@ char cvsroot_python_cxx[] = "$Header$";
#include "swigmod.h"
#include "cparse.h"
static int treduce = SWIG_cparse_template_reduce(1);
#include <ctype.h>
@ -1461,7 +1462,8 @@ public:
/* Insert cleanup code */
for (p = l; p;) {
if (!checkAttribute(p,"tmap:in:numinputs","0") && (tm = Getattr(p,"tmap:freearg"))) {
if (!checkAttribute(p,"tmap:in:numinputs","0") &&
!Getattr(p,"tmap:in:parse") && (tm = Getattr(p,"tmap:freearg"))) {
if (Len(tm) != 0) {
Replaceall(tm,"$source",Getattr(p,"lname"));
Printv(cleanup,tm,"\n",NIL);

View file

@ -13,6 +13,9 @@
char cvsroot_ruby_cxx[] = "$Header$";
#include "swigmod.h"
#include "cparse.h"
static int treduce = SWIG_cparse_template_reduce(1);
#define SWIG_PROTECTED_TARGET_METHODS 1
#include <ctype.h>

View file

@ -23,6 +23,8 @@
char cvsroot_tcl8_cxx[] = "$Header$";
#include "swigmod.h"
#include "cparse.h"
static int treduce = SWIG_cparse_template_reduce(1);
static const char *usage = (char*)"\
Tcl 8 Options (available with -tcl)\n\
@ -418,7 +420,8 @@ public:
/* Insert cleanup code */
for (i = 0, p = parms; p; i++) {
if (!checkAttribute(p,"tmap:in:numinputs","0") && (tm = Getattr(p,"tmap:freearg"))) {
if (!checkAttribute(p,"tmap:in:numinputs","0")
&& !Getattr(p,"tmap:in:parse") && (tm = Getattr(p,"tmap:freearg"))) {
if (Len(tm) != 0) {
Replaceall(tm,"$source",Getattr(p,"lname"));
Printv(cleanup,tm,"\n",NIL);

View file

@ -39,7 +39,7 @@ Swig_fragment_register(Node* fragment) {
String *type = Getattr(fragment,"type");
if (type) {
SwigType *rtype = SwigType_typedef_resolve_all(type);
String *mangle = Swig_string_mangle(rtype);
String *mangle = Swig_string_mangle(type);
Append(name,mangle);
Delete(mangle);
Delete(rtype);
@ -95,9 +95,7 @@ Swig_fragment_emit(Node *n) {
}
type = Getattr(n,"type");
if (type) {
SwigType *rtype = SwigType_typedef_resolve_all(type);
mangle = Swig_string_mangle(rtype);
Delete(rtype);
mangle = Swig_string_mangle(type);
}
if (debug) Printf(stdout,"looking fragment %s %s\n",name, type);
@ -133,7 +131,19 @@ Swig_fragment_emit(Node *n) {
Setattr(fragments,name,"ignore");
}
}
} else {
if (code && type) {
SwigType *rtype = SwigType_typedef_resolve_all(type);
if (!Equal(type,rtype)) {
String *name = Copy(Getattr(n,"value"));
Append(name,rtype);
Swig_fragment_emit(name);
Delete(name);
}
Delete(rtype);
}
}
tok = pc ? pc + 1 : 0;
if (tok) {
pc = char_index(tok,',');

View file

@ -1230,6 +1230,7 @@ String *Swig_typemap_lookup_new(const String_or_char *op, Node *node, const Stri
String *symname;
String *cname = 0;
String *clname = 0;
char *cop = Char(op);
#if 0
String *qsn;
Symtab *st;
@ -1330,13 +1331,13 @@ Printf(stdout, "Swig_typemap_lookup %s [%s %s]\n", op, type, pname ? pname : "NO
Setattr(node,tmop_name(op),s);
if (locals) {
sprintf(temp,"%s:locals", Char(op));
sprintf(temp,"%s:locals", cop);
Setattr(node,tmop_name(temp), locals);
Delete(locals);
}
if (HashCheckAttr(tm,k_type,k_SWIGTYPE)) {
sprintf(temp,"%s:SWIGTYPE", Char(op));
sprintf(temp,"%s:SWIGTYPE", cop);
Setattr(node,tmop_name(temp),k_one);
}
@ -1345,14 +1346,13 @@ Printf(stdout, "Swig_typemap_lookup %s [%s %s]\n", op, type, pname ? pname : "NO
while (kw) {
String *value = Copy(Getattr(kw,k_value));
String *type = Getattr(kw,k_type);
if (type) {
SwigType *rtype = SwigType_typedef_resolve_all(type);
String *mangle = Swig_string_mangle(rtype);
char *ckwname = Char(Getattr(kw,k_name));
if (type) {
String *mangle = Swig_string_mangle(type);
StringAppend(value,mangle);
Delete(mangle);
Delete(rtype);
}
sprintf(temp,"%s:%s",Char(op),Char(Getattr(kw,k_name)));
sprintf(temp,"%s:%s",cop, ckwname);
Setattr(node,tmop_name(temp), value);
Delete(value);
kw = nextSibling(kw);
@ -1361,7 +1361,7 @@ Printf(stdout, "Swig_typemap_lookup %s [%s %s]\n", op, type, pname ? pname : "NO
/* Look for warnings */
{
String *w;
sprintf(temp,"%s:warning", Char(op));
sprintf(temp,"%s:warning", cop);
w = Getattr(node,tmop_name(temp));
if (w) {
Swig_warning(0,Getfile(node),Getline(node),"%s\n", w);
@ -1371,7 +1371,7 @@ Printf(stdout, "Swig_typemap_lookup %s [%s %s]\n", op, type, pname ? pname : "NO
/* Look for code fragments */
{
String *f;
sprintf(temp,"%s:fragment", Char(op));
sprintf(temp,"%s:fragment", cop);
f = Getattr(node,tmop_name(temp));
if (f) {
Swig_fragment_emit(f);
@ -1468,6 +1468,7 @@ Swig_typemap_attach_parms(const String_or_char *op, ParmList *parms, Wrapper *f)
ParmList *locals;
int argnum = 0;
char temp[256];
char *cop = Char(op);
p = parms;
while (p) {
@ -1513,7 +1514,7 @@ Swig_typemap_attach_parms(const String_or_char *op, ParmList *parms, Wrapper *f)
}
if (HashCheckAttr(tm,k_type,k_SWIGTYPE)) {
sprintf(temp,"%s:SWIGTYPE", Char(op));
sprintf(temp,"%s:SWIGTYPE", cop);
Setattr(p,tmop_name(temp),k_one);
}
p = nextSibling(p);
@ -1533,13 +1534,13 @@ Swig_typemap_attach_parms(const String_or_char *op, ParmList *parms, Wrapper *f)
Setattr(firstp,tmop_name(op),s); /* Code object */
if (locals) {
sprintf(temp,"%s:locals", Char(op));
sprintf(temp,"%s:locals", cop);
Setattr(firstp,tmop_name(temp), locals);
Delete(locals);
}
/* Attach a link to the next parameter. Needed for multimaps */
sprintf(temp,"%s:next",Char(op));
sprintf(temp,"%s:next",cop);
Setattr(firstp,tmop_name(temp),p);
/* Attach kwargs */