Author: zoltan
Date: 2005-06-01 15:37:12 -0400 (Wed, 01 Jun 2005)
New Revision: 45308

Modified:
   trunk/mcs/class/corlib/System.Reflection.Emit/ChangeLog
   trunk/mcs/class/corlib/System.Reflection.Emit/MethodBuilder.cs
Log:
2005-06-01  Zoltan Varga  <[EMAIL PROTECTED]>

        * MethodBuilder.cs (SetCustomAttribute): Handle DllImportAttribute
        as well.


Modified: trunk/mcs/class/corlib/System.Reflection.Emit/ChangeLog
===================================================================
--- trunk/mcs/class/corlib/System.Reflection.Emit/ChangeLog     2005-06-01 
19:36:34 UTC (rev 45307)
+++ trunk/mcs/class/corlib/System.Reflection.Emit/ChangeLog     2005-06-01 
19:37:12 UTC (rev 45308)
@@ -1,5 +1,8 @@
 2005-06-01  Zoltan Varga  <[EMAIL PROTECTED]>
 
+       * MethodBuilder.cs (SetCustomAttribute): Handle DllImportAttribute
+       as well.
+
        * CustomAttributeBuilder.cs: Add a decode_cattr helper method.
 
 2005-05-27  Vladimir Vukicevic  <[EMAIL PROTECTED]>

Modified: trunk/mcs/class/corlib/System.Reflection.Emit/MethodBuilder.cs
===================================================================
--- trunk/mcs/class/corlib/System.Reflection.Emit/MethodBuilder.cs      
2005-06-01 19:36:34 UTC (rev 45307)
+++ trunk/mcs/class/corlib/System.Reflection.Emit/MethodBuilder.cs      
2005-06-01 19:37:12 UTC (rev 45308)
@@ -301,6 +301,22 @@
                                SetImplementationFlags 
((MethodImplAttributes)impla);
                                return;
                        }
+                       if (attrname == 
"System.Runtime.InteropServices.DllImportAttribute") {
+                               DllImportAttribute attr = 
(DllImportAttribute)CustomAttributeBuilder.decode_cattr (customBuilder);
+                               pi_dll = attr.Value;
+                               pi_entry = attr.EntryPoint;
+                               native_cc = attr.CallingConvention;
+                               charset = attr.CharSet;
+                               ExactSpelling = attr.ExactSpelling;
+                               if (attr.PreserveSig)
+                                       iattrs |= 
MethodImplAttributes.PreserveSig;
+                               SetLastError = attr.SetLastError;
+#if NET_1_1
+                               BestFitMapping = attr.BestFitMapping;
+                               ThrowOnUnmappableChar = 
attr.ThrowOnUnmappableChar;
+#endif
+                               return;
+                       }
                        if (cattrs != null) {
                                CustomAttributeBuilder[] new_array = new 
CustomAttributeBuilder [cattrs.Length + 1];
                                cattrs.CopyTo (new_array, 0);

_______________________________________________
Mono-patches maillist  -  [email protected]
http://lists.ximian.com/mailman/listinfo/mono-patches

Reply via email to