Remove using directives from the generated C# code and fully qualify the use of all .NET framework types in order to minimize potential name collisions from input files defining types, namespace, etc with the same name as .NET framework members.
This commit is contained in:
parent
cb2df12630
commit
adb93980f2
14 changed files with 200 additions and 211 deletions
|
|
@ -116,7 +116,7 @@ struct PrePost3 {
|
|||
// Check attributes in the typemaps
|
||||
%typemap(cstype, inattributes="[CustomInt]") int val "int"
|
||||
%typemap(csin, pre=" int tmp_$csinput = $csinput * 100;") int val "tmp_$csinput"
|
||||
%typemap(imtype, out="IntPtr/*overridden*/", outattributes="[CustomIntPtr]") CsinAttributes * "HandleRef/*overridden*/"
|
||||
%typemap(imtype, out="global::System.IntPtr/*overridden*/", outattributes="[CustomIntPtr]") CsinAttributes * "global::System.Runtime.InteropServices.HandleRef/*overridden*/"
|
||||
|
||||
%inline %{
|
||||
class CsinAttributes {
|
||||
|
|
@ -216,8 +216,8 @@ void subtractYears(CDate *pDate, int years) {
|
|||
%typemap(csvarout, excode=SWIGEXCODE2) CDate * %{
|
||||
/* csvarout typemap code */
|
||||
get {
|
||||
IntPtr cPtr = $imcall;
|
||||
CDate tempDate = (cPtr == IntPtr.Zero) ? null : new CDate(cPtr, $owner);$excode
|
||||
global::System.IntPtr cPtr = $imcall;
|
||||
CDate tempDate = (cPtr == global::System.IntPtr.Zero) ? null : new CDate(cPtr, $owner);$excode
|
||||
return new System.DateTime(tempDate.getYear(), tempDate.getMonth(), tempDate.getDay(),
|
||||
0, 0, 0);
|
||||
} %}
|
||||
|
|
|
|||
|
|
@ -94,7 +94,7 @@ Number times12(const Number* num) {
|
|||
%typemap(csvarin, excode=SWIGEXCODE2) int %{
|
||||
set {
|
||||
if ($csinput < 0)
|
||||
throw new ApplicationException("number too small!");
|
||||
throw new global::System.ApplicationException("number too small!");
|
||||
$imcall;$excode
|
||||
} %}
|
||||
|
||||
|
|
|
|||
|
|
@ -188,7 +188,7 @@ namespace Space {
|
|||
|
||||
#if defined(SWIGCSHARP)
|
||||
%typemap(cscode) Space::RenameMe %{
|
||||
public static NewName factory(String s) {
|
||||
public static NewName factory(System.String s) {
|
||||
//below should expand to:
|
||||
//return new NewName( new Name(s) );
|
||||
return new $typemap(cstype, Space::RenameMe)( new $typemap(cstype, Name)(s) );
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue