use better names aliasobj0/noaliasobj0
git-svn-id: https://swig.svn.sourceforge.net/svnroot/swig/trunk/SWIG@8006 626c5289-ae23-0410-ae9c-e8d60b6d4f22
This commit is contained in:
parent
b90540af80
commit
862bb7ef49
2 changed files with 31 additions and 11 deletions
|
|
@ -1,6 +1,26 @@
|
||||||
Version 1.3.28 (unreleased).
|
Version 1.3.28 (unreleased).
|
||||||
===========================
|
===========================
|
||||||
|
|
||||||
|
|
||||||
|
12/17/2005: mmatus
|
||||||
|
[Python]
|
||||||
|
- Add the -aliasobj0/-noaliasobj0 options to use with
|
||||||
|
-fastunpack and/or -O and old typemaps that use 'obj0'
|
||||||
|
directly.
|
||||||
|
|
||||||
|
So, if you compile your code using -O and get errors about
|
||||||
|
the undeclared 'obj0' variable, run again using
|
||||||
|
|
||||||
|
swig -O -aliasobj0 -python ....
|
||||||
|
|
||||||
|
For new typemaps, never use 'obj0' directly, if needed,
|
||||||
|
use the '$self' name that will be properly expanded to
|
||||||
|
'obj0' (nofastunpack) or 'swig_obj[0]' (fastunpack).
|
||||||
|
|
||||||
|
If you have no idea what I am talking about, better, that
|
||||||
|
means you have no typemap with this problem.
|
||||||
|
|
||||||
|
|
||||||
12/14/2005: mmatus
|
12/14/2005: mmatus
|
||||||
[Python]
|
[Python]
|
||||||
- Add the -fastunpack/-nofastunpack options to enable/disable
|
- Add the -fastunpack/-nofastunpack options to enable/disable
|
||||||
|
|
|
||||||
|
|
@ -67,7 +67,7 @@ static int safecstrings = 0;
|
||||||
static int dirvtable = 0;
|
static int dirvtable = 0;
|
||||||
static int proxydel = 1;
|
static int proxydel = 1;
|
||||||
static int fastunpack = 0;
|
static int fastunpack = 0;
|
||||||
static int keepobj0 = 0;
|
static int aliasobj0 = 0;
|
||||||
|
|
||||||
/* flags for the make_autodoc function */
|
/* flags for the make_autodoc function */
|
||||||
enum autodoc_t {
|
enum autodoc_t {
|
||||||
|
|
@ -109,8 +109,8 @@ Python Options (available with -python)\n\
|
||||||
-noproxydel - Don't generate the redundant __del__ method \n\
|
-noproxydel - Don't generate the redundant __del__ method \n\
|
||||||
-fastunpack - Use fast unpack mechanism to parse the argument functions \n\
|
-fastunpack - Use fast unpack mechanism to parse the argument functions \n\
|
||||||
-nofastunpack - Use traditional UnpackTuple method to parse the argument functions (default) \n\
|
-nofastunpack - Use traditional UnpackTuple method to parse the argument functions (default) \n\
|
||||||
-keepobj0 - Keep obj0 when using fastunpack, needed for some users typemaps \n\
|
-aliasobj0 - Alias obj0 when using fastunpack, needed for some old typemaps \n\
|
||||||
-nokeepobj0 - Don't generate obj0 when using fastunpack (default) \n\
|
-noaliasobj0 - Don't generate an obj0 alias when using fastunpack (default) \n\
|
||||||
-O - Enable several old and new optimizations options: \n\
|
-O - Enable several old and new optimizations options: \n\
|
||||||
-modern -fastdispatch -dirvtable -nosafecstrings -fvirtual -noproxydel -fastunpack\n\
|
-modern -fastdispatch -dirvtable -nosafecstrings -fvirtual -noproxydel -fastunpack\n\
|
||||||
\n";
|
\n";
|
||||||
|
|
@ -290,11 +290,11 @@ public:
|
||||||
} else if (strcmp(argv[i],"-nofastunpack") == 0) {
|
} else if (strcmp(argv[i],"-nofastunpack") == 0) {
|
||||||
fastunpack = 0;
|
fastunpack = 0;
|
||||||
Swig_mark_arg(i);
|
Swig_mark_arg(i);
|
||||||
} else if (strcmp(argv[i],"-keepobj0") == 0) {
|
} else if (strcmp(argv[i],"-aliasobj0") == 0) {
|
||||||
keepobj0 = 1;
|
aliasobj0 = 1;
|
||||||
Swig_mark_arg(i);
|
Swig_mark_arg(i);
|
||||||
} else if (strcmp(argv[i],"-nokeepobj0") == 0) {
|
} else if (strcmp(argv[i],"-noaliasobj0") == 0) {
|
||||||
keepobj0 = 0;
|
aliasobj0 = 0;
|
||||||
Swig_mark_arg(i);
|
Swig_mark_arg(i);
|
||||||
} else if (strcmp(argv[i],"-proxydel") == 0) {
|
} else if (strcmp(argv[i],"-proxydel") == 0) {
|
||||||
proxydel = 1;
|
proxydel = 1;
|
||||||
|
|
@ -1475,13 +1475,13 @@ public:
|
||||||
/* Generate code for argument marshalling */
|
/* Generate code for argument marshalling */
|
||||||
if (funpack) {
|
if (funpack) {
|
||||||
if (overname) {
|
if (overname) {
|
||||||
if (keepobj0) {
|
if (aliasobj0) {
|
||||||
Printf(f->code, "#define obj0 (swig_obj[0])\n");
|
Printf(f->code, "#define obj0 (swig_obj[0])\n");
|
||||||
}
|
}
|
||||||
} else if (num_arguments) {
|
} else if (num_arguments) {
|
||||||
sprintf(source,"PyObject *swig_obj[%d]",num_arguments);
|
sprintf(source,"PyObject *swig_obj[%d]",num_arguments);
|
||||||
Wrapper_add_localv(f, "swig_obj", source, NIL);
|
Wrapper_add_localv(f, "swig_obj", source, NIL);
|
||||||
if (keepobj0) {
|
if (aliasobj0) {
|
||||||
Printf(f->code, "#define obj0 (swig_obj[0])\n");
|
Printf(f->code, "#define obj0 (swig_obj[0])\n");
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
@ -1850,7 +1850,7 @@ public:
|
||||||
|
|
||||||
|
|
||||||
if (funpack) {
|
if (funpack) {
|
||||||
if (keepobj0) {
|
if (aliasobj0) {
|
||||||
Printf(f->code, "#if defined(obj0)\n");
|
Printf(f->code, "#if defined(obj0)\n");
|
||||||
Printf(f->code, "#undef obj0\n");
|
Printf(f->code, "#undef obj0\n");
|
||||||
Printf(f->code, "#endif\n");
|
Printf(f->code, "#endif\n");
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue