Merge pull request #2199 from mhutch/pcl46
authorMarek Safar <marek.safar@gmail.com>
Thu, 5 Nov 2015 08:38:00 +0000 (09:38 +0100)
committerMarek Safar <marek.safar@gmail.com>
Thu, 5 Nov 2015 08:38:00 +0000 (09:38 +0100)
[xbuild] Add PCL 4.6 targets

acceptance-tests/SUBMODULES.json
mcs/class/System/Mono.Net.Security/MonoDefaultTlsProvider.cs
mcs/class/System/Mono.Net.Security/MonoSslStreamWrapper.cs
mcs/class/System/System.Net.Security/SslStream.cs
mcs/class/System/System.Net/HttpListenerRequest.cs
mcs/class/System/System.Net/WebConnection.cs
mono/metadata/marshal.c
mono/mini/aot-runtime.c
mono/tests/libtest.c
mono/tests/pinvoke3.cs

index 288a63414cf71b8a93adbae6e2efe035d1d735c8..cc2d888411881be7bc208c254a3a0a7330248d7e 100644 (file)
@@ -10,7 +10,7 @@
   {
     "name": "coreclr", 
     "url": "git://github.com/mono/coreclr.git", 
-    "rev": "20789373370fe8f72dde01ad7ffc0816f618197c", 
+    "rev": "65b122151adb6b5ef7c27d8e0c268ef479fbe8b4", 
     "remote-branch": "origin/mono", 
     "branch": "mono", 
     "directory": "coreclr"
index 628e74429444d0d9e6c63aa0d8b37321b0b001b2..ee19a3ec14448db0951c938c86c24d4d707d0a81 100644 (file)
@@ -43,10 +43,8 @@ using XX509CertificateCollection = System.Security.Cryptography.X509Certificates
 
 #if MONO_SECURITY_ALIAS
 using MonoSecurity::Mono.Security.Interface;
-using MonoSecurity::Mono.Security.Protocol.Tls;
 #else
 using Mono.Security.Interface;
-using Mono.Security.Protocol.Tls;
 #endif
 
 using System;
index 0ea7190902f1c5581c87742d1fddea8c2af663df..24b777c87adaa56f728bd1c628b29a4557b06d1d 100644 (file)
@@ -34,19 +34,9 @@ extern alias MonoSecurity;
 #endif
 
 #if MONO_SECURITY_ALIAS
-using MonoCipherAlgorithmType = MonoSecurity::Mono.Security.Protocol.Tls.CipherAlgorithmType;
-using MonoHashAlgorithmType = MonoSecurity::Mono.Security.Protocol.Tls.HashAlgorithmType;
-using MonoExchangeAlgorithmType = MonoSecurity::Mono.Security.Protocol.Tls.ExchangeAlgorithmType;
-using MonoSecurityProtocolType = MonoSecurity::Mono.Security.Protocol.Tls.SecurityProtocolType;
 using MonoSecurity::Mono.Security.Interface;
-// using MonoSecurity::Mono.Security.Protocol.Tls;
 #else
-using MonoCipherAlgorithmType = Mono.Security.Protocol.Tls.CipherAlgorithmType;
-using MonoHashAlgorithmType = Mono.Security.Protocol.Tls.HashAlgorithmType;
-using MonoExchangeAlgorithmType = Mono.Security.Protocol.Tls.ExchangeAlgorithmType;
-using MonoSecurityProtocolType = Mono.Security.Protocol.Tls.SecurityProtocolType;
 using Mono.Security.Interface;
-// using Mono.Security.Protocol.Tls;
 #endif
 #if MONO_X509_ALIAS
 using XSslProtocols = PrebuiltSystem::System.Security.Authentication.SslProtocols;
index c6c5e97a11c2ed1eb2651a93945177ec4094ce84..f6b328970ed73a60bc1dbbf9096534b8bf0fe4f7 100644 (file)
@@ -34,19 +34,9 @@ extern alias MonoSecurity;
 #endif
 
 #if MONO_SECURITY_ALIAS
-using MonoCipherAlgorithmType = MonoSecurity::Mono.Security.Protocol.Tls.CipherAlgorithmType;
-using MonoHashAlgorithmType = MonoSecurity::Mono.Security.Protocol.Tls.HashAlgorithmType;
-using MonoExchangeAlgorithmType = MonoSecurity::Mono.Security.Protocol.Tls.ExchangeAlgorithmType;
-using MonoSecurityProtocolType = MonoSecurity::Mono.Security.Protocol.Tls.SecurityProtocolType;
 using MonoSecurity::Mono.Security.Interface;
-// using MonoSecurity::Mono.Security.Protocol.Tls;
 #else
-using MonoCipherAlgorithmType = Mono.Security.Protocol.Tls.CipherAlgorithmType;
-using MonoHashAlgorithmType = Mono.Security.Protocol.Tls.HashAlgorithmType;
-using MonoExchangeAlgorithmType = Mono.Security.Protocol.Tls.ExchangeAlgorithmType;
-using MonoSecurityProtocolType = Mono.Security.Protocol.Tls.SecurityProtocolType;
 using Mono.Security.Interface;
-// using Mono.Security.Protocol.Tls;
 #endif
 #if MONO_X509_ALIAS
 using XSslProtocols = PrebuiltSystem::System.Security.Authentication.SslProtocols;
index 8e25aa0629e3fde6425661e16f00a02a34da138a..ac59eb51cd3e72a782b009b80411e4da9ed64170 100644 (file)
 
 #if SECURITY_DEP
 
-#if MONOTOUCH || MONODROID
-using Mono.Security.Protocol.Tls;
-#else
-extern alias MonoSecurity;
-using MonoSecurity::Mono.Security.Protocol.Tls;
-#endif
-
 using System.Collections;
 using System.Collections.Specialized;
 using System.Globalization;
index 5e760e05d2087bd44a3549a00a0b233bf1b11183..97d15a285e04ce081f0fee2028ccea25d83c0823 100644 (file)
@@ -82,7 +82,6 @@ namespace System.Net
                NtlmAuthState connect_ntlm_auth_state;
                HttpWebRequest connect_request;
 
-               bool ssl;
                Exception connect_exception;
                static object classLock = new object ();
                MonoTlsStream tlsStream;
@@ -395,7 +394,6 @@ namespace System.Net
 
                                if (request.Address.Scheme == Uri.UriSchemeHttps) {
 #if SECURITY_DEP
-                                       ssl = true;
                                        if (!reused || nstream == null || tlsStream == null) {
                                                byte [] buffer = null;
                                                if (sPoint.UseConnect) {
@@ -414,7 +412,6 @@ namespace System.Net
                                        throw new NotSupportedException ();
 #endif
                                } else {
-                                       ssl = false;
                                        nstream = serverStream;
                                }
                        } catch (Exception ex) {
index 78ed91e9e727d9df2c1cae8952b91f5dc8001f58..fa1807cd77bb9f06da8f5b4254b632a1c374cc1f 100644 (file)
@@ -5625,10 +5625,11 @@ emit_marshal_object (EmitMarshalContext *m, int argnum, MonoType *t,
                conv_arg = mono_mb_add_local (mb, &klass->byval_arg);
 
                if (klass->delegate) {
-                       g_assert (!t->byref);
                        mono_mb_emit_byte (mb, MONO_CUSTOM_PREFIX);
                        mono_mb_emit_op (mb, CEE_MONO_CLASSCONST, klass);
                        mono_mb_emit_ldarg (mb, argnum);
+                       if (t->byref)
+                               mono_mb_emit_byte (mb, CEE_LDIND_I);
                        mono_mb_emit_icall (mb, conv_to_icall (MONO_MARSHAL_CONV_FTN_DEL));
                        mono_mb_emit_stloc (mb, conv_arg);
                        break;
@@ -5701,6 +5702,16 @@ emit_marshal_object (EmitMarshalContext *m, int argnum, MonoType *t,
                break;
 
        case MARSHAL_ACTION_MANAGED_CONV_OUT:
+               if (klass->delegate) {
+                       if (t->byref) {
+                               mono_mb_emit_ldarg (mb, argnum);
+                               mono_mb_emit_ldloc (mb, conv_arg);
+                               mono_mb_emit_icall (mb, conv_to_icall (MONO_MARSHAL_CONV_DEL_FTN));
+                               mono_mb_emit_byte (mb, CEE_STIND_I);
+                               break;
+                       }
+               }
+
                if (t->byref) {
                        /* Check for null */
                        mono_mb_emit_ldloc (mb, conv_arg);
index e83473d2c990767fb0c0906176a1b125e398948f..3bcbb7c49d9034a6d07bf75a7f11e9afa5bc0984 100644 (file)
@@ -1801,7 +1801,8 @@ init_amodule_got (MonoAotModule *amodule)
                        if (mono_defaults.corlib) {
                                MonoAotModule *mscorlib_amodule = mono_defaults.corlib->aot_module;
 
-                               amodule->shared_got [i] = mscorlib_amodule->got;
+                               if (mscorlib_amodule)
+                                       amodule->shared_got [i] = mscorlib_amodule->got;
                        } else {
                                amodule->shared_got [i] = amodule->got;
                        }
index aa58c852c36607f97f196a5d5ced44333e5dfe48..7a6f7d1e17225cc62eeed3efcd415b61ed187eb9 100644 (file)
@@ -876,6 +876,18 @@ mono_test_marshal_return_delegate (SimpleDelegate delegate)
        return delegate;
 }
 
+typedef int DelegateByrefDelegate (void *);
+
+LIBTEST_API int STDCALL
+mono_test_marshal_delegate_ref_delegate (DelegateByrefDelegate del)
+{
+       int (*ptr) (int i);
+
+       del (&ptr);
+
+       return ptr (54);
+}
+
 static int STDCALL
 return_plus_one (int i)
 {
index ae64d16e090d7af29dd027197a083e92bb2d7845..4b9a4b7f49a300186eb95ef72be806e21d897bfe 100644 (file)
@@ -188,6 +188,9 @@ public class Tests {
        [DllImport ("libtest", EntryPoint="mono_test_marshal_return_delegate_delegate")]
        public static extern int mono_test_marshal_return_delegate_delegate (ReturnDelegateDelegate d);
 
+       [DllImport ("libtest", EntryPoint="mono_test_marshal_delegate_ref_delegate")]
+       public static extern int mono_test_marshal_delegate_ref_delegate (DelegateByrefDelegate del);
+
        public delegate int TestDelegate (int a, ref SimpleStruct ss, int b);
 
        public delegate SimpleStruct SimpleDelegate2 (SimpleStruct ss);
@@ -210,6 +213,8 @@ public class Tests {
 
        public delegate return_int_delegate ReturnDelegateDelegate ();
 
+       public delegate int DelegateByrefDelegate (ref return_int_delegate del);
+
        public static int Main () {
                return TestDriver.RunTests (typeof (Tests));
        }
@@ -333,6 +338,20 @@ public class Tests {
                return mono_test_marshal_return_delegate_delegate (new ReturnDelegateDelegate (return_delegate));
        }
 
+       public static int return_plus_1 (int i) {
+               return i + 1;
+       }
+
+       public static int ref_delegate_delegate (ref return_int_delegate del) {
+               del = return_plus_1;
+               return 0;
+       }
+
+       public static int test_55_marshal_delegate_ref_delegate () {
+               var del = new DelegateByrefDelegate (ref_delegate_delegate);
+               return mono_test_marshal_delegate_ref_delegate (del);
+       }
+
        /* Passing and returning strings */
 
        public delegate String ReturnStringDelegate (String s);