Fix the recent %rename docs

The example I recently added about renaming didn't compile.  Here's the
fix.

There was also a use of the term "override" which should have been
changed to "replace".
This commit is contained in:
Corey Minyard 2022-01-28 08:24:37 -06:00 • committed by Olly Betts
commit 69f94723d2

View file

@ -1843,19 +1843,20 @@ all to `output' by specifying :</p>
</pre></div> </pre></div>
<p> <p>
A new <tt>%rename</tt> for the same name will override the current A new <tt>%rename</tt> for the same name will replace the current
name for all uses after it in the file, and setting the new name to <tt>%rename</tt> for all uses after it in the file, and setting the
"" will remove the rename. So, for instance, if you wanted to rename new name to "" will remove the rename. So, for instance, if you
some things in one file and not in another, you could do: wanted to rename some things in one file and not in another, you could
do:
</p> </p>
<div class="code"> <div class="code">
<pre> <pre>
%rename(print1) print %rename(print1) print;
%include "header1.h" //Anything "print" in here will become "print1" %include "header1.h" //Anything "print" in here will become "print1"
%rename(print2) print %rename(print2) print;
%include "header2.h" //Anything "print" in here will become "print2" %include "header2.h" //Anything "print" in here will become "print2"
%rename("") print %rename("") print;
%include "header3.h" //Anything "print" in here will remain "print" %include "header3.h" //Anything "print" in here will remain "print"
</pre> </pre>
</div> </div>