diff options
author | Brant K. Kyser <brantkyser@gmail.com> | 2013-10-17 13:58:32 -0500 |
---|---|---|
committer | Brant K. Kyser <brantkyser@gmail.com> | 2013-10-17 13:58:32 -0500 |
commit | cb2df12630874dd9b11fac8805e3169691305ee0 (patch) | |
tree | 01fa00cdad2942b43f718c8f5d758f1915b6f294 /Lib | |
parent | 3235570619cf3c35a5fba24e32c09fedda5600ea (diff) | |
download | swig-cb2df12630874dd9b11fac8805e3169691305ee0.tar.gz |
Since SWIG 3.0 removes support for .NET 1.1, cleanup the C# library by removing the use of the SWIG_DOTNET_1 macro.
Diffstat (limited to 'Lib')
-rw-r--r-- | Lib/csharp/std_map.i | 9 | ||||
-rw-r--r-- | Lib/csharp/std_vector.i | 22 |
2 files changed, 3 insertions, 28 deletions
diff --git a/Lib/csharp/std_map.i b/Lib/csharp/std_map.i index 61b527a28..045bd6e3e 100644 --- a/Lib/csharp/std_map.i +++ b/Lib/csharp/std_map.i @@ -11,9 +11,7 @@ * %template(MapIntDouble) std::map<int, double> * * Notes: - * 1) For .NET 1 compatibility, define SWIG_DOTNET_1 when compiling the C# code. In this case - * the C# wrapper has only basic functionality. - * 2) IEnumerable<> is implemented in the proxy class which is useful for using LINQ with + * 1) IEnumerable<> is implemented in the proxy class which is useful for using LINQ with * C++ std::map wrappers. * * Warning: heavy macro usage in this file. Use swig -E to get a sane view on the real file contents! @@ -28,7 +26,7 @@ /* K is the C++ key type, T is the C++ value type */ %define SWIG_STD_MAP_INTERNAL(K, T, C) -%typemap(csinterfaces) std::map< K, T, C > "IDisposable \n#if !SWIG_DOTNET_1\n , global::System.Collections.Generic.IDictionary<$typemap(cstype, K), $typemap(cstype, T)>\n#endif\n"; +%typemap(csinterfaces) std::map< K, T, C > "IDisposable \n , global::System.Collections.Generic.IDictionary<$typemap(cstype, K), $typemap(cstype, T)>\n"; %typemap(cscode) std::map<K, T, C > %{ public $typemap(cstype, T) this[$typemap(cstype, K) key] { @@ -62,8 +60,6 @@ } } -#if !SWIG_DOTNET_1 - public global::System.Collections.Generic.ICollection<$typemap(cstype, K)> Keys { get { global::System.Collections.Generic.ICollection<$typemap(cstype, K)> keys = new global::System.Collections.Generic.List<$typemap(cstype, K)>(); @@ -210,7 +206,6 @@ currentObject = null; } } -#endif %} diff --git a/Lib/csharp/std_vector.i b/Lib/csharp/std_vector.i index 50ba38739..e29c2bf2a 100644 --- a/Lib/csharp/std_vector.i +++ b/Lib/csharp/std_vector.i @@ -4,8 +4,6 @@ * SWIG typemaps for std::vector<T> * C# implementation * The C# wrapper is made to look and feel like a C# System.Collections.Generic.List<> collection. - * For .NET 1 compatibility, define SWIG_DOTNET_1 when compiling the C# code; then the C# wrapper is - * made to look and feel like a typesafe C# System.Collections.ArrayList. * * Note that IEnumerable<> is implemented in the proxy class which is useful for using LINQ with * C++ std::vector wrappers. The IList<> interface is also implemented to provide enhanced functionality @@ -26,7 +24,7 @@ // MACRO for use within the std::vector class body %define SWIG_STD_VECTOR_MINIMUM_INTERNAL(CSINTERFACE, CONST_REFERENCE, CTYPE...) -%typemap(csinterfaces) std::vector< CTYPE > "IDisposable, global::System.Collections.IEnumerable\n#if !SWIG_DOTNET_1\n , global::System.Collections.Generic.CSINTERFACE<$typemap(cstype, CTYPE)>\n#endif\n"; +%typemap(csinterfaces) std::vector< CTYPE > "IDisposable, global::System.Collections.IEnumerable\n , global::System.Collections.Generic.CSINTERFACE<$typemap(cstype, CTYPE)>\n"; %typemap(cscode) std::vector< CTYPE > %{ public $csclassname(global::System.Collections.ICollection c) : this() { if (c == null) @@ -80,29 +78,17 @@ } } -#if SWIG_DOTNET_1 - public void CopyTo(global::System.Array array) -#else public void CopyTo($typemap(cstype, CTYPE)[] array) -#endif { CopyTo(0, array, 0, this.Count); } -#if SWIG_DOTNET_1 - public void CopyTo(global::System.Array array, int arrayIndex) -#else public void CopyTo($typemap(cstype, CTYPE)[] array, int arrayIndex) -#endif { CopyTo(0, array, arrayIndex, this.Count); } -#if SWIG_DOTNET_1 - public void CopyTo(int index, global::System.Array array, int arrayIndex, int count) -#else public void CopyTo(int index, $typemap(cstype, CTYPE)[] array, int arrayIndex, int count) -#endif { if (array == null) throw new ArgumentNullException("array"); @@ -120,11 +106,9 @@ array.SetValue(getitemcopy(index+i), arrayIndex+i); } -#if !SWIG_DOTNET_1 global::System.Collections.Generic.IEnumerator<$typemap(cstype, CTYPE)> global::System.Collections.Generic.IEnumerable<$typemap(cstype, CTYPE)>.GetEnumerator() { return new $csclassnameEnumerator(this); } -#endif global::System.Collections.IEnumerator global::System.Collections.IEnumerable.GetEnumerator() { return new $csclassnameEnumerator(this); @@ -140,9 +124,7 @@ /// collection but not when one of the elements of the collection is modified as it is a bit /// tricky to detect unmanaged code that modifies the collection under our feet. public sealed class $csclassnameEnumerator : global::System.Collections.IEnumerator -#if !SWIG_DOTNET_1 , global::System.Collections.Generic.IEnumerator<$typemap(cstype, CTYPE)> -#endif { private $csclassname collectionRef; private int currentIndex; @@ -196,12 +178,10 @@ } } -#if !SWIG_DOTNET_1 public void Dispose() { currentIndex = -1; currentObject = null; } -#endif } %} |