Remove long deprecated features

These features were all deprecated in 1.3.26 (October 9, 2005)
or before (many long before), so all more than 17 years and 3 new major
versions ago which seems more than enough time for users to have stopped
using them, especially as most emit a deprecation warning if used.
This commit is contained in:
Olly Betts 2023-05-13 09:07:57 +12:00
parent a43602cfc5
commit 736c052d7d
26 changed files with 46 additions and 377 deletions

View File

@ -95,12 +95,6 @@ or <tt>%noexception</tt> with no code. For example:
%exception; // Deletes any previously defined handler
</pre></div>
<p>
<b>Compatibility note:</b> Previous versions of SWIG used a special directive <tt>%except</tt>
for exception handling. That directive is deprecated--<tt>%exception</tt>
provides the same functionality, but is substantially more flexible.
</p>
<H3><a name="Customization_nn3">15.1.1 Handling exceptions in C code</a></H3>
@ -432,16 +426,6 @@ to attach exceptions to specific parts of a header file. For example:
</pre>
</div>
<p>
<b>Compatibility note:</b> The <tt>%exception</tt> directive replaces
the functionality provided by the deprecated "except" typemap.
The typemap would allow exceptions to be thrown in the target
language based on the return type of a function and
was intended to be a mechanism for pinpointing specific
declarations. However, it never really worked that well and the new
%exception directive is much better.
</p>
<H3><a name="Customization_exception_special_variables">15.1.6 Special variables for %exception</a></H3>
@ -727,36 +711,6 @@ The use of <tt>%newobject</tt> is also integrated with reference counting and is
<a href="SWIGPlus.html#SWIGPlus_ref_unref">C++ reference counted objects</a> section.
</p>
<p>
<b>Compatibility note:</b> Previous versions of SWIG had a special <tt>%new</tt> directive. However, unlike <tt>%newobject</tt>,
it only applied to the next declaration. For example:
</p>
<div class="code">
<pre>
%new char *strdup(const char *s);
</pre>
</div>
<p>
For now this is still supported but is deprecated.
</p>
<p>
<b>How to shoot yourself in the foot:</b> The <tt>%newobject</tt> directive is not a declaration modifier like the old
<tt>%new</tt> directive. Don't write code like this:
</p>
<div class="code">
<pre>
%newobject
char *strdup(const char *s);
</pre>
</div>
<p>
The results might not be what you expect.
</p>
<H2><a name="Customization_features">15.3 Features and the %feature directive</a></H2>

View File

@ -1729,28 +1729,6 @@ Since SWIG's exception handling is user-definable, you are not limited to C++ ex
See the chapter on "<a href="Customization.html#Customization">Customization features</a>" for more examples.
</p>
<p>
<b>Compatibility note:</b> In SWIG1.1, exceptions were defined using the older <tt>%except</tt> directive:
</p>
<div class="code">
<pre>
%except(perl5) {
try {
$function
}
catch (RangeError) {
croak("Array index out-of-bounds");
}
}
</pre>
</div>
<p>
This is still supported, but it is deprecated. The newer <tt>%exception</tt> directive provides the same
functionality, but it has additional capabilities that make it more powerful.
</p>
<H2><a name="Perl5_nn27">31.7 Remapping datatypes with typemaps</a></H2>

View File

@ -1781,13 +1781,6 @@ const int foo; /* Read only variable */
char * const version="1.0"; /* Read only variable */
</pre></div>
<p>
<b>Compatibility note:</b> Read-only access used to be controlled by a pair of directives
<tt>%readonly</tt> and <tt>%readwrite</tt>. Although these directives still work, they
generate a warning message. Simply change the directives to <tt>%immutable;</tt> and
<tt>%mutable;</tt> to silence the warning. Don't forget the extra semicolon!
</p>
<H3><a name="SWIG_rename_ignore">5.4.7 Renaming and ignoring declarations</a></H3>
@ -1905,22 +1898,6 @@ to add conditional compilation to the header. However, it should be stressed t
declarations. If you need to remove a whole section of problematic code, the SWIG preprocessor should be used instead.
</p>
<p>
<b>Compatibility note: </b> Older versions of SWIG provided a special <tt>%name</tt> directive for renaming declarations.
For example:
</p>
<div class="code">
<pre>
%name(output) extern void print(const char *);
</pre>
</div>
<p>
This directive is still supported, but it is deprecated and should probably be avoided. The <tt>%rename</tt>
directive is more powerful and better supports wrapping of raw header file information.
</p>
<H4><a name="SWIG_advanced_renaming">5.4.7.3 Advanced renaming support</a></H4>
@ -3227,13 +3204,6 @@ the allocation of additional storage in the object (e.g., their values must
be entirely synthesized from existing attributes of the structure or obtained elsewhere).
</p>
<p>
<b>Compatibility note:</b> The <tt>%extend</tt> directive is a new
name for the <tt>%addmethods</tt> directive. Since <tt>%addmethods</tt> could
be used to extend a structure with more than just methods, a more suitable
directive name has been chosen.
</p>
<H3><a name="SWIG_nested_structs">5.5.7 Nested structures</a></H3>

View File

@ -875,10 +875,12 @@ could be wrapped, but they had to be renamed. For example:
<div class="code">
<pre>
%rename(CopyFoo) Foo::Foo(const Foo &amp;);
class Foo {
public:
Foo();
%name(CopyFoo) Foo(const Foo &amp;);
Foo(const Foo &amp;);
...
};
</pre>
@ -1088,13 +1090,6 @@ However, any use of <tt>%feature("naturalvar")</tt> will override the global set
typemaps, eg <tt>%apply const std::string &amp; { std::string * }</tt>, but this example would also apply the typemaps to methods taking a <tt>std::string</tt> pointer.
</p>
<p>
<b>Compatibility note:</b> Read-only access used to be controlled by a pair of directives
<tt>%readonly</tt> and <tt>%readwrite</tt>. Although these directives still work, they
generate a warning message. Simply change the directives to <tt>%immutable;</tt> and
<tt>%mutable;</tt> to silence the warning. Don't forget the extra semicolon!
</p>
<p>
<b>Compatibility note:</b> Prior to SWIG-1.3.12, all members of unknown type were
wrapped into accessor functions using pointers. For example, if you had a structure
@ -2993,13 +2988,6 @@ as its use with C structures. Please refer to the <a href="SWIG.html#SWIG_adding
section for further details.
</p>
<p>
<b>Compatibility note:</b> The <tt>%extend</tt> directive is a new
name for the <tt>%addmethods</tt> directive in SWIG1.1. Since <tt>%addmethods</tt> could
be used to extend a structure with more than just methods, a more suitable
directive name has been chosen.
</p>
<H3><a name="SWIGPlus_replacing_methods">6.17.1 Replacing class methods</a></H3>

View File

@ -372,27 +372,6 @@ example.i(4) : Syntax error in input(1).
<ul>
<li>101. Deprecated <tt>%extern</tt> directive.
<li>102. Deprecated <tt>%val</tt> directive.
<li>103. Deprecated <tt>%out</tt> directive.
<li>104. Deprecated <tt>%disabledoc</tt> directive.
<li>105. Deprecated <tt>%enabledoc</tt> directive.
<li>106. Deprecated <tt>%doconly</tt> directive.
<li>107. Deprecated <tt>%style</tt> directive.
<li>108. Deprecated <tt>%localstyle</tt> directive.
<li>109. Deprecated <tt>%title</tt> directive.
<li>110. Deprecated <tt>%section</tt> directive.
<li>111. Deprecated <tt>%subsection</tt> directive.
<li>112. Deprecated <tt>%subsubsection</tt> directive.
<li>113. Deprecated <tt>%addmethods</tt> directive.
<li>114. Deprecated <tt>%readonly</tt> directive.
<li>115. Deprecated <tt>%readwrite</tt> directive.
<li>116. Deprecated <tt>%except</tt> directive.
<li>117. Deprecated <tt>%new</tt> directive.
<li>118. Deprecated <tt>%typemap(except)</tt>.
<li>119. Deprecated <tt>%typemap(ignore)</tt>.
<li>120. Deprecated command line option (-runtime, -noruntime).
<li>121. Deprecated <tt>%name</tt> directive.
<li>126. The 'nestedworkaround' feature is deprecated.
</ul>

View File

@ -1,4 +0,0 @@
%module xxx
%name() int foo;

View File

@ -1,2 +0,0 @@
c_bad_name.i:3: Warning 121: %name is deprecated. Use %rename instead.
c_bad_name.i:3: Error: Missing argument to %name directive.

View File

@ -1,8 +0,0 @@
%module xxx
int foo(%val int *x, %out int *y);

View File

@ -1,2 +0,0 @@
c_deprecated.i:3: Warning 102: %val directive deprecated (ignored).
c_deprecated.i:3: Warning 103: %out directive deprecated (ignored).

View File

@ -1,9 +0,0 @@
%module xxx
%extern ext;
#warning Print this warning
#error This is an error

View File

@ -1,4 +0,0 @@
pp_deprecated.i:4: Warning 101: %extern is deprecated. Use %import instead.
pp_deprecated.i:4: Error: Unable to find 'ext;'
pp_deprecated.i:6: Warning 204: CPP #warning, "Print this warning".
pp_deprecated.i:8: Error: CPP #error "This is an error". Use the -cpperraswarn option to continue swig processing.

View File

@ -1,28 +1,21 @@
/* This interface file tests whether SWIG/Guile handle the %rename and
%name directives, which was not the case in 1.3a5.
/* This interface file tests whether SWIG/Guile handle the %rename
directive, which was not the case in 1.3a5.
*/
%module name
#pragma SWIG nowarn=SWIGWARN_DEPRECATED_NAME // %name is deprecated. Use %rename instead.
#ifdef SWIGGUILE
%rename foo_1 "foo-2";
%rename bar_1 "bar-2";
#else
%rename foo_1 "foo_2";
%rename bar_1 "bar_2";
#endif
%rename Baz_1 "Baz_2";
%inline %{
void foo_1() {}
%}
#ifdef SWIGGUILE
%name("bar-2")
#else
%name("bar_2")
#endif
%inline %{
int bar_1 = 17;
%}
%name("Baz_2")
%constant int Baz_1 = 47;

View File

@ -1,23 +1,18 @@
/* This interface files tests whether SWIG handles overloaded
renamed functions.
renamed functions and inheriting from a renamed class.
*/
%module name_cxx
#pragma SWIG nowarn=SWIGWARN_DEPRECATED_NAME // %name is deprecated. Use %rename instead.
%rename bar(int) "bar_int";
%rename bar(double) "bar_double";
%rename A "AA";
%name("bar_int")
%inline %{
void bar(int i) {}
%}
%name("bar_double")
%inline %{
void bar(double i) {}
%}
// %name inheritance test
%{
// %rename inheritance test
class A {
};
@ -25,7 +20,3 @@ class B : public A {
};
%}
%name(AA) class A { };
class B : public A { };

View File

