Permalink
Browse files

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.
  • Loading branch information...
1 parent cb2df12 commit adb93980f2decad8a2ab8bb2a462e66c4be51b4d @BrantKyser BrantKyser committed Oct 17, 2013
@@ -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) );
View
@@ -57,7 +57,7 @@
%typemap(ctype) CTYPE INPUT[] "CTYPE*"
%typemap(cstype) CTYPE INPUT[] "CSTYPE[]"
-%typemap(imtype, inattributes="[In, MarshalAs(UnmanagedType.LPArray)]") CTYPE INPUT[] "CSTYPE[]"
+%typemap(imtype, inattributes="[global::System.Runtime.InteropServices.In, global::System.Runtime.InteropServices.MarshalAs(global::System.Runtime.InteropServices.UnmanagedType.LPArray)]") CTYPE INPUT[] "CSTYPE[]"
%typemap(csin) CTYPE INPUT[] "$csinput"
%typemap(in) CTYPE INPUT[] "$1 = $input;"
@@ -68,7 +68,7 @@
%typemap(ctype) CTYPE OUTPUT[] "CTYPE*"
%typemap(cstype) CTYPE OUTPUT[] "CSTYPE[]"
-%typemap(imtype, inattributes="[Out, MarshalAs(UnmanagedType.LPArray)]") CTYPE OUTPUT[] "CSTYPE[]"
+%typemap(imtype, inattributes="[global::System.Runtime.InteropServices.Out, global::System.Runtime.InteropServices.MarshalAs(global::System.Runtime.InteropServices.UnmanagedType.LPArray)]") CTYPE OUTPUT[] "CSTYPE[]"
%typemap(csin) CTYPE OUTPUT[] "$csinput"
%typemap(in) CTYPE OUTPUT[] "$1 = $input;"
@@ -79,7 +79,7 @@
%typemap(ctype) CTYPE INOUT[] "CTYPE*"
%typemap(cstype) CTYPE INOUT[] "CSTYPE[]"
-%typemap(imtype, inattributes="[In, Out, MarshalAs(UnmanagedType.LPArray)]") CTYPE INOUT[] "CSTYPE[]"
+%typemap(imtype, inattributes="[global::System.Runtime.InteropServices.In, global::System.Runtime.InteropServices.Out, global::System.Runtime.InteropServices.MarshalAs(global::System.Runtime.InteropServices.UnmanagedType.LPArray)]") CTYPE INOUT[] "CSTYPE[]"
%typemap(csin) CTYPE INOUT[] "$csinput"
%typemap(in) CTYPE INOUT[] "$1 = $input;"
@@ -108,12 +108,12 @@ CSHARP_ARRAYS(double, double)
%define CSHARP_ARRAYS_FIXED( CTYPE, CSTYPE )
%typemap(ctype) CTYPE FIXED[] "CTYPE*"
-%typemap(imtype) CTYPE FIXED[] "IntPtr"
+%typemap(imtype) CTYPE FIXED[] "global::System.IntPtr"
%typemap(cstype) CTYPE FIXED[] "CSTYPE[]"
%typemap(csin,
pre= " fixed ( CSTYPE* swig_ptrTo_$csinput = $csinput ) {",
terminator=" }")
- CTYPE FIXED[] "(IntPtr)swig_ptrTo_$csinput"
+ CTYPE FIXED[] "(global::System.IntPtr)swig_ptrTo_$csinput"
%typemap(in) CTYPE FIXED[] "$1 = $input;"
%typemap(freearg) CTYPE FIXED[] ""
@@ -207,11 +207,11 @@
SWIG_INTRUSIVE_PTR_QNAMESPACE::intrusive_ptr< CONST TYPE > &,
SWIG_INTRUSIVE_PTR_QNAMESPACE::intrusive_ptr< CONST TYPE > *,
SWIG_INTRUSIVE_PTR_QNAMESPACE::intrusive_ptr< CONST TYPE > *& "void *"
-%typemap (imtype, out="IntPtr") SWIG_INTRUSIVE_PTR_QNAMESPACE::intrusive_ptr< CONST TYPE >,
+%typemap (imtype, out="global::System.IntPtr") SWIG_INTRUSIVE_PTR_QNAMESPACE::intrusive_ptr< CONST TYPE >,
SWIG_SHARED_PTR_QNAMESPACE::shared_ptr< CONST TYPE >,
SWIG_INTRUSIVE_PTR_QNAMESPACE::intrusive_ptr< CONST TYPE > &,
SWIG_INTRUSIVE_PTR_QNAMESPACE::intrusive_ptr< CONST TYPE > *,
- SWIG_INTRUSIVE_PTR_QNAMESPACE::intrusive_ptr< CONST TYPE > *& "HandleRef"
+ SWIG_INTRUSIVE_PTR_QNAMESPACE::intrusive_ptr< CONST TYPE > *& "global::System.Runtime.InteropServices.HandleRef"
%typemap (cstype) SWIG_INTRUSIVE_PTR_QNAMESPACE::intrusive_ptr< CONST TYPE >,
SWIG_SHARED_PTR_QNAMESPACE::shared_ptr< CONST TYPE >,
SWIG_INTRUSIVE_PTR_QNAMESPACE::intrusive_ptr< CONST TYPE > &,
@@ -224,28 +224,28 @@
SWIG_INTRUSIVE_PTR_QNAMESPACE::intrusive_ptr< CONST TYPE > *& "$typemap(cstype, TYPE).getCPtr($csinput)"
%typemap(csout, excode=SWIGEXCODE) SWIG_INTRUSIVE_PTR_QNAMESPACE::intrusive_ptr< CONST TYPE > {
- IntPtr cPtr = $imcall;
- $typemap(cstype, TYPE) ret = (cPtr == IntPtr.Zero) ? null : new $typemap(cstype, TYPE)(cPtr, true);$excode
+ global::System.IntPtr cPtr = $imcall;
+ $typemap(cstype, TYPE) ret = (cPtr == global::System.IntPtr.Zero) ? null : new $typemap(cstype, TYPE)(cPtr, true);$excode
return ret;
}
%typemap(csout, excode=SWIGEXCODE) SWIG_SHARED_PTR_QNAMESPACE::shared_ptr< CONST TYPE > {
- IntPtr cPtr = $imcall;
- $typemap(cstype, TYPE) ret = (cPtr == IntPtr.Zero) ? null : new $typemap(cstype, TYPE)(cPtr, true);$excode
+ global::System.IntPtr cPtr = $imcall;
+ $typemap(cstype, TYPE) ret = (cPtr == global::System.IntPtr.Zero) ? null : new $typemap(cstype, TYPE)(cPtr, true);$excode
return ret;
}
%typemap(csout, excode=SWIGEXCODE) SWIG_INTRUSIVE_PTR_QNAMESPACE::intrusive_ptr< CONST TYPE > & {
- IntPtr cPtr = $imcall;
- $typemap(cstype, TYPE) ret = (cPtr == IntPtr.Zero) ? null : new $typemap(cstype, TYPE)(cPtr, true);$excode
+ global::System.IntPtr cPtr = $imcall;
+ $typemap(cstype, TYPE) ret = (cPtr == global::System.IntPtr.Zero) ? null : new $typemap(cstype, TYPE)(cPtr, true);$excode
return ret;
}
%typemap(csout, excode=SWIGEXCODE) SWIG_INTRUSIVE_PTR_QNAMESPACE::intrusive_ptr< CONST TYPE > * {
- IntPtr cPtr = $imcall;
- $typemap(cstype, TYPE) ret = (cPtr == IntPtr.Zero) ? null : new $typemap(cstype, TYPE)(cPtr, true);$excode
+ global::System.IntPtr cPtr = $imcall;
+ $typemap(cstype, TYPE) ret = (cPtr == global::System.IntPtr.Zero) ? null : new $typemap(cstype, TYPE)(cPtr, true);$excode
return ret;
}
%typemap(csout, excode=SWIGEXCODE) SWIG_INTRUSIVE_PTR_QNAMESPACE::intrusive_ptr< CONST TYPE > *& {
- IntPtr cPtr = $imcall;
- $typemap(cstype, TYPE) ret = (cPtr == IntPtr.Zero) ? null : new $typemap(cstype, TYPE)(cPtr, true);$excode
+ global::System.IntPtr cPtr = $imcall;
+ $typemap(cstype, TYPE) ret = (cPtr == global::System.IntPtr.Zero) ? null : new $typemap(cstype, TYPE)(cPtr, true);$excode
return ret;
}
%typemap(csvarout, excode=SWIGEXCODE2) SWIG_INTRUSIVE_PTR_QNAMESPACE::intrusive_ptr< CONST TYPE > %{
@@ -274,76 +274,76 @@
return ret;
}
%typemap(csout, excode=SWIGEXCODE) CONST TYPE * {
- IntPtr cPtr = $imcall;
- $typemap(cstype, TYPE) ret = (cPtr == IntPtr.Zero) ? null : new $typemap(cstype, TYPE)(cPtr, true);$excode
+ global::System.IntPtr cPtr = $imcall;
+ $typemap(cstype, TYPE) ret = (cPtr == global::System.IntPtr.Zero) ? null : new $typemap(cstype, TYPE)(cPtr, true);$excode
return ret;
}
%typemap(csout, excode=SWIGEXCODE) TYPE *CONST& {
- IntPtr cPtr = $imcall;
- $typemap(cstype, TYPE) ret = (cPtr == IntPtr.Zero) ? null : new $typemap(cstype, TYPE)(cPtr, true);$excode
+ global::System.IntPtr cPtr = $imcall;
+ $typemap(cstype, TYPE) ret = (cPtr == global::System.IntPtr.Zero) ? null : new $typemap(cstype, TYPE)(cPtr, true);$excode
return ret;
}
// Base proxy classes
%typemap(csbody) TYPE %{
- private HandleRef swigCPtr;
+ private global::System.Runtime.InteropServices.HandleRef swigCPtr;
private bool swigCMemOwnBase;
- PTRCTOR_VISIBILITY $csclassname(IntPtr cPtr, bool cMemoryOwn) {
+ PTRCTOR_VISIBILITY $csclassname(global::System.IntPtr cPtr, bool cMemoryOwn) {
swigCMemOwnBase = cMemoryOwn;
- swigCPtr = new HandleRef(this, cPtr);
+ swigCPtr = new global::System.Runtime.InteropServices.HandleRef(this, cPtr);
}
- CPTR_VISIBILITY static HandleRef getCPtr($csclassname obj) {
- return (obj == null) ? new HandleRef(null, IntPtr.Zero) : obj.swigCPtr;
+ CPTR_VISIBILITY static global::System.Runtime.InteropServices.HandleRef getCPtr($csclassname obj) {
+ return (obj == null) ? new global::System.Runtime.InteropServices.HandleRef(null, global::System.IntPtr.Zero) : obj.swigCPtr;
}
%}
// Derived proxy classes
%typemap(csbody_derived) TYPE %{
- private HandleRef swigCPtr;
+ private global::System.Runtime.InteropServices.HandleRef swigCPtr;
private bool swigCMemOwnDerived;
- PTRCTOR_VISIBILITY $csclassname(IntPtr cPtr, bool cMemoryOwn) : base($imclassname.$csclazznameSWIGSmartPtrUpcast(cPtr), true) {
+ PTRCTOR_VISIBILITY $csclassname(global::System.IntPtr cPtr, bool cMemoryOwn) : base($imclassname.$csclazznameSWIGSmartPtrUpcast(cPtr), true) {
swigCMemOwnDerived = cMemoryOwn;
- swigCPtr = new HandleRef(this, cPtr);
+ swigCPtr = new global::System.Runtime.InteropServices.HandleRef(this, cPtr);
}
- CPTR_VISIBILITY static HandleRef getCPtr($csclassname obj) {
- return (obj == null) ? new HandleRef(null, IntPtr.Zero) : obj.swigCPtr;
+ CPTR_VISIBILITY static global::System.Runtime.InteropServices.HandleRef getCPtr($csclassname obj) {
+ return (obj == null) ? new global::System.Runtime.InteropServices.HandleRef(null, global::System.IntPtr.Zero) : obj.swigCPtr;
}
%}
%typemap(csdestruct, methodname="Dispose", methodmodifiers="public") TYPE {
lock(this) {
- if (swigCPtr.Handle != IntPtr.Zero) {
+ if (swigCPtr.Handle != global::System.IntPtr.Zero) {
if (swigCMemOwnBase) {
swigCMemOwnBase = false;
$imcall;
}
- swigCPtr = new HandleRef(null, IntPtr.Zero);
+ swigCPtr = new global::System.Runtime.InteropServices.HandleRef(null, global::System.IntPtr.Zero);
}
- GC.SuppressFinalize(this);
+ global::System.GC.SuppressFinalize(this);
}
}
%typemap(csdestruct_derived, methodname="Dispose", methodmodifiers="public") TYPE {
lock(this) {
- if (swigCPtr.Handle != IntPtr.Zero) {
+ if (swigCPtr.Handle != global::System.IntPtr.Zero) {
if (swigCMemOwnDerived) {
swigCMemOwnDerived = false;
$imcall;
}
- swigCPtr = new HandleRef(null, IntPtr.Zero);
+ swigCPtr = new global::System.Runtime.InteropServices.HandleRef(null, global::System.IntPtr.Zero);
}
- GC.SuppressFinalize(this);
+ global::System.GC.SuppressFinalize(this);
base.Dispose();
}
}
// CONST version needed ???? also for C#
-%typemap(imtype, nopgcpp="1") SWIG_SHARED_PTR_QNAMESPACE::shared_ptr< TYPE > swigSharedPtrUpcast "HandleRef"
-%typemap(imtype, nopgcpp="1") SWIG_SHARED_PTR_QNAMESPACE::shared_ptr< CONST TYPE > swigSharedPtrUpcast "HandleRef"
+%typemap(imtype, nopgcpp="1") SWIG_SHARED_PTR_QNAMESPACE::shared_ptr< TYPE > swigSharedPtrUpcast "global::System.Runtime.InteropServices.HandleRef"
+%typemap(imtype, nopgcpp="1") SWIG_SHARED_PTR_QNAMESPACE::shared_ptr< CONST TYPE > swigSharedPtrUpcast "global::System.Runtime.InteropServices.HandleRef"
%template() SWIG_SHARED_PTR_QNAMESPACE::shared_ptr< CONST TYPE >;
@@ -424,8 +424,8 @@
%typemap (cstype) SWIG_SHARED_PTR_QNAMESPACE::shared_ptr< CONST TYPE > "$typemap(cstype, TYPE)"
%typemap (csin) SWIG_SHARED_PTR_QNAMESPACE::shared_ptr< CONST TYPE > "$typemap(cstype, TYPE).getCPtr($csinput)"
%typemap(csout, excode=SWIGEXCODE) SWIG_SHARED_PTR_QNAMESPACE::shared_ptr< CONST TYPE > {
- IntPtr cPtr = $imcall;
- return (cPtr == IntPtr.Zero) ? null : new $typemap(cstype, TYPE)(cPtr, true);
+ global::System.IntPtr cPtr = $imcall;
+ return (cPtr == global::System.IntPtr.Zero) ? null : new $typemap(cstype, TYPE)(cPtr, true);
}
%typemap(csout, excode=SWIGEXCODE) CONST TYPE {
@@ -435,75 +435,75 @@
return new $typemap(cstype, TYPE)($imcall, true);
}
%typemap(csout, excode=SWIGEXCODE) CONST TYPE * {
- IntPtr cPtr = $imcall;
- return (cPtr == IntPtr.Zero) ? null : new $typemap(cstype, TYPE)(cPtr, true);
+ global::System.IntPtr cPtr = $imcall;
+ return (cPtr == global::System.IntPtr.Zero) ? null : new $typemap(cstype, TYPE)(cPtr, true);
}
%typemap(csout, excode=SWIGEXCODE) TYPE *CONST& {
- IntPtr cPtr = $imcall;
- return (cPtr == IntPtr.Zero) ? null : new $typemap(cstype, TYPE)(cPtr, true);
+ global::System.IntPtr cPtr = $imcall;
+ return (cPtr == global::System.IntPtr.Zero) ? null : new $typemap(cstype, TYPE)(cPtr, true);
}
// Base proxy classes
%typemap(csbody) TYPE %{
- private HandleRef swigCPtr;
+ private global::System.Runtime.InteropServices.HandleRef swigCPtr;
private bool swigCMemOwnBase;
- PTRCTOR_VISIBILITY $csclassname(IntPtr cPtr, bool cMemoryOwn) {
+ PTRCTOR_VISIBILITY $csclassname(global::System.IntPtr cPtr, bool cMemoryOwn) {
swigCMemOwnBase = cMemoryOwn;
- swigCPtr = new HandleRef(this, cPtr);
+ swigCPtr = new global::System.Runtime.InteropServices.HandleRef(this, cPtr);
}
- CPTR_VISIBILITY static HandleRef getCPtr($csclassname obj) {
- return (obj == null) ? new HandleRef(null, IntPtr.Zero) : obj.swigCPtr;
+ CPTR_VISIBILITY static global::System.Runtime.InteropServices.HandleRef getCPtr($csclassname obj) {
+ return (obj == null) ? new global::System.Runtime.InteropServices.HandleRef(null, global::System.IntPtr.Zero) : obj.swigCPtr;
}
%}
// Derived proxy classes
%typemap(csbody_derived) TYPE %{
- private HandleRef swigCPtr;
+ private global::System.Runtime.InteropServices.HandleRef swigCPtr;
private bool swigCMemOwnDerived;
- PTRCTOR_VISIBILITY $csclassname(IntPtr cPtr, bool cMemoryOwn) : base($imclassname.$csclazznameSWIGSmartPtrUpcast(cPtr), true) {
+ PTRCTOR_VISIBILITY $csclassname(global::System.IntPtr cPtr, bool cMemoryOwn) : base($imclassname.$csclazznameSWIGSmartPtrUpcast(cPtr), true) {
swigCMemOwnDerived = cMemoryOwn;
- swigCPtr = new HandleRef(this, cPtr);
+ swigCPtr = new global::System.Runtime.InteropServices.HandleRef(this, cPtr);
}
- CPTR_VISIBILITY static HandleRef getCPtr($csclassname obj) {
- return (obj == null) ? new HandleRef(null, IntPtr.Zero) : obj.swigCPtr;
+ CPTR_VISIBILITY static global::System.Runtime.InteropServices.HandleRef getCPtr($csclassname obj) {
+ return (obj == null) ? new global::System.Runtime.InteropServices.HandleRef(null, global::System.IntPtr.Zero) : obj.swigCPtr;
}
%}
%typemap(csdestruct, methodname="Dispose", methodmodifiers="public") TYPE {
lock(this) {
- if (swigCPtr.Handle != IntPtr.Zero) {
+ if (swigCPtr.Handle != global::System.IntPtr.Zero) {
if (swigCMemOwnBase) {
swigCMemOwnBase = false;
$imcall;
}
- swigCPtr = new HandleRef(null, IntPtr.Zero);
+ swigCPtr = new global::System.Runtime.InteropServices.HandleRef(null, global::System.IntPtr.Zero);
}
- GC.SuppressFinalize(this);
+ global::System.GC.SuppressFinalize(this);
}
}
%typemap(csdestruct_derived, methodname="Dispose", methodmodifiers="public") TYPE {
lock(this) {
- if (swigCPtr.Handle != IntPtr.Zero) {
+ if (swigCPtr.Handle != global::System.IntPtr.Zero) {
if (swigCMemOwnDerived) {
swigCMemOwnDerived = false;
$imcall;
}
- swigCPtr = new HandleRef(null, IntPtr.Zero);
+ swigCPtr = new global::System.Runtime.InteropServices.HandleRef(null, global::System.IntPtr.Zero);
}
- GC.SuppressFinalize(this);
+ global::System.GC.SuppressFinalize(this);
base.Dispose();
}
}
// CONST version needed ???? also for C#
-%typemap(imtype, nopgcpp="1") SWIG_SHARED_PTR_QNAMESPACE::shared_ptr< TYPE > swigSharedPtrUpcast "HandleRef"
-%typemap(imtype, nopgcpp="1") SWIG_SHARED_PTR_QNAMESPACE::shared_ptr< CONST TYPE > swigSharedPtrUpcast "HandleRef"
+%typemap(imtype, nopgcpp="1") SWIG_SHARED_PTR_QNAMESPACE::shared_ptr< TYPE > swigSharedPtrUpcast "global::System.Runtime.InteropServices.HandleRef"
+%typemap(imtype, nopgcpp="1") SWIG_SHARED_PTR_QNAMESPACE::shared_ptr< CONST TYPE > swigSharedPtrUpcast "global::System.Runtime.InteropServices.HandleRef"
%template() SWIG_SHARED_PTR_QNAMESPACE::shared_ptr< CONST TYPE >;
Oops, something went wrong.

0 comments on commit adb9398

Please sign in to comment.