@ -9,20 +9,6 @@
* User Directives
* ----------------------------------------------------------------------------- */
/* Deprecated SWIG-1.1 directives */
#define %disabledoc %warn "104:%disabledoc is deprecated"
#define %enabledoc %warn "105:%enabledoc is deprecated"
#define %doconly %warn "106:%doconly is deprecated"
#define %style %warn "107:%style is deprecated" /##/
#define %localstyle %warn "108:%localstyle is deprecated" /##/
#define %title %warn "109:%title is deprecated" /##/
#define %section %warn "110:%section is deprecated" /##/
#define %subsection %warn "111:%subsection is deprecated" /##/
#define %subsubsection %warn "112:%subsubsection is deprecated" /##/
#define %new %warn "117:%new is deprecated. Use %newobject"
#define %text %insert("null")
/* Code insertion directives such as %wrapper %{ ... %} */
#define %begin %insert("begin")
@ -31,10 +17,6 @@
#define %wrapper %insert("wrapper")
#define %init %insert("init")
/* Class extension */
#define %addmethods %warn "113:%addmethods is now %extend" %extend
/* %ignore directive */
#define %ignore %rename($ignore)
@ -42,9 +24,6 @@
/* Access control directives */
#define %readonly %warn "114:%readonly is deprecated. Use %immutable; " %feature("immutable");
#define %readwrite %warn "115:%readwrite is deprecated. Use %mutable; " %feature("immutable","");
#define %immutable %feature("immutable")
#define %noimmutable %feature("immutable","0")
#define %clearimmutable %feature("immutable","")

View File

@ -989,8 +989,6 @@ num_common:
return (MODULE);
if (strcmp(yytext, "%insert") == 0)
return (INSERT);
if (strcmp(yytext, "%name") == 0)
return (NAME);
if (strcmp(yytext, "%rename") == 0) {
rename_active = 1;
return (RENAME);
@ -1005,14 +1003,6 @@ num_common:
return (BEGINFILE);
if (strcmp(yytext, "%endoffile") == 0)
return (ENDOFFILE);
if (strcmp(yytext, "%val") == 0) {
Swig_warning(WARN_DEPRECATED_VAL, cparse_file, cparse_line, "%%val directive deprecated (ignored).\n");
return (yylex());
}
if (strcmp(yytext, "%out") == 0) {
Swig_warning(WARN_DEPRECATED_OUT, cparse_file, cparse_line, "%%out directive deprecated (ignored).\n");
return (yylex());
}
if (strcmp(yytext, "%constant") == 0)
return (CONSTANT);
if (strcmp(yytext, "%typedef") == 0) {
@ -1039,8 +1029,6 @@ num_common:
rename_active = 1;
return (FEATURE);
}
if (strcmp(yytext, "%except") == 0)
return (EXCEPT);
if (strcmp(yytext, "%importfile") == 0)
return (IMPORT);
if (strcmp(yytext, "%echo") == 0)

View File

@ -1674,7 +1674,7 @@ static String *add_qualifier_to_declarator(SwigType *type, SwigType *qualifier)
%token CONST_QUAL VOLATILE REGISTER STRUCT UNION EQUAL SIZEOF MODULE LBRACKET RBRACKET
%token BEGINFILE ENDOFFILE
%token ILLEGAL CONSTANT
%token NAME RENAME NAMEWARN EXTEND PRAGMA FEATURE VARARGS
%token RENAME NAMEWARN EXTEND PRAGMA FEATURE VARARGS
%token ENUM
%token CLASS TYPENAME PRIVATE PUBLIC PROTECTED COLON STATIC VIRTUAL FRIEND THROW CATCH EXPLICIT
%token STATIC_ASSERT CONSTEXPR THREAD_LOCAL DECLTYPE AUTO NOEXCEPT /* C++11 keywords */
@ -1682,7 +1682,7 @@ static String *add_qualifier_to_declarator(SwigType *type, SwigType *qualifier)
%token USING
%token <node> NAMESPACE
%token NATIVE INLINE
%token TYPEMAP EXCEPT ECHO APPLY CLEAR SWIGTEMPLATE FRAGMENT
%token TYPEMAP ECHO APPLY CLEAR SWIGTEMPLATE FRAGMENT
%token WARN
%token LESSTHAN GREATERTHAN DELETE_KW DEFAULT
%token LESSTHANOREQUALTO GREATERTHANOREQUALTO EQUALTO NOTEQUALTO LESSEQUALGREATER
@ -1721,8 +1721,8 @@ static String *add_qualifier_to_declarator(SwigType *type, SwigType *qualifier)
/* SWIG directives */
%type <node> extend_directive apply_directive clear_directive constant_directive ;
%type <node> echo_directive except_directive fragment_directive include_directive inline_directive ;
%type <node> insert_directive module_directive name_directive native_directive ;
%type <node> echo_directive fragment_directive include_directive inline_directive ;
%type <node> insert_directive module_directive native_directive ;
%type <node> pragma_directive rename_directive feature_directive varargs_directive typemap_directive ;
%type <node> types_directive template_directive warn_directive ;
@ -1916,13 +1916,11 @@ swig_directive : extend_directive
| clear_directive
| constant_directive
| echo_directive
| except_directive
| fragment_directive
| include_directive
| inline_directive
| insert_directive
| module_directive
| name_directive
| native_directive
| pragma_directive
| rename_directive
@ -2148,36 +2146,6 @@ echo_directive : ECHO HBLOCK {
}
;
/* ------------------------------------------------------------
%except(lang) { ... }
%except { ... }
%except(lang);
%except;
------------------------------------------------------------ */
except_directive : EXCEPT LPAREN identifier RPAREN LBRACE {
Swig_warning(WARN_DEPRECATED_EXCEPT,cparse_file, cparse_line, "%%except is deprecated. Use %%exception instead.\n");
if (skip_balanced('{','}') < 0) Exit(EXIT_FAILURE);
$$ = 0;
}
| EXCEPT LBRACE {
Swig_warning(WARN_DEPRECATED_EXCEPT,cparse_file, cparse_line, "%%except is deprecated. Use %%exception instead.\n");
if (skip_balanced('{','}') < 0) Exit(EXIT_FAILURE);
$$ = 0;
}
| EXCEPT LPAREN identifier RPAREN SEMI {
$$ = 0;
Swig_warning(WARN_DEPRECATED_EXCEPT,cparse_file, cparse_line, "%%except is deprecated. Use %%exception instead.\n");
}
| EXCEPT SEMI {
$$ = 0;
Swig_warning(WARN_DEPRECATED_EXCEPT,cparse_file, cparse_line, "%%except is deprecated. Use %%exception instead.\n");
}
;
/* fragment keyword arguments */
stringtype : string LBRACE parm RBRACE {
$$ = NewHash();
@ -2428,25 +2396,6 @@ module_directive: MODULE options idstring {
}
;
/* ------------------------------------------------------------
%name(newname) declaration
%name("newname") declaration
------------------------------------------------------------ */
name_directive : NAME LPAREN idstring RPAREN {
Swig_warning(WARN_DEPRECATED_NAME,cparse_file,cparse_line, "%%name is deprecated. Use %%rename instead.\n");
Delete(yyrename);
yyrename = NewString($3);
$$ = 0;
}
| NAME LPAREN RPAREN {
Swig_warning(WARN_DEPRECATED_NAME,cparse_file,cparse_line, "%%name is deprecated. Use %%rename instead.\n");
$$ = 0;
Swig_error(cparse_file,cparse_line,"Missing argument to %%name directive.\n");
}
;
/* ------------------------------------------------------------
%native(scriptname) name;
%native(scriptname) type name (parms);
@ -5023,11 +4972,6 @@ cpp_swig_directive: pragma_directive
/* A constant (includes #defines) inside a class */
| constant_directive
/* This is the new style rename */
| name_directive
/* rename directive */
| rename_directive
| feature_directive
| varargs_directive

View File

@ -29,28 +29,28 @@
/* -- Deprecated features -- */
#define WARN_DEPRECATED_EXTERN 101
#define WARN_DEPRECATED_VAL 102
#define WARN_DEPRECATED_OUT 103
#define WARN_DEPRECATED_DISABLEDOC 104
#define WARN_DEPRECATED_ENABLEDOC 105
#define WARN_DEPRECATED_DOCONLY 106
#define WARN_DEPRECATED_STYLE 107
#define WARN_DEPRECATED_LOCALSTYLE 108
#define WARN_DEPRECATED_TITLE 109
#define WARN_DEPRECATED_SECTION 110
#define WARN_DEPRECATED_SUBSECTION 111
#define WARN_DEPRECATED_SUBSUBSECTION 112
#define WARN_DEPRECATED_ADDMETHODS 113
#define WARN_DEPRECATED_READONLY 114
#define WARN_DEPRECATED_READWRITE 115
#define WARN_DEPRECATED_EXCEPT 116
#define WARN_DEPRECATED_NEW 117
#define WARN_DEPRECATED_EXCEPT_TM 118
#define WARN_DEPRECATED_IGNORE_TM 119
#define WARN_DEPRECATED_OPTC 120
#define WARN_DEPRECATED_NAME 121
#define WARN_DEPRECATED_NOEXTERN 122
/* Unused since 4.2.0: #define WARN_DEPRECATED_EXTERN 101 */
/* Unused since 4.2.0: #define WARN_DEPRECATED_VAL 102 */
/* Unused since 4.2.0: #define WARN_DEPRECATED_OUT 103 */
/* Unused since 4.2.0: #define WARN_DEPRECATED_DISABLEDOC 104 */
/* Unused since 4.2.0: #define WARN_DEPRECATED_ENABLEDOC 105 */
/* Unused since 4.2.0: #define WARN_DEPRECATED_DOCONLY 106 */
/* Unused since 4.2.0: #define WARN_DEPRECATED_STYLE 107 */
/* Unused since 4.2.0: #define WARN_DEPRECATED_LOCALSTYLE 108 */
/* Unused since 4.2.0: #define WARN_DEPRECATED_TITLE 109 */
/* Unused since 4.2.0: #define WARN_DEPRECATED_SECTION 110 */
/* Unused since 4.2.0: #define WARN_DEPRECATED_SUBSECTION 111 */
/* Unused since 4.2.0: #define WARN_DEPRECATED_SUBSUBSECTION 112 */
/* Unused since 4.2.0: #define WARN_DEPRECATED_ADDMETHODS 113 */
/* Unused since 4.2.0: #define WARN_DEPRECATED_READONLY 114 */
/* Unused since 4.2.0: #define WARN_DEPRECATED_READWRITE 115 */
/* Unused since 4.2.0: #define WARN_DEPRECATED_EXCEPT 116 */
/* Unused since 4.2.0: #define WARN_DEPRECATED_NEW 117 */
/* Unused since 4.2.0: #define WARN_DEPRECATED_EXCEPT_TM 118 */
/* Unused since 4.2.0: #define WARN_DEPRECATED_IGNORE_TM 119 */
/* Unused since 4.2.0: #define WARN_DEPRECATED_OPTC 120 */
/* Unused since 4.2.0: #define WARN_DEPRECATED_NAME 121 */
/* Unused since 4.2.0: #define WARN_DEPRECATED_NOEXTERN 122 */
#define WARN_DEPRECATED_NODEFAULT 123
/* Unused since 4.1.0: #define WARN_DEPRECATED_TYPEMAP_LANG 124 */
#define WARN_DEPRECATED_INPUT_FILE 125

View File

@ -137,14 +137,6 @@ void emit_attach_parmmaps(ParmList *l, Wrapper *f) {
while (p) {
npin = Getattr(p, "tmap:in:next");
/*
if (Getattr(p,"tmap:ignore")) {
npin = Getattr(p,"tmap:ignore:next");
} else if (Getattr(p,"tmap:in")) {
npin = Getattr(p,"tmap:in:next");
}
*/
if (Getattr(p, "tmap:freearg")) {
npfreearg = Getattr(p, "tmap:freearg:next");
if (npin != npfreearg) {

View File

@ -741,7 +741,7 @@ Doc/Manual/Typemaps.html for complete details.\n");
}
if (Strcmp(method, "except") == 0) {
Swig_warning(WARN_DEPRECATED_EXCEPT_TM, Getfile(n), Getline(n), "%%typemap(except) is deprecated. Use the %%exception directive.\n");
Swig_error(Getfile(n), Getline(n), "%%typemap(except) is no longer supported. Use the %%exception directive.\n");
}
if (Strcmp(method, "in") == 0) {
@ -768,16 +768,7 @@ Doc/Manual/Typemaps.html for complete details.\n");
}
if (Strcmp(method, "ignore") == 0) {
Swig_warning(WARN_DEPRECATED_IGNORE_TM, Getfile(n), Getline(n), "%%typemap(ignore) has been replaced by %%typemap(in,numinputs=0).\n");
Clear(method);
Append(method, "in");
Hash *k = NewHash();
Setattr(k, "name", "numinputs");
Setattr(k, "value", "0");
set_nextSibling(k, kwargs);
Setattr(n, "kwargs", k);
kwargs = k;
Swig_error(Getfile(n), Getline(n), "%%typemap(ignore) is no longer supported. Use %%typemap(in,numinputs=0).\n");
}
/* Replace $descriptor() macros */
@ -2691,7 +2682,7 @@ int Language::constructorDeclaration(Node *n) {
return SWIG_NOWRAP;
}
/* Name adjustment for %name */
/* Name adjustment for %rename */
Swig_save("constructorDeclaration", n, "sym:name", NIL);
{

View File

@ -36,7 +36,6 @@ int GenerateDefault = 1; // Generate default constructors
int Verbose = 0;
int AddExtern = 0;
int NoExcept = 0;
int SwigRuntime = 0; // 0 = no option, 1 = -runtime, 2 = -noruntime
extern "C" {
int UseWrapperSuffix = 0; // If 1, append suffix to non-overloaded functions too.
}
@ -503,14 +502,6 @@ static void getoptions(int argc, char *argv[]) {
Wrapper_compact_print_mode_set(1);
Wrapper_virtual_elimination_mode_set(1);
Swig_mark_arg(i);
} else if (strcmp(argv[i], "-runtime") == 0) { // Used to also accept -c. removed in swig-1.3.36
Swig_mark_arg(i);
Swig_warning(WARN_DEPRECATED_OPTC, "SWIG", 1, "-runtime, -noruntime command line options are deprecated.\n");
SwigRuntime = 1;
} else if (strcmp(argv[i], "-noruntime") == 0) {
Swig_mark_arg(i);
Swig_warning(WARN_DEPRECATED_OPTC, "SWIG", 1, "-runtime, -noruntime command line options are deprecated.\n");
SwigRuntime = 2;
} else if (strcmp(argv[i], "-external-runtime") == 0) {
external_runtime = 1;
Swig_mark_arg(i);
@ -538,10 +529,6 @@ static void getoptions(int argc, char *argv[]) {
} else if (strcmp(argv[i], "-noexcept") == 0) {
NoExcept = 1;
Swig_mark_arg(i);
} else if (strcmp(argv[i], "-noextern") == 0) {
Swig_warning(WARN_DEPRECATED_NOEXTERN, "SWIG", 1, "-noextern command line option is deprecated; extern is no longer generated by default.\n");
AddExtern = 0;
Swig_mark_arg(i);
} else if (strcmp(argv[i], "-addextern") == 0) {
AddExtern = 1;
Swig_mark_arg(i);

View File

@ -1492,11 +1492,6 @@ public:
/* build argument list and type conversion string */
for (i = 0, idx = 0, p = l; i < num_arguments; i++) {
while (Getattr(p, "tmap:ignore")) {
p = Getattr(p, "tmap:ignore:next");
}
String *pname = Getattr(p, "name");
String *ptype = Getattr(p, "type");

View File

@ -2182,14 +2182,6 @@ public:
continue;
}
/* old style? caused segfaults without the p!=0 check
in the for() condition, and seems dangerous in the
while loop as well.
while (Getattr(p, "tmap:ignore")) {
p = Getattr(p, "tmap:ignore:next");
}
*/
if (Getattr(p, "tmap:directorargout") != 0)
outputs++;

View File

@ -5441,14 +5441,6 @@ int PYTHON::classDirectorMethod(Node *n, Node *parent, String *super) {
continue;
}
/* old style? caused segfaults without the p!=0 check
in the for() condition, and seems dangerous in the
while loop as well.
while (Getattr(p, "tmap:ignore")) {
p = Getattr(p, "tmap:ignore:next");
}
*/
if (Getattr(p, "tmap:directorargout") != 0)
outputs++;

View File

@ -1938,7 +1938,7 @@ public:
}
/* Look for any remaining cleanup. This processes the %new directive */
/* Look for any remaining cleanup. This processes the %newobject directive */
if (current != CONSTRUCTOR_ALLOCATE && GetFlag(n, "feature:new")) {
tm = Swig_typemap_lookup("newfree", n, Swig_cresult_name(), 0);
if (tm) {
@ -3159,12 +3159,6 @@ public:
/* build argument list and type conversion string */
idx = 0; p = l;
while ( p ) {
if (Getattr(p, "tmap:ignore")) {
p = Getattr(p, "tmap:ignore:next");
continue;
}
if (Getattr(p, "tmap:directorargout") != 0)
outputs++;

View File

@ -33,7 +33,6 @@ extern int ImportMode;
extern int NoExcept; // -no_except option
extern int Abstract; // abstract base class
extern int SmartPointer; // smart pointer methods being emitted
extern int SwigRuntime;
/* Overload "argc" and "argv" */
extern String *argv_template_string;

View File

@ -11,7 +11,7 @@
* An implementation of a C preprocessor plus some support for additional
* SWIG directives.
*
* - SWIG directives such as %include, %extern, and %import are handled
* - SWIG directives such as %include and %import are handled
* - A new macro %define ... %enddef can be used for multiline macros
* - No preprocessing is performed in %{ ... %} blocks
* - Lines beginning with %# are stripped down to #... and passed through.
@ -157,7 +157,6 @@ static String *kpp_ddefine = 0;
static String *kpp_dinclude = 0;
static String *kpp_dimport = 0;
static String *kpp_dbeginfile = 0;
static String *kpp_dextern = 0;
static String *kpp_LINE = 0;
static String *kpp_FILE = 0;
@ -194,7 +193,6 @@ void Preprocessor_init(void) {
kpp_dinclude = NewString("%include");
kpp_dimport = NewString("%import");
kpp_dbeginfile = NewString("%beginfile");
kpp_dextern = NewString("%extern");
kpp_ddefine = NewString("%define");
kpp_dline = NewString("%line");
@ -243,7 +241,6 @@ void Preprocessor_delete(void) {
Delete(kpp_dinclude);
Delete(kpp_dimport);
Delete(kpp_dbeginfile);
Delete(kpp_dextern);
Delete(kpp_ddefine);
Delete(kpp_dline);
@ -1972,7 +1969,7 @@ state1:
if (!isidchar(c)) {
Ungetc(c, s);
/* Look for common SWIG directives */
if (Equal(decl, kpp_dinclude) || Equal(decl, kpp_dimport) || Equal(decl, kpp_dextern)) {
if (Equal(decl, kpp_dinclude) || Equal(decl, kpp_dimport)) {
/* Got some kind of file inclusion directive, eg: %import(option1="value1") "filename" */
if (allow) {
DOH *s1, *s2, *fn, *opt;
@ -1980,11 +1977,6 @@ state1:
String *filename_whitespace = NewStringEmpty();
int sysfile = 0;
if (Equal(decl, kpp_dextern)) {
Swig_warning(WARN_DEPRECATED_EXTERN, Getfile(s), Getline(s), "%%extern is deprecated. Use %%import instead.\n");
Clear(decl);
Append(decl, "%%import");
}
skip_whitespace(s, options_whitespace);
opt = get_options(s);