Merge pull request #3800 from madewokherd/mingwbuild
authorAlexander Köplinger <alex.koeplinger@outlook.com>
Thu, 27 Oct 2016 10:37:23 +0000 (12:37 +0200)
committerGitHub <noreply@github.com>
Thu, 27 Oct 2016 10:37:23 +0000 (12:37 +0200)
Use lower-case names for Windows headers.

235 files changed:
configure.ac
data/config.in
external/boringssl
man/caspol.1
man/cccheck.1
man/ccrewrite.1
man/certmgr.1
man/crlupdate.1
man/csharp.1
man/disco.1
man/mcs.1
man/mkbundle.1
mcs/build/executable.make
mcs/build/profiles/monotouch_runtime.make
mcs/class/Facades/System.Diagnostics.Tracing/EventCounter.cs [deleted file]
mcs/class/Facades/System.Diagnostics.Tracing/Facades_System.Diagnostics.Tracing-net_4_x.csproj
mcs/class/Facades/System.Diagnostics.Tracing/System.Diagnostics.Tracing.dll.sources
mcs/class/Facades/System.Diagnostics.Tracing/TypeForwarders.cs
mcs/class/Facades/System.Net.Sockets/Facades_System.Net.Sockets-net_4_x.csproj
mcs/class/Facades/System.Net.Sockets/SocketReceiveFromResult.cs [deleted file]
mcs/class/Facades/System.Net.Sockets/SocketReceiveMessageFromResult.cs [deleted file]
mcs/class/Facades/System.Net.Sockets/SocketTaskExtensions.cs [deleted file]
mcs/class/Facades/System.Net.Sockets/System.Net.Sockets.dll.sources
mcs/class/Facades/System.Net.Sockets/TypeForwarders.cs
mcs/class/Mono.Btls.Interface/Makefile
mcs/class/Mono.CompilerServices.SymbolWriter/MonoSymbolTable.cs
mcs/class/Mono.Security/Mono.Security.Protocol.Tls.Handshake.Client/TlsClientCertificate.cs
mcs/class/Mono.Security/Mono.Security.Protocol.Tls.Handshake.Client/TlsServerFinished.cs
mcs/class/System.Core/Microsoft.Win32.SafeHandles/SafePipeHandle.cs
mcs/class/System.Core/System.Core-net_4_x.csproj
mcs/class/System.Core/System.Core-plaincore-net_4_x.csproj
mcs/class/System.Core/System.Security.Cryptography/IncrementalHash.cs [deleted file]
mcs/class/System.Core/common_System.Core.dll.sources
mcs/class/System/Makefile
mcs/class/System/Mono.Btls/MonoBtlsBio.cs
mcs/class/System/Mono.Btls/MonoBtlsContext.cs
mcs/class/System/Mono.Btls/MonoBtlsError.cs
mcs/class/System/Mono.Btls/MonoBtlsException.cs
mcs/class/System/Mono.Btls/MonoBtlsKey.cs
mcs/class/System/Mono.Btls/MonoBtlsObject.cs
mcs/class/System/Mono.Btls/MonoBtlsPkcs12.cs
mcs/class/System/Mono.Btls/MonoBtlsProvider.cs
mcs/class/System/Mono.Btls/MonoBtlsSsl.cs
mcs/class/System/Mono.Btls/MonoBtlsSslCtx.cs
mcs/class/System/Mono.Btls/MonoBtlsSslError.cs
mcs/class/System/Mono.Btls/MonoBtlsStream.cs
mcs/class/System/Mono.Btls/MonoBtlsUtils.cs
mcs/class/System/Mono.Btls/MonoBtlsX509.cs
mcs/class/System/Mono.Btls/MonoBtlsX509Chain.cs
mcs/class/System/Mono.Btls/MonoBtlsX509Crl.cs
mcs/class/System/Mono.Btls/MonoBtlsX509Error.cs
mcs/class/System/Mono.Btls/MonoBtlsX509Exception.cs
mcs/class/System/Mono.Btls/MonoBtlsX509FileType.cs
mcs/class/System/Mono.Btls/MonoBtlsX509Format.cs
mcs/class/System/Mono.Btls/MonoBtlsX509Lookup.cs
mcs/class/System/Mono.Btls/MonoBtlsX509LookupAndroid.cs
mcs/class/System/Mono.Btls/MonoBtlsX509LookupMono.cs
mcs/class/System/Mono.Btls/MonoBtlsX509LookupMonoCollection.cs
mcs/class/System/Mono.Btls/MonoBtlsX509LookupType.cs
mcs/class/System/Mono.Btls/MonoBtlsX509Name.cs
mcs/class/System/Mono.Btls/MonoBtlsX509NameEntryType.cs
mcs/class/System/Mono.Btls/MonoBtlsX509NameList.cs
mcs/class/System/Mono.Btls/MonoBtlsX509Purpose.cs
mcs/class/System/Mono.Btls/MonoBtlsX509Revoked.cs
mcs/class/System/Mono.Btls/MonoBtlsX509Store.cs
mcs/class/System/Mono.Btls/MonoBtlsX509StoreCtx.cs
mcs/class/System/Mono.Btls/MonoBtlsX509StoreManager.cs
mcs/class/System/Mono.Btls/MonoBtlsX509StoreType.cs
mcs/class/System/Mono.Btls/MonoBtlsX509TrustKind.cs
mcs/class/System/Mono.Btls/MonoBtlsX509VerifyFlags.cs
mcs/class/System/Mono.Btls/MonoBtlsX509VerifyParam.cs
mcs/class/System/Mono.Btls/X509CertificateImplBtls.cs
mcs/class/System/Mono.Btls/X509ChainImplBtls.cs
mcs/class/System/Mono.Net.Security/ChainValidationHelper.cs
mcs/class/System/Mono.Net.Security/LegacySslStream.cs
mcs/class/System/Mono.Net.Security/MonoTlsStream.cs
mcs/class/System/ReferenceSources/AutoWebProxyScriptEngine.cs
mcs/class/System/ReferenceSources/CAPI.cs
mcs/class/System/System-bare-net_4_x.csproj
mcs/class/System/System-net_4_x.csproj
mcs/class/System/System-secxml-net_4_x.csproj
mcs/class/System/System.CodeDom.Compiler/CodeDomProvider.cs
mcs/class/System/System.CodeDom.Compiler/TempFileCollection.cs
mcs/class/System/System.Configuration/AppSettingsReader.cs
mcs/class/System/System.Configuration/ConfigHelper.cs
mcs/class/System/System.Configuration/ConfigXmlDocument.cs
mcs/class/System/System.Configuration/ConfigurationSettings.cs
mcs/class/System/System.Configuration/NameValueFileSectionHandler.cs
mcs/class/System/System.Configuration/SingleTagSectionHandler.cs
mcs/class/System/System.Diagnostics/EventLog.cs
mcs/class/System/System.Diagnostics/PerformanceCounter.cs
mcs/class/System/System.Diagnostics/Win32EventLog.cs
mcs/class/System/System.IO/FileSystemWatcher.cs
mcs/class/System/System.IO/FileSystemWatcher_mobile.cs
mcs/class/System/System.Net.Configuration/ConnectionManagementHandler.cs
mcs/class/System/System.Net.Configuration/WebRequestModuleHandler.cs
mcs/class/System/System.Net.NetworkInformation/IPGlobalProperties.cs
mcs/class/System/System.Net.NetworkInformation/NetworkInterface.cs
mcs/class/System/System.Net.NetworkInformation/Ping.cs
mcs/class/System/System.Net.Security/SslStream.cs
mcs/class/System/System.Net.Sockets/Socket.cs
mcs/class/System/System.Net.Sockets/SocketReceiveFromResult.cs [new file with mode: 0644]
mcs/class/System/System.Net.Sockets/SocketReceiveMessageFromResult.cs [new file with mode: 0644]
mcs/class/System/System.Net.Sockets/SocketTaskExtensions.cs [new file with mode: 0644]
mcs/class/System/System.Net/HttpListenerRequest.cs
mcs/class/System/System.Net/ResponseStream.cs
mcs/class/System/System.Net/ServicePointManager.cs
mcs/class/System/System.Security.AccessControl/SemaphoreSecurity.cs
mcs/class/System/System.Security.Cryptography.X509Certificates/X509Helper2.cs
mcs/class/System/System.dll.sources
mcs/class/System/Test/System.Net/WebClientTest.cs
mcs/class/System/mobile_System.dll.sources
mcs/class/System/monotouch_watch_System.dll.exclude.sources
mcs/class/corlib/System.Diagnostics.Tracing/EventCounter.cs [new file with mode: 0644]
mcs/class/corlib/System.Runtime.CompilerServices/ConditionalWeakTable.cs
mcs/class/corlib/System.Runtime.InteropServices.WindowsRuntime/DefaultInterfaceAttribute.cs [deleted file]
mcs/class/corlib/System.Runtime.InteropServices.WindowsRuntime/EventRegistrationToken.cs [deleted file]
mcs/class/corlib/System.Runtime.InteropServices.WindowsRuntime/EventRegistrationTokenTable.cs [deleted file]
mcs/class/corlib/System.Runtime.InteropServices.WindowsRuntime/IActivationFactory.cs [deleted file]
mcs/class/corlib/System.Runtime.InteropServices.WindowsRuntime/InterfaceImplementedInVersionAttribute.cs [deleted file]
mcs/class/corlib/System.Runtime.InteropServices.WindowsRuntime/ReadOnlyArrayAttribute.cs [deleted file]
mcs/class/corlib/System.Runtime.InteropServices.WindowsRuntime/ReturnValueNameAttribute.cs [deleted file]
mcs/class/corlib/System.Runtime.InteropServices.WindowsRuntime/UnsafeNativeMethods.cs [new file with mode: 0644]
mcs/class/corlib/System.Runtime.InteropServices.WindowsRuntime/WindowsRuntimeMarshal.cs [deleted file]
mcs/class/corlib/System.Runtime.InteropServices.WindowsRuntime/WriteOnlyArrayAttribute.cs [deleted file]
mcs/class/corlib/System.Runtime.InteropServices/Marshal.cs
mcs/class/corlib/System.Security.Cryptography/IncrementalHash.cs [new file with mode: 0644]
mcs/class/corlib/System/Environment.cs
mcs/class/corlib/corlib-net_4_x.csproj
mcs/class/corlib/corlib.dll.sources
mcs/class/referencesource/System/compmod/system/componentmodel/TypeDescriptor.cs
mcs/class/referencesource/System/compmod/system/diagnostics/TraceInternal.cs
mcs/class/referencesource/System/net/System/Net/IPAddress.cs
mcs/class/referencesource/System/net/System/Net/Internal.cs
mcs/class/referencesource/System/net/System/Net/Sockets/Socket.cs
mcs/class/referencesource/System/net/System/Net/cookiecontainer.cs
mcs/class/referencesource/System/net/System/Net/filewebrequest.cs
mcs/class/referencesource/System/net/System/Net/mail/MimeBasePart.cs
mcs/class/referencesource/System/net/System/Net/webproxy.cs
mcs/class/referencesource/System/regex/system/text/regularexpressions/Regex.cs
mcs/class/referencesource/System/regex/system/text/regularexpressions/RegexParser.cs
mcs/class/referencesource/System/services/monitoring/system/diagnosticts/Process.cs
mcs/class/referencesource/System/sys/system/threading/semaphore.cs
mcs/class/referencesource/mscorlib/system/runtime/interopservices/windowsruntime/windowsruntimemarshal.cs
mcs/errors/cs8101.cs [new file with mode: 0644]
mcs/mcs/context.cs
mcs/mcs/ecore.cs
mcs/mcs/location.cs
mcs/mcs/namespace.cs
mcs/mcs/settings.cs
mcs/tools/btls/Makefile
mcs/tools/csharp/repl.cs
mcs/tools/linker/README
mcs/tools/mkbundle/Makefile
mcs/tools/mkbundle/mkbundle-net_4_x.csproj
mcs/tools/mkbundle/mkbundle.cs
mono/btls/CMakeLists.txt
mono/btls/Makefile.am
mono/btls/btls-bio.c
mono/btls/btls-error.c
mono/btls/btls-key.c
mono/btls/btls-pkcs12.c
mono/btls/btls-ssl-ctx.c
mono/btls/btls-ssl.c
mono/btls/btls-util.c
mono/btls/btls-util.h
mono/btls/btls-x509-chain.c
mono/btls/btls-x509-crl.c
mono/btls/btls-x509-lookup-mono.c
mono/btls/btls-x509-lookup.c
mono/btls/btls-x509-name.c
mono/btls/btls-x509-revoked.c
mono/btls/btls-x509-store-ctx.c
mono/btls/btls-x509-store.c
mono/btls/btls-x509-verify-param.c
mono/btls/btls-x509.c
mono/metadata/Makefile.am
mono/metadata/assembly.c
mono/metadata/assembly.h
mono/metadata/boehm-gc.c
mono/metadata/class-internals.h
mono/metadata/domain.c
mono/metadata/gc-internals.h
mono/metadata/icall-def.h
mono/metadata/icall.c
mono/metadata/marshal.c
mono/metadata/metadata-verify.c
mono/metadata/mono-config.c
mono/metadata/null-gc.c
mono/metadata/sgen-client-mono.h
mono/metadata/sgen-mono.c
mono/metadata/sgen-os-coop.c [deleted file]
mono/metadata/sgen-os-mach.c [deleted file]
mono/metadata/sgen-os-posix.c [deleted file]
mono/metadata/sgen-os-win32.c [deleted file]
mono/metadata/sgen-stw.c
mono/metadata/verify.h
mono/mini/aot-compiler.c
mono/mini/driver.c
mono/mini/exceptions-x86.c
mono/mini/method-to-ir.c
mono/mini/mini-exceptions.c
mono/mini/mini-generic-sharing.c
mono/mini/mini-llvm.c
mono/mini/mini-posix.c
mono/mini/mini-runtime.c
mono/mini/mini-windows.c
mono/mini/mini.h
mono/tests/Makefile.am
mono/tests/bug-45841-fpstack-exceptions.il [new file with mode: 0644]
mono/tests/generic-stack-traces.2.cs
mono/tests/pinvoke3.cs
mono/utils/Makefile.am
mono/utils/mono-threads-coop.c
mono/utils/mono-threads-debug.h [new file with mode: 0644]
mono/utils/mono-threads-mach-abort-syscall.c [deleted file]
mono/utils/mono-threads-mach.c
mono/utils/mono-threads-posix-abort-syscall.c [deleted file]
mono/utils/mono-threads-posix-signals.c
mono/utils/mono-threads-posix-signals.h [deleted file]
mono/utils/mono-threads-posix.c
mono/utils/mono-threads-state-machine.c
mono/utils/mono-threads-windows-abort-syscall.c [deleted file]
mono/utils/mono-threads-windows.c
mono/utils/mono-threads.c
mono/utils/mono-threads.h
mono/utils/os-event-unix.c [new file with mode: 0644]
mono/utils/os-event-win32.c [new file with mode: 0644]
mono/utils/os-event.h [new file with mode: 0644]
msvc/libmonoruntime.vcxproj
msvc/libmonoruntime.vcxproj.filters
msvc/libmonoutils.vcxproj
msvc/libmonoutils.vcxproj.filters
msvc/scripts/order.xml
runtime/Makefile.am

index c644a7c42026990778fd1b78c7f4d5877d5ef1c7..f258b89d7f28911d7ad177e74b281e31a400630b 100644 (file)
@@ -550,9 +550,6 @@ if test x"$GCC" = xyes; then
                # We rely on signed overflow to behave
                CFLAGS="$CFLAGS -fwrapv"
 
-               # We rely on zero length arrays in structs
-               CFLAGS="$CFLAGS -Wno-zero-length-array"
-
                CFLAGS="$CFLAGS -DMONO_DLL_EXPORT"
                if test x"$disable_visibility_hidden" = xno; then
                   # Don't export any symbols by default
@@ -579,6 +576,8 @@ if test x"$GCC" = xyes; then
                   # https://bugzilla.samba.org/show_bug.cgi?id=8118
                   WARN="$WARN -Qunused-arguments"
                   WARN="$WARN -Wno-unused-function -Wno-tautological-compare -Wno-parentheses-equality -Wno-self-assign -Wno-return-stack-address -Wno-constant-logical-operand"
+                  # We rely on zero length arrays in structs
+                  WARN="$WARN -Wno-zero-length-array"
                fi
 else
        # The Sun Forte compiler complains about inline functions that access static variables
@@ -781,7 +780,7 @@ dnl
 TEST_PROFILE=default
 enable_llvm_default=no
 
-INVARIANT_AOT_OPTIONS=nimt-trampolines=900,ntrampolines=8000,nrgctx-fetch-trampolines=256,ngsharedvt-trampolines=2800
+INVARIANT_AOT_OPTIONS=nimt-trampolines=2000,ntrampolines=8000,nrgctx-fetch-trampolines=256,ngsharedvt-trampolines=4000
 
 if test x$cross_compiling = xyes -o x$enable_mcs_build = xno; then
    DISABLE_MCS_DOCS_default=yes
@@ -3930,7 +3929,10 @@ dnl **************
 AC_ARG_ENABLE(btls, [  --disable-btls             Disable the BoringTls provider], enable_btls=$enableval, enable_btls=$BTLS_SUPPORTED)
 AC_ARG_WITH(btls_android_ndk, [  --with-btls-android-ndk        Android NDK for BoringTls])
 
+AC_ARG_ENABLE(dynamic-btls, [ --enable-dynamic-btls Place the BTLS provider into a separate shared library/archive.], enable_dynamic_btls=$enableval, enable_dynamic_btls=no)
+
 AM_CONDITIONAL(BTLS, test x$enable_btls = xyes)
+AM_CONDITIONAL(DYNAMIC_BTLS, test x$enable_dynamic_btls = xyes)
 
 btls_android=no
 if test "x$enable_btls" = "xyes"; then
@@ -3999,6 +4001,10 @@ if test "x$enable_btls" = "xyes"; then
        AC_SUBST(BTLS_CMAKE_ARGS)
 
        AC_DEFINE(HAVE_BTLS, 1, [BoringTls is supported])
+
+       if test "x$enable_dynamic_btls" = "xyes"; then
+               AC_DEFINE(HAVE_DYNAMIC_BTLS, 1, [BTLS in a shared libraty])
+       fi
 else
        enable_btls=no
 fi
@@ -4407,6 +4413,13 @@ fi
       echo "AOT_BUILD_FLAGS=$AOT_BUILD_FLAGS" >> $srcdir/$mcsdir/build/config.make
     fi
 
+    if test "x$enable_btls" = "xyes"; then
+      echo "HAVE_BTLS=1" >> $srcdir/$mcsdir/build/config.make
+      if test "x$enable_dynamic_btls" = "xyes"; then
+        echo "HAVE_DYNAMIC_BTLS=1" >> $srcdir/$mcsdir/build/config.make
+      fi
+    fi
+
   fi
 
 )
index b4b7243ecfd001bb60aeb9b0979840a8cd170c28..be83151429311d44e1c6d5aaa5c82df050a1aa74 100644 (file)
@@ -11,6 +11,7 @@
        <dllmap dll="oci" target="libclntsh@libsuffix@" os="!windows"/>
        <dllmap dll="db2cli" target="libdb2_36@libsuffix@" os="!windows"/>
        <dllmap dll="MonoPosixHelper" target="$mono_libdir/libMonoPosixHelper@libsuffix@" os="!windows" />
+       <dllmap dll="libmono-btls-shared" target="$mono_libdir/libmono-btls-shared@libsuffix@" os="!windows" />
        <dllmap dll="i:msvcrt" target="@LIBC@" os="!windows"/>
        <dllmap dll="i:msvcrt.dll" target="@LIBC@" os="!windows"/>
        <dllmap dll="sqlite" target="@SQLITE@" os="!windows"/>
index 9ad688f0ae679b32e9c0a9b21bb63a4488c28b6b..432738a3c938b4f751307301c6aa07f2027a8864 160000 (submodule)
@@ -1 +1 @@
-Subproject commit 9ad688f0ae679b32e9c0a9b21bb63a4488c28b6b
+Subproject commit 432738a3c938b4f751307301c6aa07f2027a8864
index fe705601b4c7939cecdcb05c6abcebffd6b7e93d..853df717c7575cfdd2cebbf8d495cfdc8286afb6 100644 (file)
@@ -11,7 +11,7 @@ caspol \- Command line tool to modify Code Access Security policies.
 .PP
 .B caspol [options] [policy level] [actions] [parameters] ... 
 .SH DESCRIPTION
-This tools allow to list and modify the different policy levels (user, 
+This tool allows to list and modify the different policy levels (user, 
 machine and enterprise).
 .SH OPTIONS
 .TP
@@ -20,7 +20,7 @@ Do not ask confirmation to change the policy level.
 .TP
 .I -f[orce]
 Caspol.exe is a managed tool. Changing the security policies could affect
-it's ability to work properly. This option permit changes that could 
+it's ability to work properly. This option permits changes that could 
 disallow caspol.exe from working properly.
 .TP
 .I -? | /? | -h[elp]
@@ -90,7 +90,7 @@ Remove the specified named permission set from the policy level
 .TP
 .I -af | -addfulltrust assemblyname
 Add the specified assembly to the fully trusted assembly list in the 
-policy level. If a policy use some custom security permissions then the
+policy level. If a policy uses some custom security permissions then the
 assembly containing the custom permissions must be in the fully trusted
 list. Note that this requirement is recursive (all assemblies required 
 by the specified assembly must also be in the list). The assembly must be
@@ -148,33 +148,33 @@ Use the option to load a custom condition into the policy. The class that
 will deserialize the XML policy must be in a fully trusted assembly.
 .TP
 .I -hash algo [-hex hash | -file assemblyname]
-This condition specify a specific hash that an assembly must generate
+This condition specifies a specific hash that an assembly must generate
 (from itself) to be satisfied. Any change to the assembly will require the
 policy to be updated (as the hash value will have changed).
 .TP
 .I -pub [-cert certificate | -file signedfile | -hex rawdata]
-This condition specify a X.509 Authenticode(r) certificate that must have 
+This condition specifies a X.509 Authenticode(r) certificate that must have 
 signed an assembly in order to be satisfied. The certificate can be referenced
 as a file (binary DER), a signed file (containing the certificate) or with
 the hexadecimal value of the certificate. Note that files outside the 
 policy must also be protected against tempering.
 .TP
 .I -strong -file filename [name | -noname] [version | -noversion]
-This condition specify a specific StrongName that must have signed an
+This condition specifies a specific StrongName that must have signed an
 assembly to be satisfied. Use -noname if the assembly name isn't known
 (or important) and -version if the version isn't known (or important) in
 the resolution.
 .TP
 .I -site hostname
-This condition specify the site from where the assembly must come from to 
+This condition specifies the site from where the assembly must come from to 
 be satisfied.
 .TP
 .I -url URL
-This condition specify the URL from where the assembly must come from to 
+This condition specifies the URL from where the assembly must come from to 
 be satisfied.
 .TP
 .I -zone zonename
-This condition specify the zone from where the assembly must come from to 
+This condition specifies the zone from where the assembly must come from to 
 be satisfied. Existing zones are MyComputer, Internet, Intranet, Trusted 
 and Untrusted.
 
@@ -204,7 +204,7 @@ It is possible to chain several commands with the tool, like:
 .TP
 This will list all machine level code groups, then remove the code group
 labeled 1.6, list again all code groups (missing 1.6), reset the policy
-and finally showing all code groups (where 1.6 is back).
+and finally show all code groups (where 1.6 is back).
 
 .SH KNOWN ISSUES
 .TP
index aead19a58d084fbb76a15eebba1fef9a6367a76a..3614f4ae4ec8d1173f8940122cd2984e7e3db6c2 100644 (file)
@@ -11,7 +11,7 @@ cccheck \- Perform static code contracts verification for CLR assemblies.
 .PP
 .B cccheck --assembly=<assembly> [options]
 .SH DESCRIPTION
-Perform static code contracts verification to find bugs and inconsistences
+Perform static code contracts verification to find bugs and inconsistencies
 between code and specification. This includes non-null, integer analyses. 
 .PP
 The assembly must have been built with the symbol CONTRACTS_FULL defined,
index 22f242b2fb49563d2ed058e459c7af35ac64e4ec..a3907ed699a6efaf99b1e604de7a6ae4c0de9b37 100644 (file)
@@ -1,6 +1,6 @@
 .\" 
 .\" ccrewrite manual page.
-.\" Copyright (C) 2010 Novell, Inc (http://www.novell.com)
+.\" Copyright (C) 2010 Chris Bacon.
 .\" Author:
 .\"   Chris Bacon <chrisbacon76@gmail.com>
 .\"
@@ -28,7 +28,7 @@ specified assembly.
 .TP
 .I "--assembly <assembly-name>"
 The assembly to rewrite. If no --output option is specified, then this file
-overwritten with the rewritten version.
+is overwritten with the rewritten version.
 .TP
 .I "--debug"
 Use debug information if available to improve the usefulness of contract
@@ -38,7 +38,7 @@ failure messages.
 Show help for ccrewrite, listing configuration options.
 .TP
 .I "--level <level> (default=4)"
-Set the which contract types are present in rewritten assembly:
+Set which contract types are present in rewritten assembly:
 0 = No contracts;
 1 = Release requires;
 2 = Requires;
index b80ffd0457f9fad271952beb31a7389830f52319..92bfa164b96340f38e80ec070b04222ebeacf264 100644 (file)
@@ -15,7 +15,7 @@ certmgr \- Mono Certificate Manager (CLI version)
 or
 .B certmgr -ssl [options] url
 .SH DESCRIPTION
-This tool allow to list, add, remove or extract certificates, certificate 
+This tool allows to list, add, remove or extract certificates, certificate 
 revocation lists (CRL) or certificate trust lists (CTL) to/from a 
 certificate store. Certificate stores are used to build and validate 
 certificate chains for Authenticode(r) code signing validation and SSL 
@@ -23,7 +23,7 @@ server certificates.
 .SH STORES
 The 
 .I store
-represents the certificate store to use.   It can be one of the
+represents the certificate store to use. It can be one of the
 following:
 .TP
 .I "My"
@@ -46,7 +46,7 @@ This is for untrusted roots
 List the certificates, CTL or CTL in the specified store.
 .TP
 .I "-add"
-Add a certificate, CRL or CTL to specified store. If filename it's a pkcs12 
+Add a certificate, CRL or CTL to specified store. If filename is a pkcs12 
 or pfx file, and it contains a private key, it will be imported to local key
 pair container.
 .TP
@@ -64,25 +64,25 @@ Copy a certificate, CRL or CTL from a store to a file.
 Download and add the certificates from a SSL session. You'll be asked to 
 confirm the addition of every certificate received from the server. Note 
 that SSL/TLS protocols do not requires a server to send the root certificate.
-This action assume an certificate (-c) object type and will import the 
+This action assumes a certificate (-c) object type and will import the 
 certificates in appropriate stores (i.e. server certificate in the 
-OtherPeople store, the root certificate in the Trust store, any other 
+OtherPeople store, the root certificate in the Trust store and any other 
 intermediate certificates in the IntermediateCA store).
 .TP
 .I "-importKey"
 Allows importing a private key from a pkcs12 file into a local key pair
-store. (Usefull when you already have the key's corresponding certificate
+store. (Useful when you already have the key's corresponding certificate
 installed at the specific store.)
 
 .SH OBJECT TYPES
 .TP
 .I "-c", "-cert", "-certificate"
-Add, Delete or Put certificates. That is the specified file must/will contains
+Add, Delete or Put certificates. That is the specified file must/will contain
 X.509 certificates in DER binary encoding.
 .TP
 .I "-crl"
 Add, Delete or Put certificate revocation lists (CRL). That is the specified 
-file must/will contains X.509 CRL in DER binary encoding.
+file must/will contain X.509 CRL in DER binary encoding.
 .TP
 .I "-ctl"
 Add, Delete or Put certificate trust lists (CRL). UNSUPPORTED.
@@ -96,7 +96,7 @@ Use the machine's certificate stores (instead of the default user's stores).
 More details displayed on the console.
 .TP
 .I "-p password"
-Use the specify password when accessing a pkcs12 file.
+Use the specified password when accessing a pkcs12 file.
 .TP
 .I "-help", "-h", "-?", "/?"
 Display help about this tool.
@@ -113,7 +113,7 @@ For example the trusted root certificates for a user would be kept under
 .TP
 Certificates files are kept in DER (binary) format (extension .cer).
 .TP
-The filenames either starts with
+The filenames either start with
 .I tbp 
 (thumbprint) or
 .I ski
index 8e20437b1aaacb0ac2ad2afcee8b09188955dea4..b60c6f708b83ded5d39917eb52fb26f1fd48504a 100644 (file)
@@ -42,7 +42,7 @@ associated with certificates present in user store.
 .B mono crlupdate.exe -f -m
 Force the download of every CRL associated with certificates present in
 the machine store. Note that the user running this needs read/write 
-access to the machine store or not update will occur.
+access to the machine store or update will not occur.
 
 .SH AUTHOR
 Written by Sebastien Pouliot
index 9379658e62e5ec4615a6f61f890f06f56bd458fd..a0f9e6f4f6acd62c6df19b1a0a84aadca07e306c 100644 (file)
@@ -224,7 +224,7 @@ versions uses the standard Gtk# key bindings.
 .PP
 The command set is similar to many other applications (cursor keys)
 and incorporates some of the Emacs commands for editing as well as a
-history mechanism to 
+history mechanism too.
 .PP
 .PP
 The following keyboard input is supported:
@@ -247,7 +247,7 @@ line in the history.
 .TP
 .I Down Arrow Key, Control-n
 Moves forward in the history, replaces the current line with the next
-lien in the history.
+line in the history.
 .TP
 .I Return
 Executes the current line if the statement or expression is complete,
index e8e319ccc65b980a5e568bf1ef2e4e58d95ebbc2..c2f2cfddbd8ba9afaec38a0acfd059e6aaba7a3c 100644 (file)
@@ -29,7 +29,7 @@ option is specified), and saves them to disk.
 The following options are available:
 .TP
 .I "-nologo"
-Supress the startup logo.
+Suppress the startup logo.
 .TP
 .I "-nosave"
 Do not save the discovered documents to disk. The default is to save the documents.
index 377c445cb095c3479199002d4a1461bc3bdaf7d1..644b85a6e4f123c8987dae19825eeb2f34778196 100644 (file)
--- a/man/mcs.1
+++ b/man/mcs.1
@@ -238,6 +238,9 @@ Names the output file to be generated.
 .I \-\-parse
 Used for benchmarking.  The compiler will only parse its input files.
 .TP
+.I \-pathmap:K=V[,Kn=Vn]
+Sets a mapping for source path names used in generated output.
+.TP
 .I \-pkg:package1[,packageN]
 Reference assemblies for the given packages.
 .Sp
index 305cfcc7f7224d787f72e728310c6a0e66c49d43..3d067eb27ef9892b7d979a57b40f1d4fa17c4814 100644 (file)
@@ -24,7 +24,8 @@ dependencies referenced, use the "--deps" command line option.
 There are two modes of operation, one uses an existing Mono binary or
 a server-hosted list of binaries and is enabled when you use either
 the 
-.B --cross
+.B --cross,
+.B --sdk
 or the
 .B --runtime
 command line options.   
@@ -119,10 +120,19 @@ are using (1.0 or 2.0)
 When passed, DIR will be set for the MONO_CFG_DIR environment variable
 .TP
 .I "--cross target"
-Creates a bundle for the specified target platform.   The target
-must be a directory in ~/.mono/targets/ that contains a "mono"
-binary.   You can fetch various targets using the --fetch-target
-command line option.
+Use this to request mkbundle generate a cross-compiled binary.  It
+Creates a bundle for the specified target platform.  The target must
+be a directory in ~/.mono/targets/ that contains an SDK installation
+as produced by the mono-package-runtime tool.  You can get a list of
+the precompiled versions of the runtime using --list-targets and you
+can fetch a specific target using the --fetch-target command line
+option.
+.Sp
+This flag is mutually exclusive with 
+.I --sdk
+which is used to specify an absolute path to resolve the Mono runtime
+from and the --runtime option which is used to manually construct the
+cross-platform package.
 .TP
 .I "--deps"
 This option will bundle all of the referenced assemblies for the
@@ -203,7 +213,26 @@ executed.
 Additionally, users of your binary can still configure their own
 options by setting the 
 .I MONO_ENV_OPTIONS
-environment variable.   
+environment variable.
+.TP
+.I "--sdk SDK_PATH"
+Use this flag to specify a path from which mkbundle will resolve the
+Mono SDK from.   The SDK path should be the prefix path that you used
+to configure a Mono installation.   And would typically contain files
+lik
+.I SDK_PATH/bin/mono
+,
+.I SDK_PATH/lib/mono/4.5
+and so on.
+.Sp
+When this flag is specified,
+.I mkbundle
+will resolve the runtime, the framework libraries, unmanaged resources
+and configuration files from the files located in this directory.
+.Sp
+This flag is mutually exlusive with 
+.I --cross
+.
 .TP
 .I "--target-server SERVER"
 By default the mkbundle tool will download from a Mono server the
index afcad223f8e969f9261f2d7c631a2b624beefbc7..8acb0f5df619f789fd717207654d9178d6d9d178 100644 (file)
@@ -42,7 +42,9 @@ executable_CLEAN_FILES += $(build_lib) $(build_lib).so $(build_lib).mdb $(build_
 
 makefrag = $(depsdir)/$(PROFILE)_$(base_prog).makefrag
 
+ifndef NO_BUILD
 all-local: $(the_lib) $(PROGRAM_config)
+endif
 
 install-local: all-local
 test-local: all-local
index e4370cf4f985b188dc80ed333347e114bf4e24c1..1603d123c72bc13c29fa0b6b73e4a782da8bbfb1 100644 (file)
@@ -39,3 +39,5 @@ FRAMEWORK_VERSION = 2.1
 NO_INSTALL = yes
 MOBILE_STATIC = yes
 MOBILE_PROFILE = yes
+
+PROFILE_DISABLE_BTLS=1
diff --git a/mcs/class/Facades/System.Diagnostics.Tracing/EventCounter.cs b/mcs/class/Facades/System.Diagnostics.Tracing/EventCounter.cs
deleted file mode 100644 (file)
index 7fedc40..0000000
+++ /dev/null
@@ -1,41 +0,0 @@
-//
-// EventCounter.cs
-//
-// Authors:
-//     Marek Safar  <marek.safar@gmail.com>
-//
-// Copyright (C) 2016 Xamarin Inc (http://www.xamarin.com)
-//
-// Permission is hereby granted, free of charge, to any person obtaining
-// a copy of this software and associated documentation files (the
-// "Software"), to deal in the Software without restriction, including
-// without limitation the rights to use, copy, modify, merge, publish,
-// distribute, sublicense, and/or sell copies of the Software, and to
-// permit persons to whom the Software is furnished to do so, subject to
-// the following conditions:
-//
-// The above copyright notice and this permission notice shall be
-// included in all copies or substantial portions of the Software.
-//
-// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
-// EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
-// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
-// NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
-// LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
-// OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
-// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
-//
-
-namespace System.Diagnostics.Tracing
-{
-       public class EventCounter
-       {
-               public EventCounter (string name, EventSource eventSource)
-               {
-               }
-
-               public void WriteMetric (float value)
-               {
-               }
-       }
-}
\ No newline at end of file
index e743ee19c299983be92619d79069a403b7f8564a..8e7866cdebbdd3282fdca441f83e063364c299a2 100644 (file)
@@ -55,7 +55,6 @@
   <Import Project="$(MSBuildToolsPath)\Microsoft.CSharp.targets" />\r
   <ItemGroup>\r
     <Compile Include="AssemblyInfo.cs" />\r
-    <Compile Include="EventCounter.cs" />\r
     <Compile Include="TypeForwarders.cs" />\r  </ItemGroup>\r
   <!-- To modify your build process, add your task inside one of the targets below and uncomment it. \r
        Other similar extension points exist, see Microsoft.Common.targets.\r
index 5c8ab29d77aeb95e7a9fcceeec94fccc04ccecdb..2e4028199f1e1cd52121eef23153f59452851a6c 100644 (file)
@@ -44,3 +44,7 @@
 [assembly: System.Runtime.CompilerServices.TypeForwardedToAttribute(typeof(System.Diagnostics.Tracing.EventTask))]
 [assembly: System.Runtime.CompilerServices.TypeForwardedToAttribute(typeof(System.Diagnostics.Tracing.EventWrittenEventArgs))]
 [assembly: System.Runtime.CompilerServices.TypeForwardedToAttribute(typeof(System.Diagnostics.Tracing.NonEventAttribute))]
+
+#if NETSTANDARD
+[assembly: System.Runtime.CompilerServices.TypeForwardedToAttribute(typeof(System.Diagnostics.Tracing.EventCounter))]
+#endif
index 35175afbf2acc555f76fafeb25693d83bede0685..cbf77602dab39714d52f89326bfaa9b9e284f267 100644 (file)
@@ -55,9 +55,6 @@
   <Import Project="$(MSBuildToolsPath)\Microsoft.CSharp.targets" />\r
   <ItemGroup>\r
     <Compile Include="AssemblyInfo.cs" />\r
-    <Compile Include="SocketReceiveFromResult.cs" />\r
-    <Compile Include="SocketReceiveMessageFromResult.cs" />\r
-    <Compile Include="SocketTaskExtensions.cs" />\r
     <Compile Include="TypeForwarders.cs" />\r  </ItemGroup>\r
   <!-- To modify your build process, add your task inside one of the targets below and uncomment it. \r
        Other similar extension points exist, see Microsoft.Common.targets.\r
diff --git a/mcs/class/Facades/System.Net.Sockets/SocketReceiveFromResult.cs b/mcs/class/Facades/System.Net.Sockets/SocketReceiveFromResult.cs
deleted file mode 100644 (file)
index 2add0e6..0000000
+++ /dev/null
@@ -1,36 +0,0 @@
-//
-// SocketReceiveFromResult.cs
-//
-// Authors:
-//     Marek Safar  <marek.safar@gmail.com>
-//
-// Copyright (C) 2016 Xamarin Inc (http://www.xamarin.com)
-//
-// Permission is hereby granted, free of charge, to any person obtaining
-// a copy of this software and associated documentation files (the
-// "Software"), to deal in the Software without restriction, including
-// without limitation the rights to use, copy, modify, merge, publish,
-// distribute, sublicense, and/or sell copies of the Software, and to
-// permit persons to whom the Software is furnished to do so, subject to
-// the following conditions:
-//
-// The above copyright notice and this permission notice shall be
-// included in all copies or substantial portions of the Software.
-//
-// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
-// EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
-// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
-// NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
-// LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
-// OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
-// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
-//
-
-namespace System.Net.Sockets
-{
-       public struct SocketReceiveFromResult
-       {
-               public int ReceivedBytes;
-               public EndPoint RemoteEndPoint;
-       }
-}
\ No newline at end of file
diff --git a/mcs/class/Facades/System.Net.Sockets/SocketReceiveMessageFromResult.cs b/mcs/class/Facades/System.Net.Sockets/SocketReceiveMessageFromResult.cs
deleted file mode 100644 (file)
index ab5ed10..0000000
+++ /dev/null
@@ -1,38 +0,0 @@
-//
-// SocketReceiveMessageFromResult.cs
-//
-// Authors:
-//     Marek Safar  <marek.safar@gmail.com>
-//
-// Copyright (C) 2016 Xamarin Inc (http://www.xamarin.com)
-//
-// Permission is hereby granted, free of charge, to any person obtaining
-// a copy of this software and associated documentation files (the
-// "Software"), to deal in the Software without restriction, including
-// without limitation the rights to use, copy, modify, merge, publish,
-// distribute, sublicense, and/or sell copies of the Software, and to
-// permit persons to whom the Software is furnished to do so, subject to
-// the following conditions:
-//
-// The above copyright notice and this permission notice shall be
-// included in all copies or substantial portions of the Software.
-//
-// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
-// EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
-// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
-// NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
-// LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
-// OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
-// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
-//
-
-namespace System.Net.Sockets
-{
-       public struct SocketReceiveMessageFromResult
-       {
-               public int ReceivedBytes;
-               public SocketFlags SocketFlags;
-               public EndPoint RemoteEndPoint;
-               public IPPacketInformation PacketInformation;
-       }
-}
\ No newline at end of file
diff --git a/mcs/class/Facades/System.Net.Sockets/SocketTaskExtensions.cs b/mcs/class/Facades/System.Net.Sockets/SocketTaskExtensions.cs
deleted file mode 100644 (file)
index c0665fc..0000000
+++ /dev/null
@@ -1,250 +0,0 @@
-// Licensed to the .NET Foundation under one or more agreements.
-// The .NET Foundation licenses this file to you under the MIT license.
-// See the LICENSE file in the project root for more information.
-
-using System.Collections.Generic;
-using System.Threading.Tasks;
-
-namespace System.Net.Sockets
-{
-    public static class SocketTaskExtensions
-    {
-        public static Task<Socket> AcceptAsync(this Socket socket)
-        {
-            return Task<Socket>.Factory.FromAsync(
-                (callback, state) => ((Socket)state).BeginAccept(callback, state),
-                asyncResult => ((Socket)asyncResult.AsyncState).EndAccept(asyncResult),
-                state: socket);
-        }
-
-        public static Task<Socket> AcceptAsync(this Socket socket, Socket acceptSocket)
-        {
-            const int ReceiveSize = 0;
-            return Task<Socket>.Factory.FromAsync(
-                (socketForAccept, receiveSize, callback, state) => ((Socket)state).BeginAccept(socketForAccept, receiveSize, callback, state),
-                asyncResult => ((Socket)asyncResult.AsyncState).EndAccept(asyncResult),
-                acceptSocket,
-                ReceiveSize,
-                state: socket);
-        }
-
-        public static Task ConnectAsync(this Socket socket, EndPoint remoteEP)
-        {
-            return Task.Factory.FromAsync(
-                (targetEndPoint, callback, state) => ((Socket)state).BeginConnect(targetEndPoint, callback, state),
-                asyncResult => ((Socket)asyncResult.AsyncState).EndConnect(asyncResult),
-                remoteEP,
-                state: socket);
-        }
-
-        public static Task ConnectAsync(this Socket socket, IPAddress address, int port)
-        {
-            return Task.Factory.FromAsync(
-                (targetAddress, targetPort, callback, state) => ((Socket)state).BeginConnect(targetAddress, targetPort, callback, state),
-                asyncResult => ((Socket)asyncResult.AsyncState).EndConnect(asyncResult),
-                address,
-                port,
-                state: socket);
-        }
-
-        public static Task ConnectAsync(this Socket socket, IPAddress[] addresses, int port)
-        {
-            return Task.Factory.FromAsync(
-                (targetAddresses, targetPort, callback, state) => ((Socket)state).BeginConnect(targetAddresses, targetPort, callback, state),
-                asyncResult => ((Socket)asyncResult.AsyncState).EndConnect(asyncResult),
-                addresses,
-                port,
-                state: socket);
-        }
-
-        public static Task ConnectAsync(this Socket socket, string host, int port)
-        {
-            return Task.Factory.FromAsync(
-                (targetHost, targetPort, callback, state) => ((Socket)state).BeginConnect(targetHost, targetPort, callback, state),
-                asyncResult => ((Socket)asyncResult.AsyncState).EndConnect(asyncResult),
-                host,
-                port,
-                state: socket);
-        }
-
-        public static Task<int> ReceiveAsync(this Socket socket, ArraySegment<byte> buffer, SocketFlags socketFlags)
-        {
-            return Task<int>.Factory.FromAsync(
-                (targetBuffer, flags, callback, state) => ((Socket)state).BeginReceive(
-                                                              targetBuffer.Array,
-                                                              targetBuffer.Offset,
-                                                              targetBuffer.Count,
-                                                              flags,
-                                                              callback,
-                                                              state),
-                asyncResult => ((Socket)asyncResult.AsyncState).EndReceive(asyncResult),
-                buffer,
-                socketFlags,
-                state: socket);
-        }
-
-        public static Task<int> ReceiveAsync(
-            this Socket socket,
-            IList<ArraySegment<byte>> buffers,
-            SocketFlags socketFlags)
-        {
-            return Task<int>.Factory.FromAsync(
-                (targetBuffers, flags, callback, state) => ((Socket)state).BeginReceive(targetBuffers, flags, callback, state),
-                asyncResult => ((Socket)asyncResult.AsyncState).EndReceive(asyncResult),
-                buffers,
-                socketFlags,
-                state: socket);
-        }
-
-        public static Task<SocketReceiveFromResult> ReceiveFromAsync(
-            this Socket socket,
-            ArraySegment<byte> buffer,
-            SocketFlags socketFlags,
-            EndPoint remoteEndPoint)
-        {
-            object[] packedArguments = new object[] { socket, remoteEndPoint };
-
-            return Task<SocketReceiveFromResult>.Factory.FromAsync(
-                (targetBuffer, flags, callback, state) =>
-                {
-                    var arguments = (object[])state;
-                    var s = (Socket)arguments[0];
-                    var e = (EndPoint)arguments[1];
-
-                    IAsyncResult result = s.BeginReceiveFrom(
-                        targetBuffer.Array,
-                        targetBuffer.Offset,
-                        targetBuffer.Count,
-                        flags,
-                        ref e,
-                        callback,
-                        state);
-
-                    arguments[1] = e;
-                    return result;
-                },
-                asyncResult =>
-                {
-                    var arguments = (object[])asyncResult.AsyncState;
-                    var s = (Socket)arguments[0];
-                    var e = (EndPoint)arguments[1];
-
-                    int bytesReceived = s.EndReceiveFrom(asyncResult, ref e);
-
-                    return new SocketReceiveFromResult()
-                    {
-                        ReceivedBytes = bytesReceived,
-                        RemoteEndPoint = e
-                    };
-                },
-                buffer,
-                socketFlags,
-                state: packedArguments);
-        }
-
-        public static Task<SocketReceiveMessageFromResult> ReceiveMessageFromAsync(
-            this Socket socket,
-            ArraySegment<byte> buffer,
-            SocketFlags socketFlags,
-            EndPoint remoteEndPoint)
-        {
-            object[] packedArguments = new object[] { socket, socketFlags, remoteEndPoint };
-
-            return Task<SocketReceiveMessageFromResult>.Factory.FromAsync(
-                (targetBuffer, callback, state) =>
-                {
-                    var arguments = (object[])state;
-                    var s = (Socket)arguments[0];
-                    var f = (SocketFlags)arguments[1];
-                    var e = (EndPoint)arguments[2];
-
-                    IAsyncResult result = s.BeginReceiveMessageFrom(
-                        targetBuffer.Array,
-                        targetBuffer.Offset,
-                        targetBuffer.Count,
-                        f,
-                        ref e,
-                        callback,
-                        state);
-
-                    arguments[2] = e;
-                    return result;
-                },
-                asyncResult =>
-                {
-                    var arguments = (object[])asyncResult.AsyncState;
-                    var s = (Socket)arguments[0];
-                    var f = (SocketFlags)arguments[1];
-                    var e = (EndPoint)arguments[2];
-                    IPPacketInformation ipPacket;
-
-                    int bytesReceived = s.EndReceiveMessageFrom(
-                        asyncResult,
-                        ref f,
-                        ref e,
-                        out ipPacket);
-
-                    return new SocketReceiveMessageFromResult()
-                    {
-                        PacketInformation = ipPacket,
-                        ReceivedBytes = bytesReceived,
-                        RemoteEndPoint = e,
-                        SocketFlags = f
-                    };
-                },
-                buffer,
-                state: packedArguments);
-        }
-
-        public static Task<int> SendAsync(this Socket socket, ArraySegment<byte> buffer, SocketFlags socketFlags)
-        {
-            return Task<int>.Factory.FromAsync(
-                (targetBuffer, flags, callback, state) => ((Socket)state).BeginSend(
-                                                              targetBuffer.Array,
-                                                              targetBuffer.Offset,
-                                                              targetBuffer.Count,
-                                                              flags,
-                                                              callback,
-                                                              state),
-                asyncResult => ((Socket)asyncResult.AsyncState).EndSend(asyncResult),
-                buffer,
-                socketFlags,
-                state: socket);
-        }
-
-        public static Task<int> SendAsync(
-            this Socket socket,
-            IList<ArraySegment<byte>> buffers,
-            SocketFlags socketFlags)
-        {
-            return Task<int>.Factory.FromAsync(
-                (targetBuffers, flags, callback, state) => ((Socket)state).BeginSend(targetBuffers, flags, callback, state),
-                asyncResult => ((Socket)asyncResult.AsyncState).EndSend(asyncResult),
-                buffers,
-                socketFlags,
-                state: socket);
-        }
-
-        public static Task<int> SendToAsync(
-            this Socket socket,
-            ArraySegment<byte> buffer,
-            SocketFlags socketFlags,
-            EndPoint remoteEP)
-        {
-            return Task<int>.Factory.FromAsync(
-                (targetBuffer, flags, endPoint, callback, state) => ((Socket)state).BeginSendTo(
-                                                                        targetBuffer.Array,
-                                                                        targetBuffer.Offset,
-                                                                        targetBuffer.Count,
-                                                                        flags,
-                                                                        endPoint,
-                                                                        callback,
-                                                                        state),
-                asyncResult => ((Socket)asyncResult.AsyncState).EndSendTo(asyncResult),
-                buffer,
-                socketFlags,
-                remoteEP,
-                state: socket);
-        }
-    }
-}
\ No newline at end of file
index a4cab35a66bc194d0b4d44ce6aba3335088ac771..719628dc7c61ac7d0444434320134bf5305b7f73 100644 (file)
@@ -1,5 +1,2 @@
 TypeForwarders.cs
 AssemblyInfo.cs
-SocketReceiveFromResult.cs
-SocketReceiveMessageFromResult.cs
-SocketTaskExtensions.cs
index b27fc8622edeb847c80c6c19bac7d981af2942e5..27258a0831aaea109cbb2b1420fa396ee1cc6147 100644 (file)
@@ -46,4 +46,8 @@
 [assembly: System.Runtime.CompilerServices.TypeForwardedToAttribute(typeof(System.Net.Sockets.UdpClient))]
 [assembly: System.Runtime.CompilerServices.TypeForwardedToAttribute(typeof(System.Net.Sockets.UdpReceiveResult))]
 
-
+#if NETSTANDARD
+[assembly: System.Runtime.CompilerServices.TypeForwardedToAttribute(typeof(System.Net.Sockets.SocketReceiveFromResult))]
+[assembly: System.Runtime.CompilerServices.TypeForwardedToAttribute(typeof(System.Net.Sockets.SocketReceiveMessageFromResult))]
+[assembly: System.Runtime.CompilerServices.TypeForwardedToAttribute(typeof(System.Net.Sockets.SocketTaskExtensions))]
+#endif
index ea7e128a3f01c52de628895687af170131cc3bcf..aa5b54c83f9bbf51a2a45fe22a64c38b2fca451e 100644 (file)
@@ -6,6 +6,13 @@ LIBRARY = Mono.Btls.Interface.dll
 LIB_REFS = System Mono.Security
 LIB_MCS_FLAGS = -unsafe -nowarn:1030 -keyfile:../mono.pub -delaysign -d:SECURITY_DEP
 
+ifndef HAVE_BTLS
+NO_INSTALL = yes
+NO_SIGN_ASSEMBLY = yes
+NO_TEST = yes
+NO_BUILD = yes
+endif
+
 include ../../build/library.make
 
 $(the_lib): ../Mono.Security/Makefile
index 4d142314b9efb96d53d59d4ab4b061ccf22d780d..acd269f5c4e3dcec29a7524fc9fecfa536c17d41 100644 (file)
@@ -682,6 +682,7 @@ namespace Mono.CompilerServices.SymbolWriter
                byte[] hash;
                bool creating;
                bool auto_generated;
+               readonly string sourceFile;
 
                public static int Size {
                        get { return 8; }
@@ -696,11 +697,17 @@ namespace Mono.CompilerServices.SymbolWriter
                        creating = true;
                }
 
-               public SourceFileEntry (MonoSymbolFile file, string file_name, byte[] guid, byte[] checksum)
-                       : this (file, file_name)
+               public SourceFileEntry (MonoSymbolFile file, string sourceFile, byte [] guid, byte [] checksum)
+                       : this (file, sourceFile, sourceFile, guid, checksum)
+               {
+               }
+
+               public SourceFileEntry (MonoSymbolFile file, string fileName, string sourceFile, byte[] guid, byte[] checksum)
+                       : this (file, fileName)
                {
                        this.guid = guid;
                        this.hash = checksum;
+                       this.sourceFile = sourceFile;
                }
 
                public byte[] Checksum {
@@ -719,7 +726,7 @@ namespace Mono.CompilerServices.SymbolWriter
 
                        if (hash == null) {
                                try {
-                                   using (FileStream fs = new FileStream (file_name, FileMode.Open, FileAccess.Read)) {
+                                   using (FileStream fs = new FileStream (sourceFile, FileMode.Open, FileAccess.Read)) {
                                        MD5 md5 = MD5.Create ();
                                        hash = md5.ComputeHash (fs);
                                    }
@@ -749,7 +756,7 @@ namespace Mono.CompilerServices.SymbolWriter
                        int old_pos = (int) reader.BaseStream.Position;
                        reader.BaseStream.Position = DataOffset;
 
-                       file_name = reader.ReadString ();
+                       sourceFile = file_name = reader.ReadString ();
                        guid = reader.ReadBytes (16);
                        hash = reader.ReadBytes (16);
                        auto_generated = reader.ReadByte () == 1;
@@ -778,7 +785,7 @@ namespace Mono.CompilerServices.SymbolWriter
                public bool CheckChecksum ()
                {
                        try {
-                               using (FileStream fs = new FileStream (file_name, FileMode.Open)) {
+                               using (FileStream fs = new FileStream (sourceFile, FileMode.Open)) {
                                        MD5 md5 = MD5.Create ();
                                        byte[] data = md5.ComputeHash (fs);
                                        for (int i = 0; i < 16; i++)
index f92ad900e84de0dc65e7169d767c6164d76139da..89f9aaed0748d2760ef74c49be8c6763426889de 100644 (file)
@@ -72,7 +72,7 @@ namespace Mono.Security.Protocol.Tls.Handshake.Client
 
                private void GetClientCertificate ()
                {
-#warning "Client certificate selection is unfinished"
+// TODO: Client certificate selection is unfinished
                        ClientContext context = (ClientContext)this.Context;
 
                        // note: the server may ask for mutual authentication 
index b3831248d425de52dae3104c78ee4362e4ca1334..f741f95a7daf8097d8900daa2f32cd2c480bdb7a 100644 (file)
@@ -73,7 +73,7 @@ namespace Mono.Security.Protocol.Tls.Handshake.Client
                        // Check server prf against client prf
                        if (!Compare (clientHash, serverHash))
                        {
-#warning Review that selected alert is correct
+// TODO: Review that selected alert is correct
                                throw new TlsException(AlertDescription.InsuficientSecurity, "Invalid ServerFinished message received.");
                        }
                }
index e2e8aaeba0c3fb58714b37f5cf13f816bf618d68..0c5768009b5b299ad165eca954ad455a1c04867e 100644 (file)
@@ -46,12 +46,8 @@ namespace Microsoft.Win32.SafeHandles
 
                protected override bool ReleaseHandle ()
                {
-                       try {
-                               Marshal.FreeHGlobal (handle);
-                               return true;
-                       } catch (ArgumentException) {
-                               return false;
-                       }
+                       MonoIOError error;
+                       return MonoIO.Close (handle, out error);
                }
        }
 }
index 65bb1294281006da2f3effc7bbc58ddeae3b553d..e05da6cf2f53ca01a425e19b8d78e2599c65ca55 100644 (file)
     <Compile Include="System.Security.Cryptography\ECCurve.cs" />\r
     <Compile Include="System.Security.Cryptography\ECParameters.cs" />\r
     <Compile Include="System.Security.Cryptography\ECPoint.cs" />\r
-    <Compile Include="System.Security.Cryptography\IncrementalHash.cs" />\r
     <Compile Include="System.Security.Cryptography\MD5Cng.cs" />\r
     <Compile Include="System.Security.Cryptography\SHA1Cng.cs" />\r
     <Compile Include="System.Security.Cryptography\SHA256Cng.cs" />\r
index 9668c39f9fb417cae998d94b3d10647d96f9037d..65cc4052217dad1da21a3d6ab0cc2a0925745fc2 100644 (file)
     <Compile Include="System.Security.Cryptography\ECCurve.cs" />\r
     <Compile Include="System.Security.Cryptography\ECParameters.cs" />\r
     <Compile Include="System.Security.Cryptography\ECPoint.cs" />\r
-    <Compile Include="System.Security.Cryptography\IncrementalHash.cs" />\r
     <Compile Include="System.Security.Cryptography\MD5Cng.cs" />\r
     <Compile Include="System.Security.Cryptography\SHA1Cng.cs" />\r
     <Compile Include="System.Security.Cryptography\SHA256Cng.cs" />\r
diff --git a/mcs/class/System.Core/System.Security.Cryptography/IncrementalHash.cs b/mcs/class/System.Core/System.Security.Cryptography/IncrementalHash.cs
deleted file mode 100644 (file)
index 14c895e..0000000
+++ /dev/null
@@ -1,46 +0,0 @@
-//
-// IncrementalHash.cs
-//
-// Authors:
-//     Marek Safar  <marek.safar@gmail.com>
-//
-// Copyright (C) 2016 Xamarin Inc (http://www.xamarin.com)
-//
-// Permission is hereby granted, free of charge, to any person obtaining
-// a copy of this software and associated documentation files (the
-// "Software"), to deal in the Software without restriction, including
-// without limitation the rights to use, copy, modify, merge, publish,
-// distribute, sublicense, and/or sell copies of the Software, and to
-// permit persons to whom the Software is furnished to do so, subject to
-// the following conditions:
-//
-// The above copyright notice and this permission notice shall be
-// included in all copies or substantial portions of the Software.
-//
-// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
-// EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
-// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
-// NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
-// LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
-// OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
-// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
-//
-
-#if NETSTANDARD
-
-namespace System.Security.Cryptography
-{
-    public sealed class IncrementalHash : IDisposable
-    {
-        private IncrementalHash () { }
-        public HashAlgorithmName AlgorithmName { get { throw new NotImplementedException (); } }
-        public void AppendData (byte[] data) { }
-        public void AppendData (byte[] data, int offset, int count) { }
-        public static IncrementalHash CreateHash (HashAlgorithmName hashAlgorithm) { throw new NotImplementedException (); }
-        public static IncrementalHash CreateHMAC (HashAlgorithmName hashAlgorithm, byte[] key) { throw new NotImplementedException (); }
-        public void Dispose () { }
-        public byte[] GetHashAndReset () { throw new NotImplementedException (); }
-    }
-}
-
-#endif
\ No newline at end of file
index 6e36c961e353774dd0f024fb71287f0911d7f8aa..52dad5c3c18ca9ddbcb78697c3f48b87e206a1be 100644 (file)
@@ -232,4 +232,3 @@ ReferenceSources/Strings.cs
 System.Security.Cryptography/ECCurve.cs
 System.Security.Cryptography/ECPoint.cs
 System.Security.Cryptography/ECParameters.cs
-System.Security.Cryptography/IncrementalHash.cs
index fdfb7c293a4ecd9d2bff6567df57c55c2a693683..e9ab8a4118c4cd669440e0b4c97da16bd00a3137 100644 (file)
@@ -40,7 +40,19 @@ REFERENCE_SOURCES_FLAGS += -d:MONO_FEATURE_PROCESS_START
 TEST_MCS_FLAGS += -d:MONO_FEATURE_PROCESS_START
 endif
 
-LIB_MCS_FLAGS = -nowarn:618 -d:CONFIGURATION_2_0 $(REFERENCE_SOURCES_FLAGS) -unsafe $(RESOURCE_FILES:%=-resource:%)
+LIB_MCS_FLAGS = -d:CONFIGURATION_2_0 $(REFERENCE_SOURCES_FLAGS) -unsafe $(RESOURCE_FILES:%=-resource:%)
+
+ifndef PROFILE_DISABLE_BTLS
+ifdef HAVE_BTLS
+
+LIB_MCS_FLAGS += -d:MONO_FEATURE_BTLS
+
+ifdef HAVE_DYNAMIC_BTLS
+LIB_MCS_FLAGS += -d:MONO_FEATURE_DYNAMIC_BTLS
+endif
+
+endif
+endif
 
 ifndef NO_THREAD_ABORT
 REFERENCE_SOURCES_FLAGS += -d:MONO_FEATURE_THREAD_ABORT
@@ -63,7 +75,7 @@ TXT_RESOURCE_STRINGS = ../referencesource/System/System.txt
 # MOBILE_PROFILE needs SECURITY_DEP
 #
 ifdef MOBILE_PROFILE
-LIB_MCS_FLAGS += -d:INSIDE_SYSTEM -d:SECURITY_DEP
+LIB_MCS_FLAGS += -d:INSIDE_SYSTEM -d:SECURITY_DEP -nowarn:618,1635
 else
 EXTERN_ALIAS_FLAGS = -d:MONO_SECURITY_ALIAS
 endif
index 1fbe47117d17a3ad8f1a273c9d47069e61379cf1..204d167928974c609463c4c561847fd0278d810d 100644 (file)
@@ -23,7 +23,7 @@
 // LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
 // OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
 // THE SOFTWARE.
-#if SECURITY_DEP
+#if SECURITY_DEP && MONO_FEATURE_BTLS
 using System;
 using System.IO;
 using System.Text;
@@ -70,25 +70,25 @@ namespace Mono.Btls
                        return MonoBtlsBioMono.CreateStream (stream, false);
                }
 
-               [MethodImpl (MethodImplOptions.InternalCall)]
+               [DllImport (BTLS_DYLIB)]
                extern static int mono_btls_bio_read (IntPtr bio, IntPtr data, int len);
 
-               [MethodImpl (MethodImplOptions.InternalCall)]
+               [DllImport (BTLS_DYLIB)]
                extern static int mono_btls_bio_write (IntPtr bio, IntPtr data, int len);
 
-               [MethodImpl (MethodImplOptions.InternalCall)]
+               [DllImport (BTLS_DYLIB)]
                extern static int mono_btls_bio_flush (IntPtr bio);
 
-               [MethodImpl (MethodImplOptions.InternalCall)]
+               [DllImport (BTLS_DYLIB)]
                extern static int mono_btls_bio_indent (IntPtr bio, uint indent, uint max_indent);
 
-               [MethodImpl (MethodImplOptions.InternalCall)]
+               [DllImport (BTLS_DYLIB)]
                extern static int mono_btls_bio_hexdump (IntPtr bio, IntPtr data, int len, uint indent);
 
-               [MethodImpl (MethodImplOptions.InternalCall)]
+               [DllImport (BTLS_DYLIB)]
                extern static void mono_btls_bio_print_errors (IntPtr bio);
 
-               [MethodImpl (MethodImplOptions.InternalCall)]
+               [DllImport (BTLS_DYLIB)]
                extern static void mono_btls_bio_free (IntPtr handle);
 
                public int Read (byte[] buffer, int offset, int size)
@@ -192,10 +192,10 @@ namespace Mono.Btls
 
        class MonoBtlsBioMemory : MonoBtlsBio
        {
-               [MethodImpl (MethodImplOptions.InternalCall)]
+               [DllImport (BTLS_DYLIB)]
                extern static IntPtr mono_btls_bio_mem_new ();
 
-               [MethodImpl (MethodImplOptions.InternalCall)]
+               [DllImport (BTLS_DYLIB)]
                extern static int mono_btls_bio_mem_get_data (IntPtr handle, out IntPtr data);
 
                public MonoBtlsBioMemory ()
@@ -278,10 +278,10 @@ namespace Mono.Btls
                delegate int BioWriteFunc (IntPtr bio, IntPtr data, int dataLength);
                delegate long BioControlFunc (IntPtr bio, ControlCommand command, long arg);
 
-               [MethodImpl (MethodImplOptions.InternalCall)]
+               [DllImport (BTLS_DYLIB)]
                extern static IntPtr mono_btls_bio_mono_new ();
 
-               [MethodImpl (MethodImplOptions.InternalCall)]
+               [DllImport (BTLS_DYLIB)]
                extern static void mono_btls_bio_mono_initialize (IntPtr handle, IntPtr instance, IntPtr readFunc, IntPtr writeFunc, IntPtr controlFunc);
 
                long Control (ControlCommand command, long arg)
index c06688dc86eee8fdd083e5f42ce1c9c06bce3472..e4054a173c8d3e5c221b5bbb2f6a4995a52f2237 100644 (file)
@@ -23,7 +23,7 @@
 // LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
 // OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
 // THE SOFTWARE.
-#if SECURITY_DEP
+#if SECURITY_DEP && MONO_FEATURE_BTLS
 #if MONO_SECURITY_ALIAS
 extern alias MonoSecurity;
 #endif
@@ -154,12 +154,9 @@ namespace Mono.Btls
                        }
                }
 
-               Exception GetException (MonoBtlsSslError status)
+               static Exception GetException (MonoBtlsSslError status)
                {
                        var error = MonoBtlsError.GetError ();
-                       if (error == null)
-                               return new MonoBtlsException (status);
-
                        var text = MonoBtlsError.GetErrorString (error);
                        return new MonoBtlsException ("{0} {1}", status, text);
                }
index 2645a926bc396c0f58d422a2a7cd984872f073cb..5e61bcf04634b91e2c80d4c93668ddd9ebae6034 100644 (file)
@@ -23,7 +23,7 @@
 // LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
 // OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
 // THE SOFTWARE.
-// #if SECURITY_DEP
+#if SECURITY_DEP && MONO_FEATURE_BTLS
 using System;
 using System.IO;
 using System.Text;
@@ -38,16 +38,16 @@ namespace Mono.Btls
 {
        static class MonoBtlsError
        {
-               [MethodImpl (MethodImplOptions.InternalCall)]
+               [DllImport (MonoBtlsObject.BTLS_DYLIB)]
                extern static int mono_btls_error_peek_error ();
 
-               [MethodImpl (MethodImplOptions.InternalCall)]
+               [DllImport (MonoBtlsObject.BTLS_DYLIB)]
                extern static int mono_btls_error_get_error ();
 
-               [MethodImpl (MethodImplOptions.InternalCall)]
+               [DllImport (MonoBtlsObject.BTLS_DYLIB)]
                extern static void mono_btls_error_clear_error ();
 
-               [MethodImpl (MethodImplOptions.InternalCall)]
+               [DllImport (MonoBtlsObject.BTLS_DYLIB)]
                extern static void mono_btls_error_get_error_string_n (int error, IntPtr buf, int len);
 
                public static int PeekError ()
@@ -80,4 +80,4 @@ namespace Mono.Btls
                }
        }
 }
-// #endif
+#endif
index bf6b163f95f7ad6bb710cc80815a882b45d0b91a..44282c97ec51f153011d010bac80d364447df5de 100644 (file)
@@ -23,7 +23,7 @@
 // LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
 // OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
 // THE SOFTWARE.
-#if SECURITY_DEP
+#if SECURITY_DEP && MONO_FEATURE_BTLS
 using System;
 
 namespace Mono.Btls
index 81280b54ece80f8580681a88adee175a04727daa..f0cc3764d6835b6cad2866ff1702ef4d8ce3d52a 100644 (file)
@@ -23,7 +23,7 @@
 // LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
 // OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
 // THE SOFTWARE.
-#if SECURITY_DEP
+#if SECURITY_DEP && MONO_FEATURE_BTLS
 using System;
 using System.IO;
 using System.Text;
@@ -48,19 +48,19 @@ namespace Mono.Btls
                        }
                }
 
-               [MethodImpl (MethodImplOptions.InternalCall)]
+               [DllImport (BTLS_DYLIB)]
                extern static void mono_btls_key_free (IntPtr handle);
 
-               [MethodImpl (MethodImplOptions.InternalCall)]
+               [DllImport (BTLS_DYLIB)]
                extern static IntPtr mono_btls_key_up_ref (IntPtr handle);
 
-               [MethodImpl (MethodImplOptions.InternalCall)]
+               [DllImport (BTLS_DYLIB)]
                extern static int mono_btls_key_get_bytes (IntPtr handle, out IntPtr data, out int size, int include_private_bits);
 
-               [MethodImpl (MethodImplOptions.InternalCall)]
+               [DllImport (BTLS_DYLIB)]
                extern static int mono_btls_key_get_bits (IntPtr handle);
 
-               [MethodImpl (MethodImplOptions.InternalCall)]
+               [DllImport (BTLS_DYLIB)]
                extern static int mono_btls_key_is_rsa (IntPtr handle);
 
                new internal BoringKeyHandle Handle {
index 8f3054318fe03c3b4f7a8b0efd16569028a0a1aa..fd267d49f642961efb99e6fe5c94f7354e4af690 100644 (file)
@@ -23,7 +23,7 @@
 // LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
 // OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
 // THE SOFTWARE.
-#if SECURITY_DEP
+#if SECURITY_DEP && MONO_FEATURE_BTLS
 using System;
 using System.Threading;
 using System.Runtime.InteropServices;
@@ -33,6 +33,12 @@ namespace Mono.Btls
 {
        abstract class MonoBtlsObject : IDisposable
        {
+#if MONO_FEATURE_DYNAMIC_BTLS
+               internal const string BTLS_DYLIB = "libmono-btls-shared";
+#else
+               internal const string BTLS_DYLIB = "__Internal";
+#endif
+
                internal MonoBtlsObject (MonoBtlsHandle handle)
                {
                        this.handle = handle;
@@ -100,7 +106,7 @@ namespace Mono.Btls
                        CheckError (ret == 1, callerName);
                }
 
-               [MethodImpl (MethodImplOptions.InternalCall)]
+               [DllImport (BTLS_DYLIB)]
                extern static void mono_btls_free (IntPtr data);
 
                protected void FreeDataPtr (IntPtr data)
index a7d42a190b441406430c5635015b200217dd2c35..92e432092b645b7245a3c9dc482e6e2cd44d0b43 100644 (file)
@@ -23,7 +23,7 @@
 // LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
 // OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
 // THE SOFTWARE.
-#if SECURITY_DEP
+#if SECURITY_DEP && MONO_FEATURE_BTLS
 using System;
 using System.IO;
 using System.Security.Cryptography.X509Certificates;
@@ -52,28 +52,28 @@ namespace Mono.Btls
                        get { return (BoringPkcs12Handle)base.Handle; }
                }
 
-               [MethodImpl (MethodImplOptions.InternalCall)]
+               [DllImport (BTLS_DYLIB)]
                extern static void mono_btls_pkcs12_free (IntPtr handle);
 
-               [MethodImpl (MethodImplOptions.InternalCall)]
+               [DllImport (BTLS_DYLIB)]
                extern static IntPtr mono_btls_pkcs12_new ();
 
-               [MethodImpl (MethodImplOptions.InternalCall)]
+               [DllImport (BTLS_DYLIB)]
                extern static int mono_btls_pkcs12_get_count (IntPtr handle);
 
-               [MethodImpl (MethodImplOptions.InternalCall)]
+               [DllImport (BTLS_DYLIB)]
                extern static IntPtr mono_btls_pkcs12_get_cert (IntPtr Handle, int index);
 
-               [MethodImpl (MethodImplOptions.InternalCall)]
+               [DllImport (BTLS_DYLIB)]
                extern static int mono_btls_pkcs12_add_cert (IntPtr chain, IntPtr x509);
 
-               [MethodImpl (MethodImplOptions.InternalCall)]
+               [DllImport (BTLS_DYLIB)]
                extern unsafe static int mono_btls_pkcs12_import (IntPtr chain, void* data, int len, IntPtr password);
 
-               [MethodImpl (MethodImplOptions.InternalCall)]
+               [DllImport (BTLS_DYLIB)]
                extern static int mono_btls_pkcs12_has_private_key (IntPtr pkcs12);
 
-               [MethodImpl (MethodImplOptions.InternalCall)]
+               [DllImport (BTLS_DYLIB)]
                extern static IntPtr mono_btls_pkcs12_get_private_key (IntPtr pkcs12);
 
                internal MonoBtlsPkcs12 ()
index 5e1e3b1507aa163b3baf85c493370e931e1b4a95..b3005858631d826a1c9b695e3f5ef22c15b4bff1 100644 (file)
@@ -23,7 +23,7 @@
 // LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
 // OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
 // THE SOFTWARE.
-#if SECURITY_DEP
+#if SECURITY_DEP && MONO_FEATURE_BTLS
 #if MONO_SECURITY_ALIAS
 extern alias MonoSecurity;
 #endif
index b24ed079ab1c8fa243c266f3b481bc7c3b4d2065..d7510901357fdb925c7cd32cd7df98e6794cf912 100644 (file)
@@ -23,7 +23,7 @@
 // LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
 // OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
 // THE SOFTWARE.
-#if SECURITY_DEP
+#if SECURITY_DEP && MONO_FEATURE_BTLS
 using System;
 using System.IO;
 using System.Text;
@@ -55,73 +55,73 @@ namespace Mono.Btls
                        }
                }
 
-               [MethodImpl (MethodImplOptions.InternalCall)]
+               [DllImport (BTLS_DYLIB)]
                extern static void mono_btls_ssl_destroy (IntPtr handle);
 
-               [MethodImpl (MethodImplOptions.InternalCall)]
+               [DllImport (BTLS_DYLIB)]
                extern static IntPtr mono_btls_ssl_new (IntPtr handle);
 
-               [MethodImpl (MethodImplOptions.InternalCall)]
+               [DllImport (BTLS_DYLIB)]
                extern static int mono_btls_ssl_use_certificate (IntPtr handle, IntPtr x509);
 
-               [MethodImpl (MethodImplOptions.InternalCall)]
+               [DllImport (BTLS_DYLIB)]
                extern static int mono_btls_ssl_use_private_key (IntPtr handle, IntPtr key);
 
-               [MethodImpl (MethodImplOptions.InternalCall)]
+               [DllImport (BTLS_DYLIB)]
                extern static int mono_btls_ssl_add_chain_certificate (IntPtr handle, IntPtr x509);
 
-               [MethodImpl (MethodImplOptions.InternalCall)]
+               [DllImport (BTLS_DYLIB)]
                extern static int mono_btls_ssl_accept (IntPtr handle);
 
-               [MethodImpl (MethodImplOptions.InternalCall)]
+               [DllImport (BTLS_DYLIB)]
                extern static int mono_btls_ssl_connect (IntPtr handle);
 
-               [MethodImpl (MethodImplOptions.InternalCall)]
+               [DllImport (BTLS_DYLIB)]
                extern static int mono_btls_ssl_handshake (IntPtr handle);
 
-               [MethodImpl (MethodImplOptions.InternalCall)]
+               [DllImport (BTLS_DYLIB)]
                extern static void mono_btls_ssl_close (IntPtr handle);
 
-               [MethodImpl (MethodImplOptions.InternalCall)]
+               [DllImport (BTLS_DYLIB)]
                extern static void mono_btls_ssl_set_bio (IntPtr handle, IntPtr bio);
 
-               [MethodImpl (MethodImplOptions.InternalCall)]
+               [DllImport (BTLS_DYLIB)]
                extern static int mono_btls_ssl_read (IntPtr handle, IntPtr data, int len);
 
-               [MethodImpl (MethodImplOptions.InternalCall)]
+               [DllImport (BTLS_DYLIB)]
                extern static int mono_btls_ssl_write (IntPtr handle, IntPtr data, int len);
 
-               [MethodImpl (MethodImplOptions.InternalCall)]
+               [DllImport (BTLS_DYLIB)]
                extern static int mono_btls_ssl_get_error (IntPtr handle, int ret_code);
 
-               [MethodImpl (MethodImplOptions.InternalCall)]
+               [DllImport (BTLS_DYLIB)]
                extern static int mono_btls_ssl_get_version (IntPtr handle);
 
-               [MethodImpl (MethodImplOptions.InternalCall)]
+               [DllImport (BTLS_DYLIB)]
                extern static void mono_btls_ssl_set_min_version (IntPtr handle, int version);
 
-               [MethodImpl (MethodImplOptions.InternalCall)]
+               [DllImport (BTLS_DYLIB)]
                extern static void mono_btls_ssl_set_max_version (IntPtr handle, int version);
 
-               [MethodImpl (MethodImplOptions.InternalCall)]
+               [DllImport (BTLS_DYLIB)]
                extern static int mono_btls_ssl_get_cipher (IntPtr handle);
 
-               [MethodImpl (MethodImplOptions.InternalCall)]
+               [DllImport (BTLS_DYLIB)]
                extern static int mono_btls_ssl_get_ciphers (IntPtr handle, out IntPtr data);
 
-               [MethodImpl (MethodImplOptions.InternalCall)]
+               [DllImport (BTLS_DYLIB)]
                extern static IntPtr mono_btls_ssl_get_peer_certificate (IntPtr handle);
 
-               [MethodImpl (MethodImplOptions.InternalCall)]
+               [DllImport (BTLS_DYLIB)]
                extern static int mono_btls_ssl_set_cipher_list (IntPtr handle, IntPtr str);
 
-               [MethodImpl (MethodImplOptions.InternalCall)]
+               [DllImport (BTLS_DYLIB)]
                extern static void mono_btls_ssl_print_errors_cb (IntPtr func, IntPtr ctx);
 
-               [MethodImpl (MethodImplOptions.InternalCall)]
+               [DllImport (BTLS_DYLIB)]
                extern static int mono_btls_ssl_set_verify_param (IntPtr handle, IntPtr param);
 
-               [MethodImpl (MethodImplOptions.InternalCall)]
+               [DllImport (BTLS_DYLIB)]
                extern static int mono_btls_ssl_set_server_name (IntPtr handle, IntPtr name);
 
                static BoringSslHandle Create_internal (MonoBtlsSslCtx ctx)
index 517b158b8e0d1582d78637b9f20ddafc592574ea..fd9b6f1b629bf75d71cf86afc9354b250ab8043d 100644 (file)
@@ -23,7 +23,7 @@
 // LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
 // OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
 // THE SOFTWARE.
-#if SECURITY_DEP
+#if SECURITY_DEP && MONO_FEATURE_BTLS
 using System;
 using System.Runtime.CompilerServices;
 using System.Runtime.InteropServices;
@@ -54,40 +54,40 @@ namespace Mono.Btls
                        get { return (BoringSslCtxHandle)base.Handle; }
                }
 
-               [MethodImpl (MethodImplOptions.InternalCall)]
+               [DllImport (BTLS_DYLIB)]
                extern static IntPtr mono_btls_ssl_ctx_new ();
 
-               [MethodImpl (MethodImplOptions.InternalCall)]
+               [DllImport (BTLS_DYLIB)]
                extern static int mono_btls_ssl_ctx_free (IntPtr handle);
 
-               [MethodImpl (MethodImplOptions.InternalCall)]
+               [DllImport (BTLS_DYLIB)]
                extern static IntPtr mono_btls_ssl_ctx_up_ref (IntPtr handle);
 
-               [MethodImpl (MethodImplOptions.InternalCall)]
+               [DllImport (BTLS_DYLIB)]
                extern static void mono_btls_ssl_ctx_initialize (IntPtr handle, IntPtr instance);
 
-               [MethodImpl (MethodImplOptions.InternalCall)]
+               [DllImport (BTLS_DYLIB)]
                extern static void mono_btls_ssl_ctx_set_debug_bio (IntPtr handle, IntPtr bio);
 
-               [MethodImpl (MethodImplOptions.InternalCall)]
+               [DllImport (BTLS_DYLIB)]
                extern static void mono_btls_ssl_ctx_set_cert_verify_callback (IntPtr handle, IntPtr func, int cert_required);
 
-               [MethodImpl (MethodImplOptions.InternalCall)]
+               [DllImport (BTLS_DYLIB)]
                extern static void mono_btls_ssl_ctx_set_cert_select_callback (IntPtr handle, IntPtr func);
 
-               [MethodImpl (MethodImplOptions.InternalCall)]
+               [DllImport (BTLS_DYLIB)]
                extern static void mono_btls_ssl_ctx_set_min_version (IntPtr handle, int version);
 
-               [MethodImpl (MethodImplOptions.InternalCall)]
+               [DllImport (BTLS_DYLIB)]
                extern static void mono_btls_ssl_ctx_set_max_version (IntPtr handle, int version);
 
-               [MethodImpl (MethodImplOptions.InternalCall)]
+               [DllImport (BTLS_DYLIB)]
                extern static int mono_btls_ssl_ctx_is_cipher_supported (IntPtr handle, short value);
 
-               [MethodImpl (MethodImplOptions.InternalCall)]
+               [DllImport (BTLS_DYLIB)]
                extern static int mono_btls_ssl_ctx_set_ciphers (IntPtr handle, int count, IntPtr data, int allow_unsupported);
 
-               [MethodImpl (MethodImplOptions.InternalCall)]
+               [DllImport (BTLS_DYLIB)]
                extern static int mono_btls_ssl_ctx_set_verify_param (IntPtr handle, IntPtr param);
 
                delegate int NativeVerifyFunc (IntPtr instance, int preverify_ok, IntPtr ctx);
index 38f6f4fb0e732ecf88a928aef94642cb8c874967..432ba5d036a4f2336dfd408592d9865405b0c339 100644 (file)
@@ -23,7 +23,7 @@
 // LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
 // OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
 // THE SOFTWARE.
-#if SECURITY_DEP
+#if SECURITY_DEP && MONO_FEATURE_BTLS
 namespace Mono.Btls
 {
        // keep in sync with boringssl/include/ssl.h
index d2f32e98c659a8decd453b987721804bbb25450c..38b6d83a4d6706ca62b1158e567f0ed2472faf38 100644 (file)
@@ -23,7 +23,7 @@
 // LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
 // OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
 // THE SOFTWARE.
-#if SECURITY_DEP
+#if SECURITY_DEP && MONO_FEATURE_BTLS
 #if MONO_SECURITY_ALIAS
 extern alias MonoSecurity;
 #endif
index 63dba5d698778162568e0b5695a18151fa7a9765..41759681958952cb63f605af81381fbd58aef30e 100644 (file)
@@ -23,7 +23,7 @@
 // LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
 // OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
 // THE SOFTWARE.
-#if SECURITY_DEP
+#if SECURITY_DEP && MONO_FEATURE_BTLS
 using System;
 using System.Text;
 using System.Security.Cryptography.X509Certificates;
index 31ec45810529027bb14b9d15920eaf0e2e98efee..c722ad9fbfd3ac54f082b7ada8445166480502fb 100644 (file)
@@ -23,7 +23,7 @@
 // LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
 // OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
 // THE SOFTWARE.
-#if SECURITY_DEP
+#if SECURITY_DEP && MONO_FEATURE_BTLS
 using System;
 using System.IO;
 using System.Text;
@@ -67,79 +67,79 @@ namespace Mono.Btls
                {
                }
 
-               [MethodImpl (MethodImplOptions.InternalCall)]
+               [DllImport (BTLS_DYLIB)]
                extern static IntPtr mono_btls_x509_up_ref (IntPtr handle);
 
-               [MethodImpl (MethodImplOptions.InternalCall)]
+               [DllImport (BTLS_DYLIB)]
                extern static IntPtr mono_btls_x509_from_data (IntPtr data, int len, MonoBtlsX509Format format);
 
-               [MethodImpl (MethodImplOptions.InternalCall)]
+               [DllImport (BTLS_DYLIB)]
                extern static IntPtr mono_btls_x509_get_subject_name (IntPtr handle);
 
-               [MethodImpl (MethodImplOptions.InternalCall)]
+               [DllImport (BTLS_DYLIB)]
                extern static IntPtr mono_btls_x509_get_issuer_name (IntPtr handle);
 
-               [MethodImpl (MethodImplOptions.InternalCall)]
+               [DllImport (BTLS_DYLIB)]
                extern static int mono_btls_x509_get_subject_name_string (IntPtr handle, IntPtr buffer, int size);
 
-               [MethodImpl (MethodImplOptions.InternalCall)]
+               [DllImport (BTLS_DYLIB)]
                extern static int mono_btls_x509_get_issuer_name_string (IntPtr handle, IntPtr buffer, int size);
 
-               [MethodImpl (MethodImplOptions.InternalCall)]
+               [DllImport (BTLS_DYLIB)]
                extern static int mono_btls_x509_get_raw_data (IntPtr handle, IntPtr bio, MonoBtlsX509Format format);
 
-               [MethodImpl (MethodImplOptions.InternalCall)]
+               [DllImport (BTLS_DYLIB)]
                extern static int mono_btls_x509_cmp (IntPtr a, IntPtr b);
 
-               [MethodImpl (MethodImplOptions.InternalCall)]
+               [DllImport (BTLS_DYLIB)]
                extern static int mono_btls_x509_get_hash (IntPtr handle, out IntPtr data);
 
-               [MethodImpl (MethodImplOptions.InternalCall)]
+               [DllImport (BTLS_DYLIB)]
                extern static long mono_btls_x509_get_not_before (IntPtr handle);
 
-               [MethodImpl (MethodImplOptions.InternalCall)]
+               [DllImport (BTLS_DYLIB)]
                extern static long mono_btls_x509_get_not_after (IntPtr handle);
 
-               [MethodImpl (MethodImplOptions.InternalCall)]
+               [DllImport (BTLS_DYLIB)]
                extern static int mono_btls_x509_get_public_key (IntPtr handle, IntPtr bio);
 
-               [MethodImpl (MethodImplOptions.InternalCall)]
+               [DllImport (BTLS_DYLIB)]
                extern static int mono_btls_x509_get_serial_number (IntPtr handle, IntPtr data, int size, int mono_style);
 
-               [MethodImpl (MethodImplOptions.InternalCall)]
+               [DllImport (BTLS_DYLIB)]
                extern static int mono_btls_x509_get_version (IntPtr handle);
 
-               [MethodImpl (MethodImplOptions.InternalCall)]
+               [DllImport (BTLS_DYLIB)]
                extern static int mono_btls_x509_get_signature_algorithm (IntPtr handle, IntPtr buffer, int size);
 
-               [MethodImpl (MethodImplOptions.InternalCall)]
+               [DllImport (BTLS_DYLIB)]
                extern static int mono_btls_x509_get_public_key_asn1 (IntPtr handle, IntPtr oid, int oid_size, out IntPtr data, out int size);
 
-               [MethodImpl (MethodImplOptions.InternalCall)]
+               [DllImport (BTLS_DYLIB)]
                extern static int mono_btls_x509_get_public_key_parameters (IntPtr handle, IntPtr oid, int oid_size, out IntPtr data, out int size);
 
-               [MethodImpl (MethodImplOptions.InternalCall)]
+               [DllImport (BTLS_DYLIB)]
                extern static IntPtr mono_btls_x509_get_pubkey (IntPtr handle);
 
-               [MethodImpl (MethodImplOptions.InternalCall)]
+               [DllImport (BTLS_DYLIB)]
                extern static int mono_btls_x509_get_subject_key_identifier (IntPtr handle, out IntPtr data, out int size);
 
-               [MethodImpl (MethodImplOptions.InternalCall)]
+               [DllImport (BTLS_DYLIB)]
                extern static int mono_btls_x509_print (IntPtr handle, IntPtr bio);
 
-               [MethodImpl (MethodImplOptions.InternalCall)]
+               [DllImport (BTLS_DYLIB)]
                extern static void mono_btls_x509_free (IntPtr handle);
 
-               [MethodImpl (MethodImplOptions.InternalCall)]
+               [DllImport (BTLS_DYLIB)]
                extern static IntPtr mono_btls_x509_dup (IntPtr handle);
 
-               [MethodImpl (MethodImplOptions.InternalCall)]
+               [DllImport (BTLS_DYLIB)]
                extern static int mono_btls_x509_add_trust_object (IntPtr handle, MonoBtlsX509Purpose purpose);
 
-               [MethodImpl (MethodImplOptions.InternalCall)]
+               [DllImport (BTLS_DYLIB)]
                extern static int mono_btls_x509_add_reject_object (IntPtr handle, MonoBtlsX509Purpose purpose);
 
-               [MethodImpl (MethodImplOptions.InternalCall)]
+               [DllImport (BTLS_DYLIB)]
                extern static int mono_btls_x509_add_explicit_trust (IntPtr handle, MonoBtlsX509TrustKind kind);
 
                internal MonoBtlsX509 Copy ()
index 6926ae7e65b15343fde55c1c17491f67c662aa0f..7113d1f48f6076454610a6c9d524791176387bcb 100644 (file)
@@ -23,7 +23,7 @@
 // LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
 // OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
 // THE SOFTWARE.
-#if SECURITY_DEP
+#if SECURITY_DEP && MONO_FEATURE_BTLS
 using System;
 using System.IO;
 using System.Security.Cryptography.X509Certificates;
@@ -52,22 +52,22 @@ namespace Mono.Btls
                        get { return (BoringX509ChainHandle)base.Handle; }
                }
 
-               [MethodImpl (MethodImplOptions.InternalCall)]
+               [DllImport (BTLS_DYLIB)]
                extern static IntPtr mono_btls_x509_chain_new ();
 
-               [MethodImpl (MethodImplOptions.InternalCall)]
+               [DllImport (BTLS_DYLIB)]
                extern static int mono_btls_x509_chain_get_count (IntPtr handle);
 
-               [MethodImpl (MethodImplOptions.InternalCall)]
+               [DllImport (BTLS_DYLIB)]
                extern static IntPtr mono_btls_x509_chain_get_cert (IntPtr Handle, int index);
 
-               [MethodImpl (MethodImplOptions.InternalCall)]
+               [DllImport (BTLS_DYLIB)]
                extern static int mono_btls_x509_chain_add_cert (IntPtr chain, IntPtr x509);
 
-               [MethodImpl (MethodImplOptions.InternalCall)]
+               [DllImport (BTLS_DYLIB)]
                extern static IntPtr mono_btls_x509_chain_up_ref (IntPtr handle);
 
-               [MethodImpl (MethodImplOptions.InternalCall)]
+               [DllImport (BTLS_DYLIB)]
                extern static void mono_btls_x509_chain_free (IntPtr handle);
 
                public MonoBtlsX509Chain ()
index 9d1868337d6f8bb114463d233e6113d02dd83d6c..6801b79b785c24b0204646e8443864eb16e833b7 100644 (file)
@@ -23,7 +23,7 @@
 // LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
 // OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
 // THE SOFTWARE.
-#if SECURITY_DEP
+#if SECURITY_DEP && MONO_FEATURE_BTLS
 using System;
 using System.IO;
 using System.Text;
@@ -67,37 +67,37 @@ namespace Mono.Btls
                {
                }
 
-               [MethodImpl (MethodImplOptions.InternalCall)]
+               [DllImport (BTLS_DYLIB)]
                extern static IntPtr mono_btls_x509_crl_ref (IntPtr handle);
 
-               [MethodImpl (MethodImplOptions.InternalCall)]
+               [DllImport (BTLS_DYLIB)]
                extern static IntPtr mono_btls_x509_crl_from_data (IntPtr data, int len, MonoBtlsX509Format format);
 
-               [MethodImpl (MethodImplOptions.InternalCall)]
+               [DllImport (BTLS_DYLIB)]
                extern static IntPtr mono_btls_x509_crl_get_by_cert (IntPtr handle, IntPtr x509);
 
-               [MethodImpl (MethodImplOptions.InternalCall)]
+               [DllImport (BTLS_DYLIB)]
                unsafe extern static IntPtr mono_btls_x509_crl_get_by_serial (IntPtr handle, void *serial, int len);
 
-               [MethodImpl (MethodImplOptions.InternalCall)]
+               [DllImport (BTLS_DYLIB)]
                extern static int mono_btls_x509_crl_get_revoked_count (IntPtr handle);
 
-               [MethodImpl (MethodImplOptions.InternalCall)]
+               [DllImport (BTLS_DYLIB)]
                extern static IntPtr mono_btls_x509_crl_get_revoked (IntPtr handle, int index);
 
-               [MethodImpl (MethodImplOptions.InternalCall)]
+               [DllImport (BTLS_DYLIB)]
                extern static long mono_btls_x509_crl_get_last_update (IntPtr handle);
 
-               [MethodImpl (MethodImplOptions.InternalCall)]
+               [DllImport (BTLS_DYLIB)]
                extern static long mono_btls_x509_crl_get_next_update (IntPtr handle);
 
-               [MethodImpl (MethodImplOptions.InternalCall)]
+               [DllImport (BTLS_DYLIB)]
                extern static long mono_btls_x509_crl_get_version (IntPtr handle);
 
-               [MethodImpl (MethodImplOptions.InternalCall)]
+               [DllImport (BTLS_DYLIB)]
                extern static IntPtr mono_btls_x509_crl_get_issuer (IntPtr handle);
 
-               [MethodImpl (MethodImplOptions.InternalCall)]
+               [DllImport (BTLS_DYLIB)]
                extern static void mono_btls_x509_crl_free (IntPtr handle);
 
                public static MonoBtlsX509Crl LoadFromData (byte[] buffer, MonoBtlsX509Format format)
index 50196bfd49d8e70fdbfe64e3e68f42be986007f0..bf40275b9f5677e07f0ca9d08162a6a6162463a4 100644 (file)
@@ -23,7 +23,7 @@
 // LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
 // OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
 // THE SOFTWARE.
-#if SECURITY_DEP
+#if SECURITY_DEP && MONO_FEATURE_BTLS
 using System;
 namespace Mono.Btls
 {
index 588e7a7f6925a071ac0dd8da7e44c5648751b51a..bb982bc0f45c27d0d8f3a6b0bee629ae33c1e955 100644 (file)
@@ -23,7 +23,7 @@
 // LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
 // OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
 // THE SOFTWARE.
-#if SECURITY_DEP
+#if SECURITY_DEP && MONO_FEATURE_BTLS
 using System;
 
 namespace Mono.Btls
index 67d26e6c3573b63f28eb1be30ef4478046e9cca1..1475457507b4ab4c6434fe61347735777cd79851 100644 (file)
@@ -23,7 +23,7 @@
 // LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
 // OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
 // THE SOFTWARE.
-#if SECURITY_DEP
+#if SECURITY_DEP && MONO_FEATURE_BTLS
 using System;
 namespace Mono.Btls
 {
index 551da69c4bfd610af08808949137d8aa053dc0aa..609d0c1f2aba32220410825219914897954377cf 100644 (file)
@@ -23,7 +23,7 @@
 // LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
 // OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
 // THE SOFTWARE.
-#if SECURITY_DEP
+#if SECURITY_DEP && MONO_FEATURE_BTLS
 using System;
 namespace Mono.Btls
 {
index 3e8fb29976820169fb5ed24cd57bd64c057e60c2..b2e863b085a0366ac5b43f8324aa8c41a919fba2 100644 (file)
@@ -23,7 +23,7 @@
 // LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
 // OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
 // THE SOFTWARE.
-#if SECURITY_DEP
+#if SECURITY_DEP && MONO_FEATURE_BTLS
 using System;
 using System.IO;
 using System.Runtime.InteropServices;
@@ -52,38 +52,38 @@ namespace Mono.Btls
                        get { return (BoringX509LookupHandle)base.Handle; }
                }
 
-               [MethodImpl (MethodImplOptions.InternalCall)]
+               [DllImport (BTLS_DYLIB)]
                extern static IntPtr mono_btls_x509_lookup_new (IntPtr store, MonoBtlsX509LookupType type);
 
-               [MethodImpl (MethodImplOptions.InternalCall)]
+               [DllImport (BTLS_DYLIB)]
                extern static int mono_btls_x509_lookup_load_file (IntPtr handle, IntPtr file, MonoBtlsX509FileType type);
 
-               [MethodImpl (MethodImplOptions.InternalCall)]
+               [DllImport (BTLS_DYLIB)]
                extern static int mono_btls_x509_lookup_add_dir (IntPtr handle, IntPtr dir, MonoBtlsX509FileType type);
 
-               [MethodImpl (MethodImplOptions.InternalCall)]
+               [DllImport (BTLS_DYLIB)]
                extern static int mono_btls_x509_lookup_add_mono (IntPtr handle, IntPtr monoLookup);
 
-               [MethodImpl (MethodImplOptions.InternalCall)]
+               [DllImport (BTLS_DYLIB)]
                extern static void mono_btls_x509_lookup_method_mono_init (
                        IntPtr handle, IntPtr instance, IntPtr by_subject_func);
 
-               [MethodImpl (MethodImplOptions.InternalCall)]
+               [DllImport (BTLS_DYLIB)]
                extern static int mono_btls_x509_lookup_init (IntPtr handle);
 
-               [MethodImpl (MethodImplOptions.InternalCall)]
+               [DllImport (BTLS_DYLIB)]
                extern static int mono_btls_x509_lookup_shutdown (IntPtr handle);
 
-               [MethodImpl (MethodImplOptions.InternalCall)]
+               [DllImport (BTLS_DYLIB)]
                extern static IntPtr mono_btls_x509_lookup_by_subject (IntPtr handle, IntPtr name);
 
-               [MethodImpl (MethodImplOptions.InternalCall)]
+               [DllImport (BTLS_DYLIB)]
                extern static IntPtr mono_btls_x509_lookup_by_fingerprint (IntPtr handle, IntPtr bytes, int len);
 
-               [MethodImpl (MethodImplOptions.InternalCall)]
+               [DllImport (BTLS_DYLIB)]
                extern static void mono_btls_x509_lookup_free (IntPtr handle);
 
-               [MethodImpl (MethodImplOptions.InternalCall)]
+               [DllImport (BTLS_DYLIB)]
                extern static IntPtr mono_btls_x509_lookup_peek_lookup (IntPtr handle);
 
                MonoBtlsX509LookupType type;
index 45f365ce3eeb327034888989676cab4f76f9dff8..db0151ac93c2ac1891125478694a49032be116f9 100644 (file)
@@ -23,7 +23,7 @@
 // LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
 // OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
 // THE SOFTWARE.
-#if SECURITY_DEP && MONODROID
+#if SECURITY_DEP && MONO_FEATURE_BTLS && MONODROID
 using System;
 using System.IO;
 using System.Runtime.InteropServices;
index 30b2ee3876e4480e4c66d3499bae0158c800da06..cd86cde03adf804e01ced27644fbef84ff994c93 100644 (file)
@@ -23,7 +23,7 @@
 // LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
 // OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
 // THE SOFTWARE.
-#if SECURITY_DEP
+#if SECURITY_DEP && MONO_FEATURE_BTLS
 using System;
 using System.IO;
 using System.Runtime.InteropServices;
@@ -51,14 +51,14 @@ namespace Mono.Btls
                        get { return (BoringX509LookupMonoHandle)base.Handle; }
                }
 
-               [MethodImpl (MethodImplOptions.InternalCall)]
+               [DllImport (BTLS_DYLIB)]
                extern static IntPtr mono_btls_x509_lookup_mono_new ();
 
-               [MethodImpl (MethodImplOptions.InternalCall)]
+               [DllImport (BTLS_DYLIB)]
                extern static void mono_btls_x509_lookup_mono_init (
                        IntPtr handle, IntPtr instance, IntPtr by_subject_func);
 
-               [MethodImpl (MethodImplOptions.InternalCall)]
+               [DllImport (BTLS_DYLIB)]
                extern static int mono_btls_x509_lookup_mono_free (IntPtr handle);
 
                delegate int BySubjectFunc (IntPtr instance, IntPtr name, out IntPtr x509_ptr);
index 8a854f6303a1e612c00d25d200109d291815a07d..139243e2a23d398f76af96ac3cc79b26cd6fccbf 100644 (file)
@@ -23,7 +23,7 @@
 // LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
 // OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
 // THE SOFTWARE.
-#if SECURITY_DEP
+#if SECURITY_DEP && MONO_FEATURE_BTLS
 using System;
 using System.IO;
 using System.Runtime.InteropServices;
index 2cbdf7cb718bce325124f92de46e1562b0bcc4da..6bb42d989f3118da000ba2d41c4000c9ab52b246 100644 (file)
@@ -23,7 +23,7 @@
 // LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
 // OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
 // THE SOFTWARE.
-#if SECURITY_DEP
+#if SECURITY_DEP && MONO_FEATURE_BTLS
 using System;
 
 namespace Mono.Btls
index 80a322caaf3f6882df62c1005af52248341afcd6..74e335a64cad49b642f8b70ca5ebcfb9268394d2 100644 (file)
@@ -23,7 +23,7 @@
 // LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
 // OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
 // THE SOFTWARE.
-#if SECURITY_DEP
+#if SECURITY_DEP && MONO_FEATURE_BTLS
 using System;
 using System.IO;
 using System.Text;
@@ -52,40 +52,40 @@ namespace Mono.Btls
                        }
                }
 
-               [MethodImpl (MethodImplOptions.InternalCall)]
+               [DllImport (BTLS_DYLIB)]
                extern static int mono_btls_x509_name_print_bio (IntPtr handle, IntPtr bio);
 
-               [MethodImpl (MethodImplOptions.InternalCall)]
+               [DllImport (BTLS_DYLIB)]
                extern static int mono_btls_x509_name_print_string (IntPtr handle, IntPtr buffer, int size);
 
-               [MethodImpl (MethodImplOptions.InternalCall)]
+               [DllImport (BTLS_DYLIB)]
                extern static int mono_btls_x509_name_get_raw_data (IntPtr handle, out IntPtr buffer, int use_canon_enc);
 
-               [MethodImpl (MethodImplOptions.InternalCall)]
+               [DllImport (BTLS_DYLIB)]
                extern static long mono_btls_x509_name_hash (IntPtr handle);
 
-               [MethodImpl (MethodImplOptions.InternalCall)]
+               [DllImport (BTLS_DYLIB)]
                extern static long mono_btls_x509_name_hash_old (IntPtr handle);
 
-               [MethodImpl (MethodImplOptions.InternalCall)]
+               [DllImport (BTLS_DYLIB)]
                extern static int mono_btls_x509_name_get_entry_count (IntPtr handle);
 
-               [MethodImpl (MethodImplOptions.InternalCall)]
+               [DllImport (BTLS_DYLIB)]
                extern static MonoBtlsX509NameEntryType mono_btls_x509_name_get_entry_type (IntPtr name, int index);
 
-               [MethodImpl (MethodImplOptions.InternalCall)]
+               [DllImport (BTLS_DYLIB)]
                extern static int mono_btls_x509_name_get_entry_oid (IntPtr name, int index, IntPtr buffer, int size);
 
-               [MethodImpl (MethodImplOptions.InternalCall)]
+               [DllImport (BTLS_DYLIB)]
                extern static int mono_btls_x509_name_get_entry_oid_data (IntPtr name, int index, out IntPtr data);
 
-               [MethodImpl (MethodImplOptions.InternalCall)]
+               [DllImport (BTLS_DYLIB)]
                extern static int mono_btls_x509_name_get_entry_value (IntPtr name, int index, out int tag, out IntPtr str);
 
-               [MethodImpl (MethodImplOptions.InternalCall)]
+               [DllImport (BTLS_DYLIB)]
                extern unsafe static IntPtr mono_btls_x509_name_from_data (void* data, int len, int use_canon_enc);
 
-               [MethodImpl (MethodImplOptions.InternalCall)]
+               [DllImport (BTLS_DYLIB)]
                extern static void mono_btls_x509_name_free (IntPtr handle);
 
                new internal BoringX509NameHandle Handle {
index 781d6917c9db11d8e3c959fbaecc970681eeeee6..1a4cdae673f6d1d9dae79a8946f3092d6b5ebb33 100644 (file)
@@ -23,7 +23,7 @@
 // LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
 // OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
 // THE SOFTWARE.
-#if SECURITY_DEP
+#if SECURITY_DEP && MONO_FEATURE_BTLS
 using System;
 namespace Mono.Btls
 {
index cccc005f8d99083ed55b8c5f64305333c8315bac..005ffd03eaba6f5a4b0b9dd907b98ea268b7adf5 100644 (file)
@@ -23,7 +23,7 @@
 // LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
 // OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
 // THE SOFTWARE.
-#if SECURITY_DEP
+#if SECURITY_DEP && MONO_FEATURE_BTLS
 using System;
 using System.IO;
 using System.Text;
@@ -52,19 +52,19 @@ namespace Mono.Btls
                        }
                }
 
-               [MethodImpl (MethodImplOptions.InternalCall)]
+               [DllImport (BTLS_DYLIB)]
                extern static IntPtr mono_btls_x509_name_list_new ();
 
-               [MethodImpl (MethodImplOptions.InternalCall)]
+               [DllImport (BTLS_DYLIB)]
                extern static int mono_btls_x509_name_list_get_count (IntPtr handle);
 
-               [MethodImpl (MethodImplOptions.InternalCall)]
+               [DllImport (BTLS_DYLIB)]
                extern static int mono_btls_x509_name_list_add (IntPtr handle, IntPtr name);
 
-               [MethodImpl (MethodImplOptions.InternalCall)]
+               [DllImport (BTLS_DYLIB)]
                extern static IntPtr mono_btls_x509_name_list_get_item (IntPtr handle, int index);
 
-               [MethodImpl (MethodImplOptions.InternalCall)]
+               [DllImport (BTLS_DYLIB)]
                extern static void mono_btls_x509_name_list_free (IntPtr handle);
 
                new internal BoringX509NameListHandle Handle {
index d80957c301b1c9246cd8a77416a6b66f952fc59a..b8b416330d007957aff9ee5b7c9b8d285eb4b4e1 100644 (file)
@@ -23,7 +23,7 @@
 // LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
 // OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
 // THE SOFTWARE.
-#if SECURITY_DEP
+#if SECURITY_DEP && MONO_FEATURE_BTLS
 using System;
 namespace Mono.Btls
 {
index 4f5d79b67b41278c6a7c3d0281bcf95847fc93b9..1bb279a4ae12f70b3a04d8cf4ff15d75ab87f93d 100644 (file)
@@ -23,7 +23,7 @@
 // LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
 // OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
 // THE SOFTWARE.
-#if SECURITY_DEP
+#if SECURITY_DEP && MONO_FEATURE_BTLS
 using System;
 using System.IO;
 using System.Text;
@@ -67,19 +67,19 @@ namespace Mono.Btls
                {
                }
 
-               [MethodImpl (MethodImplOptions.InternalCall)]
+               [DllImport (BTLS_DYLIB)]
                extern static int mono_btls_x509_revoked_get_serial_number (IntPtr handle, IntPtr data, int size);
 
-               [MethodImpl (MethodImplOptions.InternalCall)]
+               [DllImport (BTLS_DYLIB)]
                extern static long mono_btls_x509_revoked_get_revocation_date (IntPtr handle);
 
-               [MethodImpl (MethodImplOptions.InternalCall)]
+               [DllImport (BTLS_DYLIB)]
                extern static int mono_btls_x509_revoked_get_reason (IntPtr handle);
 
-               [MethodImpl (MethodImplOptions.InternalCall)]
+               [DllImport (BTLS_DYLIB)]
                extern static int mono_btls_x509_revoked_get_sequence (IntPtr handle);
 
-               [MethodImpl (MethodImplOptions.InternalCall)]
+               [DllImport (BTLS_DYLIB)]
                extern static void mono_btls_x509_revoked_free (IntPtr handle);
 
                public byte[] GetSerialNumber ()
index 2e03715ce3461757c67c6f3491d3a5313d748f42..537993566e53a6a1c7fd2cf9e978639e928224c2 100644 (file)
@@ -23,7 +23,7 @@
 // LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
 // OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
 // THE SOFTWARE.
-#if SECURITY_DEP
+#if SECURITY_DEP && MONO_FEATURE_BTLS
 using System;
 using System.IO;
 using System.Collections.Generic;
@@ -53,28 +53,28 @@ namespace Mono.Btls
                        get { return (BoringX509StoreHandle)base.Handle; }
                }
 
-               [MethodImpl (MethodImplOptions.InternalCall)]
+               [DllImport (BTLS_DYLIB)]
                extern static IntPtr mono_btls_x509_store_new ();
 
-               [MethodImpl (MethodImplOptions.InternalCall)]
+               [DllImport (BTLS_DYLIB)]
                extern static IntPtr mono_btls_x509_store_from_ctx (IntPtr ctx);
 
-               [MethodImpl (MethodImplOptions.InternalCall)]
+               [DllImport (BTLS_DYLIB)]
                extern static IntPtr mono_btls_x509_store_from_ssl_ctx (IntPtr handle);
 
-               [MethodImpl (MethodImplOptions.InternalCall)]
+               [DllImport (BTLS_DYLIB)]
                extern static int mono_btls_x509_store_load_locations (IntPtr handle, IntPtr file, IntPtr path);
 
-               [MethodImpl (MethodImplOptions.InternalCall)]
+               [DllImport (BTLS_DYLIB)]
                extern static int mono_btls_x509_store_set_default_paths (IntPtr handle);
 
-               [MethodImpl (MethodImplOptions.InternalCall)]
+               [DllImport (BTLS_DYLIB)]
                extern static int mono_btls_x509_store_add_cert (IntPtr handle, IntPtr x509);
 
-               [MethodImpl (MethodImplOptions.InternalCall)]
+               [DllImport (BTLS_DYLIB)]
                extern static int mono_btls_x509_store_get_count (IntPtr handle);
 
-               [MethodImpl (MethodImplOptions.InternalCall)]
+               [DllImport (BTLS_DYLIB)]
                extern static void mono_btls_x509_store_free (IntPtr handle);
 
                Dictionary<IntPtr,MonoBtlsX509Lookup> lookupHash;
index 41df1298f9cb8758fb96a75471de876dfc65b5ec..9b8e82bb5e2766a135eda18c56be9413bf1a62b3 100644 (file)
@@ -23,7 +23,7 @@
 // LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
 // OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
 // THE SOFTWARE.
-#if SECURITY_DEP
+#if SECURITY_DEP && MONO_FEATURE_BTLS
 using System;
 using System.IO;
 using System.Runtime.InteropServices;
@@ -66,49 +66,49 @@ namespace Mono.Btls
                        get { return (BoringX509StoreCtxHandle)base.Handle; }
                }
 
-               [MethodImpl (MethodImplOptions.InternalCall)]
+               [DllImport (BTLS_DYLIB)]
                extern static IntPtr mono_btls_x509_store_ctx_new ();
 
-               [MethodImpl (MethodImplOptions.InternalCall)]
+               [DllImport (BTLS_DYLIB)]
                extern static IntPtr mono_btls_x509_store_ctx_from_ptr (IntPtr ctx);
 
-               [MethodImpl (MethodImplOptions.InternalCall)]
+               [DllImport (BTLS_DYLIB)]
                extern static MonoBtlsX509Error mono_btls_x509_store_ctx_get_error (IntPtr handle, out IntPtr error_string);
 
-               [MethodImpl (MethodImplOptions.InternalCall)]
+               [DllImport (BTLS_DYLIB)]
                extern static int mono_btls_x509_store_ctx_get_error_depth (IntPtr handle);
 
-               [MethodImpl (MethodImplOptions.InternalCall)]
+               [DllImport (BTLS_DYLIB)]
                extern static IntPtr mono_btls_x509_store_ctx_get_chain (IntPtr handle);
 
-               [MethodImpl (MethodImplOptions.InternalCall)]
+               [DllImport (BTLS_DYLIB)]
                extern static int mono_btls_x509_store_ctx_init (IntPtr handle, IntPtr store, IntPtr chain);
 
-               [MethodImpl (MethodImplOptions.InternalCall)]
+               [DllImport (BTLS_DYLIB)]
                extern static int mono_btls_x509_store_ctx_set_param (IntPtr handle, IntPtr param);
 
-               [MethodImpl (MethodImplOptions.InternalCall)]
+               [DllImport (BTLS_DYLIB)]
                extern static int mono_btls_x509_store_ctx_verify_cert (IntPtr handle);
 
-               [MethodImpl (MethodImplOptions.InternalCall)]
+               [DllImport (BTLS_DYLIB)]
                extern static IntPtr mono_btls_x509_store_ctx_get_by_subject (IntPtr handle, IntPtr name);
 
-               [MethodImpl (MethodImplOptions.InternalCall)]
+               [DllImport (BTLS_DYLIB)]
                extern static IntPtr mono_btls_x509_store_ctx_get_current_cert (IntPtr handle);
 
-               [MethodImpl (MethodImplOptions.InternalCall)]
+               [DllImport (BTLS_DYLIB)]
                extern static IntPtr mono_btls_x509_store_ctx_get_current_issuer (IntPtr handle);
 
-               [MethodImpl (MethodImplOptions.InternalCall)]
+               [DllImport (BTLS_DYLIB)]
                extern static IntPtr mono_btls_x509_store_ctx_get_verify_param (IntPtr handle);
 
-               [MethodImpl (MethodImplOptions.InternalCall)]
+               [DllImport (BTLS_DYLIB)]
                extern static IntPtr mono_btls_x509_store_ctx_get_untrusted (IntPtr handle);
 
-               [MethodImpl (MethodImplOptions.InternalCall)]
+               [DllImport (BTLS_DYLIB)]
                extern static IntPtr mono_btls_x509_store_ctx_up_ref (IntPtr handle);
 
-               [MethodImpl (MethodImplOptions.InternalCall)]
+               [DllImport (BTLS_DYLIB)]
                extern static void mono_btls_x509_store_ctx_free (IntPtr handle);
 
                internal MonoBtlsX509StoreCtx ()
index 13c92a29ef0560a9db89b0ae81a2b2af5e2e2e66..42fbdf7fa1c2fb7421e396146f0af1feaaff98b3 100644 (file)
@@ -23,7 +23,7 @@
 // LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
 // OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
 // THE SOFTWARE.
-#if SECURITY_DEP
+#if SECURITY_DEP && MONO_FEATURE_BTLS
 #if MONO_SECURITY_ALIAS
 extern alias MonoSecurity;
 #endif
@@ -45,12 +45,14 @@ namespace Mono.Btls
        static class MonoBtlsX509StoreManager
        {
                static bool initialized;
+#if !ANDROID
                static string machineTrustedRootPath;
                static string machineIntermediateCAPath;
                static string machineUntrustedPath;
                static string userTrustedRootPath;
                static string userIntermediateCAPath;
                static string userUntrustedPath;
+#endif
 
                static void Initialize ()
                {
index 22cc0726cd76e749cec8e0c6c6e0155e1d87614a..b4ac5930054573cbf3ff0153c5644b7b61de9a1e 100644 (file)
@@ -23,7 +23,7 @@
 // LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
 // OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
 // THE SOFTWARE.
-#if SECURITY_DEP
+#if SECURITY_DEP && MONO_FEATURE_BTLS
 namespace Mono.Btls
 {
        enum MonoBtlsX509StoreType
index e207683711b0683f2e2d93f20fb0f3ed0b26f224..4d8558870425094fbb32ecfdb27292fe16d997bb 100644 (file)
@@ -23,7 +23,7 @@
 // LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
 // OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
 // THE SOFTWARE.
-#if SECURITY_DEP
+#if SECURITY_DEP && MONO_FEATURE_BTLS
 using System;
 namespace Mono.Btls
 {
index 628633bcfd18473846ca47f44224b8eb26763c19..493fc9b1c3dd77ad8c58802a9201dedc53ad463c 100644 (file)
@@ -23,7 +23,7 @@
 // LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
 // OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
 // THE SOFTWARE.
-#if SECURITY_DEP
+#if SECURITY_DEP && MONO_FEATURE_BTLS
 using System;
 namespace Mono.Btls
 {
index 5c012389fdc4b92ab9f8382cdefc6e425583777f..9029722a504791521461113e329e85ec56339ac5 100644 (file)
@@ -23,7 +23,7 @@
 // LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
 // OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
 // THE SOFTWARE.
-#if SECURITY_DEP
+#if SECURITY_DEP && MONO_FEATURE_BTLS
 using System;
 using System.IO;
 using System.Runtime.InteropServices;
@@ -51,55 +51,55 @@ namespace Mono.Btls
                        get { return (BoringX509VerifyParamHandle)base.Handle; }
                }
 
-               [MethodImpl (MethodImplOptions.InternalCall)]
+               [DllImport (BTLS_DYLIB)]
                extern static IntPtr mono_btls_x509_verify_param_new ();
 
-               [MethodImpl (MethodImplOptions.InternalCall)]
+               [DllImport (BTLS_DYLIB)]
                extern static IntPtr mono_btls_x509_verify_param_copy (IntPtr handle);
 
-               [MethodImpl (MethodImplOptions.InternalCall)]
+               [DllImport (BTLS_DYLIB)]
                extern static IntPtr mono_btls_x509_verify_param_lookup (IntPtr name);
 
-               [MethodImpl (MethodImplOptions.InternalCall)]
+               [DllImport (BTLS_DYLIB)]
                extern static int mono_btls_x509_verify_param_can_modify (IntPtr param);
 
-               [MethodImpl (MethodImplOptions.InternalCall)]
+               [DllImport (BTLS_DYLIB)]
                extern static int mono_btls_x509_verify_param_set_name (IntPtr handle, IntPtr name);
 
-               [MethodImpl (MethodImplOptions.InternalCall)]
+               [DllImport (BTLS_DYLIB)]
                extern static int mono_btls_x509_verify_param_set_host (IntPtr handle, IntPtr name, int namelen);
 
-               [MethodImpl (MethodImplOptions.InternalCall)]
+               [DllImport (BTLS_DYLIB)]
                extern static int mono_btls_x509_verify_param_add_host (IntPtr handle, IntPtr name, int namelen);
 
-               [MethodImpl (MethodImplOptions.InternalCall)]
+               [DllImport (BTLS_DYLIB)]
                extern static ulong mono_btls_x509_verify_param_get_flags (IntPtr handle);
 
-               [MethodImpl (MethodImplOptions.InternalCall)]
+               [DllImport (BTLS_DYLIB)]
                extern static int mono_btls_x509_verify_param_set_flags (IntPtr handle, ulong flags);
 
-               [MethodImpl (MethodImplOptions.InternalCall)]
+               [DllImport (BTLS_DYLIB)]
                extern static MonoBtlsX509VerifyFlags mono_btls_x509_verify_param_get_mono_flags (IntPtr handle);
 
-               [MethodImpl (MethodImplOptions.InternalCall)]
+               [DllImport (BTLS_DYLIB)]
                extern static int mono_btls_x509_verify_param_set_mono_flags (IntPtr handle, MonoBtlsX509VerifyFlags flags);
 
-               [MethodImpl (MethodImplOptions.InternalCall)]
+               [DllImport (BTLS_DYLIB)]
                extern static int mono_btls_x509_verify_param_set_purpose (IntPtr handle, MonoBtlsX509Purpose purpose);
 
-               [MethodImpl (MethodImplOptions.InternalCall)]
+               [DllImport (BTLS_DYLIB)]
                extern static int mono_btls_x509_verify_param_get_depth (IntPtr handle);
 
-               [MethodImpl (MethodImplOptions.InternalCall)]
+               [DllImport (BTLS_DYLIB)]
                extern static int mono_btls_x509_verify_param_set_depth (IntPtr handle, int depth);
 
-               [MethodImpl (MethodImplOptions.InternalCall)]
+               [DllImport (BTLS_DYLIB)]
                extern static int mono_btls_x509_verify_param_set_time (IntPtr handle, long time);
 
-               [MethodImpl (MethodImplOptions.InternalCall)]
+               [DllImport (BTLS_DYLIB)]
                extern static IntPtr mono_btls_x509_verify_param_get_peername (IntPtr handle);
 
-               [MethodImpl (MethodImplOptions.InternalCall)]
+               [DllImport (BTLS_DYLIB)]
                extern static void mono_btls_x509_verify_param_free (IntPtr handle);
 
                internal MonoBtlsX509VerifyParam ()
index ef077b80e9fedeea766e756fb2895e99c4786ff4..f780812ce404f952eb8a07f6332a075587216a22 100644 (file)
@@ -23,7 +23,7 @@
 // LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
 // OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
 // THE SOFTWARE.
-#if SECURITY_DEP
+#if SECURITY_DEP && MONO_FEATURE_BTLS
 #if MONO_SECURITY_ALIAS
 extern alias MonoSecurity;
 #endif
index 79a985ce6749562f1871b38961e1ebee4faeafe6..13596686e8528348143280bf139bed92478ab901 100644 (file)
@@ -23,7 +23,7 @@
 // LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
 // OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
 // THE SOFTWARE.
-#if SECURITY_DEP
+#if SECURITY_DEP && MONO_FEATURE_BTLS
 using System;
 using System.Text;
 using System.Security;
@@ -62,7 +62,7 @@ namespace Mono.Btls
                                untrusted = new X509Certificate2Collection ();
                                policy.ExtraStore = untrusted;
                                for (int i = 0; i < untrustedChain.Count; i++) {
-                                       using (var cert = untrustedChain.GetCertificate (i))
+                                       var cert = untrustedChain.GetCertificate (i);
                                        using (var impl = new X509CertificateImplBtls (cert))
                                                untrusted.Add (new X509Certificate2 (impl));
                                }
@@ -109,8 +109,8 @@ namespace Mono.Btls
 
                                for (int i = 0; i < certificates.Length; i++) {
                                        var cert = chain.GetCertificate (i);
-                                       var impl = new X509CertificateImplBtls (cert);
-                                       certificates [i] = new X509Certificate2 (impl);
+                                       using (var impl = new X509CertificateImplBtls (cert))
+                                               certificates [i] = new X509Certificate2 (impl);
                                        elements.Add (certificates [i]);
                                }
 
@@ -163,6 +163,12 @@ namespace Mono.Btls
                                if (untrusted != null) {
                                        foreach (var cert in untrusted)
                                                cert.Dispose ();
+                                       untrusted = null;
+                               }
+                               if (certificates != null) {
+                                       foreach (var cert in certificates)
+                                               cert.Dispose ();
+                                       certificates = null;
                                }
                        }
                        base.Dispose (disposing);
index 929e88e2295149ca35dcc8ba8227daf95d2be184..324192d6af182a898272432a394351099def6971 100644 (file)
@@ -75,6 +75,8 @@ namespace Mono.Net.Security
                readonly MonoTlsStream tlsStream;
                readonly HttpWebRequest request;
 
+#pragma warning disable 618
+
                internal static ICertificateValidator GetInternalValidator (MonoTlsProvider provider, MonoTlsSettings settings)
                {
                        if (settings == null)
@@ -182,6 +184,8 @@ namespace Mono.Net.Security
                                certValidationCallback = ServicePointManager.ServerCertValidationCallback;
                }
 
+#pragma warning restore 618
+
                static X509Certificate DefaultSelectionCallback (string targetHost, X509CertificateCollection localCertificates, X509Certificate remoteCertificate, string[] acceptableIssuers)
                {
                        X509Certificate clientCertificate;
index 7ec9a86813977d98ddcf63b3d85b52cfdf69deb2..1ca30e6c96daf0e2b1a8c457dab8464d83a2141e 100644 (file)
@@ -316,12 +316,14 @@ namespace Mono.Net.Security.Private
 */
                X509Certificate OnCertificateSelection (X509CertificateCollection clientCerts, X509Certificate serverCert, string targetHost, X509CertificateCollection serverRequestedCerts)
                {
+#pragma warning disable 618
                        string [] acceptableIssuers = new string [serverRequestedCerts != null ? serverRequestedCerts.Count : 0];
                        for (int i = 0; i < acceptableIssuers.Length; i++)
                                acceptableIssuers [i] = serverRequestedCerts [i].GetIssuerName ();
                        X509Certificate clientCertificate;
                        certificateValidator.SelectClientCertificate (targetHost, clientCerts, serverCert, acceptableIssuers, out clientCertificate);
                        return clientCertificate;
+#pragma warning restore 618
                }
 
                public virtual IAsyncResult BeginAuthenticateAsClient (string targetHost, AsyncCallback asyncCallback, object asyncState)
index 4625f2f53c20faf9bd5e30386aed0cbee5d5733f..6e0e2a9b1f0740cfe7ebbcb7b0aaa98b56191efd 100644 (file)
@@ -101,7 +101,7 @@ namespace Mono.Net.Security
                                        ServicePointManager.CheckCertificateRevocationList);
 
                                status = WebExceptionStatus.Success;
-                       } catch (Exception ex) {
+                       } catch (Exception) {
                                status = WebExceptionStatus.SecureChannelFailure;
                                throw;
                        } finally {
index 4e4d2859b032021c4fe0bbaf2b0dc9f7fb081b2d..f3b840e8f7f56533be087a32001bfdabaacd9a82 100644 (file)
@@ -1,7 +1,9 @@
 using System.Collections;
 using System.Collections.Generic;
 using System.Text.RegularExpressions;
+#if !MONOTOUCH_WATCH
 using Mono.Net;
+#endif
 
 namespace System.Net
 {
index 28e1c47e7d5801e8d0e81f3d2ad4db6c755c625d..9a8d89fab44999c3f6cbb4198abefb16585afccc 100644 (file)
@@ -27,8 +27,6 @@ namespace System.Security.Cryptography {
                                return "md2RSA";
                        case "1.2.840.113549.1.1.3":
                                return "md4RSA";
-                               return "md4RSA";
-                               return "md4RSA";
                        case "1.3.14.3.2.27":
                                return "dsaSHA1";
                        case "2.16.840.1.101.2.1.1.19":
index 7c67e68835ca47708e9569b5d732a26692428a8d..5979582c21dd72e6e5aa7e2eb199650288ae54ea 100644 (file)
@@ -7,7 +7,7 @@
     <SchemaVersion>2.0</SchemaVersion>\r
     <ProjectGuid>{483DB7F6-9145-4AE2-B9B2-2B5EE6FDEFB4}</ProjectGuid>\r
     <OutputType>Library</OutputType>\r
-    <NoWarn>1699,618</NoWarn>\r
+    <NoWarn>1699</NoWarn>\r
     <OutputPath>./../../class/lib/net_4_x/bare</OutputPath>\r
     <IntermediateOutputPath>obj-bare</IntermediateOutputPath>\r
     <GenerateTargetFrameworkAttribute>false</GenerateTargetFrameworkAttribute>\r
   <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' ">\r
     <DebugSymbols>true</DebugSymbols>\r
     <DebugType>full</DebugType>\r
-    <NoWarn>1699,618</NoWarn>\r
+    <NoWarn>1699</NoWarn>\r
     <Optimize>false</Optimize>\r
-    <DefineConstants>TRACE;NET_4_0;NET_4_5;NET_4_6;MONO;CONFIGURATION_2_0;FEATURE_PAL;SYSTEM_NAMESPACE;MONO;PLATFORM_UNIX;MONO_FEATURE_PROCESS_START;MONO_FEATURE_THREAD_ABORT;MONO_FEATURE_THREAD_SUSPEND_RESUME;MONO_FEATURE_MULTIPLE_APPDOMAINS</DefineConstants>\r
+    <DefineConstants>TRACE;NET_4_0;NET_4_5;NET_4_6;MONO;CONFIGURATION_2_0;FEATURE_PAL;SYSTEM_NAMESPACE;MONO;PLATFORM_UNIX;MONO_FEATURE_PROCESS_START;MONO_FEATURE_THREAD_ABORT;MONO_FEATURE_THREAD_SUSPEND_RESUME;MONO_FEATURE_MULTIPLE_APPDOMAINS;MONO_FEATURE_BTLS</DefineConstants>\r
     <ErrorReport>prompt</ErrorReport>\r
     <WarningLevel>4</WarningLevel>\r
   </PropertyGroup>\r
   <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|AnyCPU' ">\r
     <DebugType>pdbonly</DebugType>\r
-    <NoWarn>1699,618</NoWarn>\r
+    <NoWarn>1699</NoWarn>\r
     <Optimize>true</Optimize>\r
-    <DefineConstants>NET_4_0;NET_4_5;NET_4_6;MONO;CONFIGURATION_2_0;FEATURE_PAL;SYSTEM_NAMESPACE;MONO;PLATFORM_UNIX;MONO_FEATURE_PROCESS_START;MONO_FEATURE_THREAD_ABORT;MONO_FEATURE_THREAD_SUSPEND_RESUME;MONO_FEATURE_MULTIPLE_APPDOMAINS</DefineConstants>\r
+    <DefineConstants>NET_4_0;NET_4_5;NET_4_6;MONO;CONFIGURATION_2_0;FEATURE_PAL;SYSTEM_NAMESPACE;MONO;PLATFORM_UNIX;MONO_FEATURE_PROCESS_START;MONO_FEATURE_THREAD_ABORT;MONO_FEATURE_THREAD_SUSPEND_RESUME;MONO_FEATURE_MULTIPLE_APPDOMAINS;MONO_FEATURE_BTLS</DefineConstants>\r
     <ErrorReport>prompt</ErrorReport>\r
     <WarningLevel>4</WarningLevel>\r
   </PropertyGroup>\r
     <Compile Include="System.Net.Sockets\SocketAsyncEventArgs.cs" />\r
     <Compile Include="System.Net.Sockets\SocketAsyncResult.cs" />\r
     <Compile Include="System.Net.Sockets\SocketOperation.cs" />\r
+    <Compile Include="System.Net.Sockets\SocketReceiveFromResult.cs" />\r
+    <Compile Include="System.Net.Sockets\SocketReceiveMessageFromResult.cs" />\r
+    <Compile Include="System.Net.Sockets\SocketTaskExtensions.cs" />\r
     <Compile Include="System.Net.WebSockets\ClientWebSocket.cs" />\r
     <Compile Include="System.Net.WebSockets\ClientWebSocketOptions.cs" />\r
     <Compile Include="System.Net.WebSockets\HttpListenerWebSocketContext.cs" />\r
index 62daa34d9ee7e0caab17da1f31f10cacd6a9f196..fa55d4fa95ccb1bb542fe4ee4d39c3c256493a99 100644 (file)
@@ -7,7 +7,7 @@
     <SchemaVersion>2.0</SchemaVersion>\r
     <ProjectGuid>{2762E921-91A8-4C87-91E9-BA628013F753}</ProjectGuid>\r
     <OutputType>Library</OutputType>\r
-    <NoWarn>1699,618</NoWarn>\r
+    <NoWarn>1699</NoWarn>\r
     <OutputPath>./../../class/lib/net_4_x</OutputPath>\r
     <IntermediateOutputPath>obj-net_4_x</IntermediateOutputPath>\r
     <GenerateTargetFrameworkAttribute>false</GenerateTargetFrameworkAttribute>\r
   <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' ">\r
     <DebugSymbols>true</DebugSymbols>\r
     <DebugType>full</DebugType>\r
-    <NoWarn>1699,618</NoWarn>\r
+    <NoWarn>1699</NoWarn>\r
     <Optimize>false</Optimize>\r
-    <DefineConstants>TRACE;NET_4_0;NET_4_5;NET_4_6;MONO;CONFIGURATION_2_0;FEATURE_PAL;SYSTEM_NAMESPACE;MONO;PLATFORM_UNIX;MONO_FEATURE_PROCESS_START;MONO_FEATURE_THREAD_ABORT;MONO_FEATURE_THREAD_SUSPEND_RESUME;MONO_FEATURE_MULTIPLE_APPDOMAINS;SECURITY_DEP;XML_DEP;MONO_SECURITY_ALIAS;CONFIGURATION_DEP</DefineConstants>\r
+    <DefineConstants>TRACE;NET_4_0;NET_4_5;NET_4_6;MONO;CONFIGURATION_2_0;FEATURE_PAL;SYSTEM_NAMESPACE;MONO;PLATFORM_UNIX;MONO_FEATURE_PROCESS_START;MONO_FEATURE_THREAD_ABORT;MONO_FEATURE_THREAD_SUSPEND_RESUME;MONO_FEATURE_MULTIPLE_APPDOMAINS;MONO_FEATURE_BTLS;SECURITY_DEP;XML_DEP;MONO_SECURITY_ALIAS;CONFIGURATION_DEP</DefineConstants>\r
     <ErrorReport>prompt</ErrorReport>\r
     <WarningLevel>4</WarningLevel>\r
   </PropertyGroup>\r
   <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|AnyCPU' ">\r
     <DebugType>pdbonly</DebugType>\r
-    <NoWarn>1699,618</NoWarn>\r
+    <NoWarn>1699</NoWarn>\r
     <Optimize>true</Optimize>\r
-    <DefineConstants>NET_4_0;NET_4_5;NET_4_6;MONO;CONFIGURATION_2_0;FEATURE_PAL;SYSTEM_NAMESPACE;MONO;PLATFORM_UNIX;MONO_FEATURE_PROCESS_START;MONO_FEATURE_THREAD_ABORT;MONO_FEATURE_THREAD_SUSPEND_RESUME;MONO_FEATURE_MULTIPLE_APPDOMAINS;SECURITY_DEP;XML_DEP;MONO_SECURITY_ALIAS;CONFIGURATION_DEP</DefineConstants>\r
+    <DefineConstants>NET_4_0;NET_4_5;NET_4_6;MONO;CONFIGURATION_2_0;FEATURE_PAL;SYSTEM_NAMESPACE;MONO;PLATFORM_UNIX;MONO_FEATURE_PROCESS_START;MONO_FEATURE_THREAD_ABORT;MONO_FEATURE_THREAD_SUSPEND_RESUME;MONO_FEATURE_MULTIPLE_APPDOMAINS;MONO_FEATURE_BTLS;SECURITY_DEP;XML_DEP;MONO_SECURITY_ALIAS;CONFIGURATION_DEP</DefineConstants>\r
     <ErrorReport>prompt</ErrorReport>\r
     <WarningLevel>4</WarningLevel>\r
   </PropertyGroup>\r
     <Compile Include="System.Net.Sockets\SocketAsyncEventArgs.cs" />\r
     <Compile Include="System.Net.Sockets\SocketAsyncResult.cs" />\r
     <Compile Include="System.Net.Sockets\SocketOperation.cs" />\r
+    <Compile Include="System.Net.Sockets\SocketReceiveFromResult.cs" />\r
+    <Compile Include="System.Net.Sockets\SocketReceiveMessageFromResult.cs" />\r
+    <Compile Include="System.Net.Sockets\SocketTaskExtensions.cs" />\r
     <Compile Include="System.Net.WebSockets\ClientWebSocket.cs" />\r
     <Compile Include="System.Net.WebSockets\ClientWebSocketOptions.cs" />\r
     <Compile Include="System.Net.WebSockets\HttpListenerWebSocketContext.cs" />\r
index cd6f060736291efd57c549cf004b34f04e76cae9..fbb01b231b47026b59547d5b6b86734334446060 100644 (file)
@@ -7,7 +7,7 @@
     <SchemaVersion>2.0</SchemaVersion>\r
     <ProjectGuid>{19954F80-065E-4D46-8FEF-62BA4D6CFDAD}</ProjectGuid>\r
     <OutputType>Library</OutputType>\r
-    <NoWarn>1699,618</NoWarn>\r
+    <NoWarn>1699</NoWarn>\r
     <OutputPath>./../../class/lib/net_4_x/secxml</OutputPath>\r
     <IntermediateOutputPath>obj-secxml</IntermediateOutputPath>\r
     <GenerateTargetFrameworkAttribute>false</GenerateTargetFrameworkAttribute>\r
   <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' ">\r
     <DebugSymbols>true</DebugSymbols>\r
     <DebugType>full</DebugType>\r
-    <NoWarn>1699,618</NoWarn>\r
+    <NoWarn>1699</NoWarn>\r
     <Optimize>false</Optimize>\r
-    <DefineConstants>TRACE;NET_4_0;NET_4_5;NET_4_6;MONO;CONFIGURATION_2_0;FEATURE_PAL;SYSTEM_NAMESPACE;MONO;PLATFORM_UNIX;MONO_FEATURE_PROCESS_START;MONO_FEATURE_THREAD_ABORT;MONO_FEATURE_THREAD_SUSPEND_RESUME;MONO_FEATURE_MULTIPLE_APPDOMAINS;SECURITY_DEP;XML_DEP;MONO_SECURITY_ALIAS</DefineConstants>\r
+    <DefineConstants>TRACE;NET_4_0;NET_4_5;NET_4_6;MONO;CONFIGURATION_2_0;FEATURE_PAL;SYSTEM_NAMESPACE;MONO;PLATFORM_UNIX;MONO_FEATURE_PROCESS_START;MONO_FEATURE_THREAD_ABORT;MONO_FEATURE_THREAD_SUSPEND_RESUME;MONO_FEATURE_MULTIPLE_APPDOMAINS;MONO_FEATURE_BTLS;SECURITY_DEP;XML_DEP;MONO_SECURITY_ALIAS</DefineConstants>\r
     <ErrorReport>prompt</ErrorReport>\r
     <WarningLevel>4</WarningLevel>\r
   </PropertyGroup>\r
   <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|AnyCPU' ">\r
     <DebugType>pdbonly</DebugType>\r
-    <NoWarn>1699,618</NoWarn>\r
+    <NoWarn>1699</NoWarn>\r
     <Optimize>true</Optimize>\r
-    <DefineConstants>NET_4_0;NET_4_5;NET_4_6;MONO;CONFIGURATION_2_0;FEATURE_PAL;SYSTEM_NAMESPACE;MONO;PLATFORM_UNIX;MONO_FEATURE_PROCESS_START;MONO_FEATURE_THREAD_ABORT;MONO_FEATURE_THREAD_SUSPEND_RESUME;MONO_FEATURE_MULTIPLE_APPDOMAINS;SECURITY_DEP;XML_DEP;MONO_SECURITY_ALIAS</DefineConstants>\r
+    <DefineConstants>NET_4_0;NET_4_5;NET_4_6;MONO;CONFIGURATION_2_0;FEATURE_PAL;SYSTEM_NAMESPACE;MONO;PLATFORM_UNIX;MONO_FEATURE_PROCESS_START;MONO_FEATURE_THREAD_ABORT;MONO_FEATURE_THREAD_SUSPEND_RESUME;MONO_FEATURE_MULTIPLE_APPDOMAINS;MONO_FEATURE_BTLS;SECURITY_DEP;XML_DEP;MONO_SECURITY_ALIAS</DefineConstants>\r
     <ErrorReport>prompt</ErrorReport>\r
     <WarningLevel>4</WarningLevel>\r
   </PropertyGroup>\r
     <Compile Include="System.Net.Sockets\SocketAsyncEventArgs.cs" />\r
     <Compile Include="System.Net.Sockets\SocketAsyncResult.cs" />\r
     <Compile Include="System.Net.Sockets\SocketOperation.cs" />\r
+    <Compile Include="System.Net.Sockets\SocketReceiveFromResult.cs" />\r
+    <Compile Include="System.Net.Sockets\SocketReceiveMessageFromResult.cs" />\r
+    <Compile Include="System.Net.Sockets\SocketTaskExtensions.cs" />\r
     <Compile Include="System.Net.WebSockets\ClientWebSocket.cs" />\r
     <Compile Include="System.Net.WebSockets\ClientWebSocketOptions.cs" />\r
     <Compile Include="System.Net.WebSockets\HttpListenerWebSocketContext.cs" />\r
index b24eda319cfeab888dc038a778aa6d7d2ec47c07..192f1c070739da293c929c92976b268f2e2f7a8c 100644 (file)
@@ -37,6 +37,8 @@ using System.IO;
 using System.Runtime.InteropServices;
 using System.Security.Permissions;
 
+#pragma warning disable 618
+
 namespace System.CodeDom.Compiler {
 
        [ComVisible (true)]
@@ -314,3 +316,5 @@ namespace System.CodeDom.Compiler {
                }               
        }
 }
+
+#pragma warning restore 618
\ No newline at end of file
index 80c30eece70d9d13e40ed5d50ffb86c729d42938..2f679cb6895010260c4996643d1da974189921ed 100644 (file)
@@ -103,11 +103,13 @@ namespace System.CodeDom.Compiler {
                                                }
                                        }
 
+#if FEATURE_MONO_CAS
                                        // and you must have discovery access to the combined path
                                        // note: the cache behaviour is tested in the CAS tests
                                        if (SecurityManager.SecurityEnabled) {
                                                new FileIOPermission (FileIOPermissionAccess.PathDiscovery, basepath).Demand ();
                                        }
+#endif
                                }
 
                                return(basepath);
index 7a0bd6ef5dff7a556ba5159e668a4887b9b1acb6..304238e63d589bfa889a0ebf06f25e432ab49023 100644 (file)
@@ -31,6 +31,8 @@
 using System.Reflection;
 using System.Collections.Specialized;
 
+#pragma warning disable 618
+
 namespace System.Configuration
 {
        public class AppSettingsReader
index 89adbe2589101044f97e5213389bd42f7dd8bb65..fd9bb69de96581ab123a4b99819b0d4bbf4bffd1 100644 (file)
@@ -34,6 +34,8 @@ using System.Collections.Specialized;
 using System.Xml;
 #endif
 
+#pragma warning disable 618
+
 namespace System.Configuration
 {
        class ConfigHelper
index 1ab98591990dbc8668c681db8452119b74526f55..c6ec61f1af60067e9072385ad0d2f13720d2f9a7 100644 (file)
@@ -37,6 +37,8 @@ using System.Security.Permissions;
 #if (XML_DEP)
 using System.Xml;
 
+#pragma warning disable 618
+
 namespace System.Configuration
 {
        [PermissionSet (SecurityAction.LinkDemand, Unrestricted = true)]
index 9b2f8e9986b8768ff7ae95a95620bbb19cb9d7a1..8a038c81aa62ecee7ab1d79e8db136561da1886c 100644 (file)
@@ -43,6 +43,8 @@ using System.Xml;
 using System.Xml.XPath;
 #endif
 
+#pragma warning disable 618
+
 namespace System.Configuration
 {
        public sealed class ConfigurationSettings
index efa336e927c8ee4f3ba5a20f26045ba53fe8ba00..301c65d87b5cdce21a45a07671e2353392bfa6a2 100644 (file)
@@ -37,6 +37,8 @@ using System.Xml;
 using XmlNode = System.Object;
 #endif
 
+#pragma warning disable 618
+
 namespace System.Configuration
 {
        public class NameValueFileSectionHandler : IConfigurationSectionHandler
index 346b5b5f3a1fe5f91f77e8ac753035bb1e59903a..9c66654b3da57cc359f6a4def3d0fa09a075708b 100644 (file)
@@ -36,6 +36,8 @@ using System.Xml;
 using XmlNode = System.Object;
 #endif
 
+#pragma warning disable 618
+
 namespace System.Configuration
 {
        /// <summary>
index cecf7de61f45b6d20b1ff3c631e1e1c2d38a5403..e1940f910f25823b68a4bff1dc65ecb3e7da20d1 100644 (file)
@@ -32,7 +32,6 @@
 //
 
 using System;
-using System.Diagnostics;
 using System.Collections;
 using System.ComponentModel;
 using System.ComponentModel.Design;
@@ -40,6 +39,8 @@ using System.Globalization;
 using System.IO;
 using System.Runtime.InteropServices;
 
+#pragma warning disable 618
+
 namespace System.Diagnostics 
 {
        [DefaultEvent ("EntryWritten")]
index f76f0950f459bbf951ebbf0ebba82e30b0f097bf..4261b3bc491040c8aee0446fe9f8fa71be8313ae 100644 (file)
@@ -159,7 +159,7 @@ namespace System.Diagnostics {
                }
 
                // may throw ArgumentNullException
-               [DefaultValue (""), ReadOnly (true), RecommendedAsConfigurable (true)]
+               [DefaultValue (""), ReadOnly (true), SettingsBindable (true)]
                [TypeConverter ("System.Diagnostics.Design.CategoryValueConverter, " + Consts.AssemblySystem_Design)]
                [SRDescription ("The category name for this performance counter.")]
                public string CategoryName {
@@ -181,7 +181,7 @@ namespace System.Diagnostics {
                }
 
                // may throw ArgumentNullException
-               [DefaultValue (""), ReadOnly (true), RecommendedAsConfigurable (true)]
+               [DefaultValue (""), ReadOnly (true), SettingsBindable (true)]
                [TypeConverter ("System.Diagnostics.Design.CounterNameConverter, " + Consts.AssemblySystem_Design)]
                [SRDescription ("The name of this performance counter.")]
                public string CounterName 
@@ -212,7 +212,7 @@ namespace System.Diagnostics {
                        set { lifetime = value; }
                }
 
-               [DefaultValue (""), ReadOnly (true), RecommendedAsConfigurable (true)]
+               [DefaultValue (""), ReadOnly (true), SettingsBindable (true)]
                [TypeConverter ("System.Diagnostics.Design.InstanceNameConverter, " + Consts.AssemblySystem_Design)]
                [SRDescription ("The instance name for this performance counter.")]
                public string InstanceName {
@@ -227,7 +227,7 @@ namespace System.Diagnostics {
 
                // may throw ArgumentException if machine name format is wrong
                [MonoTODO("What's the machine name format?")]
-               [DefaultValue ("."), Browsable (false), RecommendedAsConfigurable (true)]
+               [DefaultValue ("."), Browsable (false), SettingsBindable (true)]
                [SRDescription ("The machine where this performance counter resides.")]
                public string MachineName {
                        get {return machineName;}
index 02e1e3d10009c8ba67b112e289c6f160184c1133..d3fd1d5770922196e794f133f9a1a420f5f1d495 100644 (file)
@@ -737,7 +737,7 @@ namespace System.Diagnostics
                        while (true) {
                                try {
                                        resetEvent.WaitOne ();
-                               } catch (ObjectDisposedException e) {
+                               } catch (ObjectDisposedException) {
                                        // Notifications have been disabled and event 
                                        // has been closed but not yet nulled. End thread.
                                        break;
index 43d3c2f362e1f681a13c46a53265585006de6e6a..53e31d61f7ea7d7891f431b4800e42ffe8b09d29 100644 (file)
@@ -224,7 +224,7 @@ namespace System.IO {
 
                [DefaultValue("*.*")]
                [IODescription("File name filter pattern")]
-               [RecommendedAsConfigurable(true)]
+               [SettingsBindable(true)]
                [TypeConverter ("System.Diagnostics.Design.StringValueConverter, " + Consts.AssemblySystem_Design)]
                public string Filter {
                        get { return filter; }
@@ -293,7 +293,7 @@ namespace System.IO {
 
                [DefaultValue("")]
                [IODescription("The directory to monitor")]
-               [RecommendedAsConfigurable(true)]
+               [SettingsBindable(true)]
                [TypeConverter ("System.Diagnostics.Design.StringValueConverter, " + Consts.AssemblySystem_Design)]
                [Editor ("System.Diagnostics.Design.FSWPathEditor, " + Consts.AssemblySystem_Design, "System.Drawing.Design.UITypeEditor, " + Consts.AssemblySystem_Drawing)]
                public string Path {
index 04bd35a142f7a54ca212fb25b2faa7cebe938cdd..e1031141a9fad2beb01ac72d286f28feade96d83 100644 (file)
@@ -28,6 +28,8 @@
 
 using System.ComponentModel;
 
+#pragma warning disable 67
+
 namespace System.IO
 {
     public class FileSystemWatcher : Component, IDisposable, ISupportInitialize
@@ -57,7 +59,6 @@ namespace System.IO
         protected void OnRenamed (RenamedEventArgs e) { throw new NotImplementedException (); }
         public WaitForChangedResult WaitForChanged (WatcherChangeTypes changeType) { throw new NotImplementedException (); }
         public WaitForChangedResult WaitForChanged (WatcherChangeTypes changeType, int timeout) { throw new NotImplementedException (); }
-        public virtual void Dispose () { throw new NotImplementedException (); }
         protected override void Dispose (bool disposing) { throw new NotImplementedException (); }
     }
 }
\ No newline at end of file
index 42a0d5afb7583832643a0cadd4e791a2d6f0c458..36a1db9d29b399399e103b3c3bd6909bcb4da2e3 100644 (file)
@@ -36,6 +36,8 @@ using System.Xml;
 using XmlNode = System.Object;
 #endif
 
+#pragma warning disable 618
+
 namespace System.Net.Configuration
 {
        class ConnectionManagementData
index 594803e2c2dc0314087b3dbec5c55e6ccd4f14c0..1bdf52da949c9952bb88fe1b193d263341de7a29 100644 (file)
@@ -64,9 +64,9 @@ namespace System.Net.Configuration
                                        continue;
                                }
 
-                               string prefix = HandlersUtil.ExtractAttributeValue ("prefix", child);
+                               //string prefix = HandlersUtil.ExtractAttributeValue ("prefix", child);
                                if (name == "add") {
-                                       string type = HandlersUtil.ExtractAttributeValue ("type", child, false);
+                                       //string type = HandlersUtil.ExtractAttributeValue ("type", child, false);
                                        if (child.Attributes != null && child.Attributes.Count != 0)
                                                HandlersUtil.ThrowException ("Unrecognized attribute", child);
 
index be2d13b71c02383937747b08837e1de486198005..6b5e60cdcff8abc84a7baa53eb32ef01b88254c7 100644 (file)
@@ -487,7 +487,7 @@ namespace System.Net.NetworkInformation {
 
                public override IcmpV4Statistics GetIcmpV4Statistics ()
                {
-                       if (!Socket.SupportsIPv4)
+                       if (!Socket.OSSupportsIPv4)
                                throw new NetworkInformationException ();
                        Win32_MIBICMPINFO stats;
                        GetIcmpStatistics (out stats, AF_INET);
@@ -505,7 +505,7 @@ namespace System.Net.NetworkInformation {
 
                public override IPGlobalStatistics GetIPv4GlobalStatistics ()
                {
-                       if (!Socket.SupportsIPv4)
+                       if (!Socket.OSSupportsIPv4)
                                throw new NetworkInformationException ();
                        Win32_MIB_IPSTATS stats;
                        GetIpStatisticsEx (out stats, AF_INET);
@@ -523,7 +523,7 @@ namespace System.Net.NetworkInformation {
 
                public override TcpStatistics GetTcpIPv4Statistics ()
                {
-                       if (!Socket.SupportsIPv4)
+                       if (!Socket.OSSupportsIPv4)
                                throw new NetworkInformationException ();
                        Win32_MIB_TCPSTATS stats;
                        GetTcpStatisticsEx (out stats, AF_INET);
@@ -541,7 +541,7 @@ namespace System.Net.NetworkInformation {
 
                public override UdpStatistics GetUdpIPv4Statistics ()
                {
-                       if (!Socket.SupportsIPv4)
+                       if (!Socket.OSSupportsIPv4)
                                throw new NetworkInformationException ();
                        Win32_MIB_UDPSTATS stats;
                        GetUdpStatisticsEx (out stats, AF_INET);
index 56d0e4d61f9453ecd233301ebdcf936cb30b354c..3f872e731c6a6f5fea677b5090f1e25112219f53 100644 (file)
@@ -510,7 +510,6 @@ namespace System.Net.NetworkInformation {
 #if MONOTOUCH || XAMMAC
                        return new MacOsNetworkInterfaceAPI ();
 #else
-                       Version windowsVer51 = new Version (5, 1);
                        bool runningOnUnix = (Environment.OSVersion.Platform == PlatformID.Unix);
 
                        if (runningOnUnix) {
@@ -521,6 +520,7 @@ namespace System.Net.NetworkInformation {
                        }
 
 #if !MOBILE
+                       Version windowsVer51 = new Version (5, 1);
                        if (Environment.OSVersion.Version >= windowsVer51)
                                return new Win32NetworkInterfaceAPI ();
 #endif
@@ -633,13 +633,13 @@ namespace System.Net.NetworkInformation {
 
 #if MONODROID
                [DllImport ("__Internal")]
-               protected static extern int _monodroid_get_android_api_level ();
+               static extern int _monodroid_get_android_api_level ();
 
                [DllImport ("__Internal")]
-               protected static extern bool _monodroid_get_network_interface_up_state (string ifname, ref bool is_up);
+               static extern bool _monodroid_get_network_interface_up_state (string ifname, ref bool is_up);
 
                [DllImport ("__Internal")]
-               protected static extern bool _monodroid_get_network_interface_supports_multicast (string ifname, ref bool supports_multicast);
+               static extern bool _monodroid_get_network_interface_supports_multicast (string ifname, ref bool supports_multicast);
 
                bool android_use_java_api;
 #endif
index 8232a9eaac445c5a035e6bff57ab6ef45357b3ff..c69388a58076e36d35a638b0dd911fcf785f9a46 100644 (file)
@@ -209,9 +209,12 @@ namespace System.Net.NetworkInformation {
 
                static IPAddress GetNonLoopbackIP ()
                {
+#pragma warning disable 618
                        foreach (IPAddress addr in Dns.GetHostByName (Dns.GetHostName ()).AddressList)
                                if (!IPAddress.IsLoopback (addr))
                                        return addr;
+#pragma warning restore 618
+
                        throw new InvalidOperationException ("Could not resolve non-loopback IP address for localhost");
                }
 
index bf483016db3025211c0293aa96997b51d9e4320f..701eaaad7616c9d654f109aab64485f554384be0 100644 (file)
@@ -94,7 +94,9 @@ namespace System.Net.Security
 
                static MonoTlsProvider GetProvider ()
                {
+#pragma warning disable 612
                        return MonoTlsProviderFactory.GetDefaultProvider ();
+#pragma warning restore 612
                }
 
                public SslStream (Stream innerStream)
index ceb1958c6c890650834747c3b4361fb6d40672d9..08c2630eaccea76530243ebdab360af8c5b468ce 100644 (file)
@@ -1754,7 +1754,7 @@ namespace System.Net.Sockets
                        if (endPoint == null)
                                throw new ArgumentNullException ("endPoint");
 
-                       SocketAsyncResult sockares = ValidateEndIAsyncResult (asyncResult, "EndReceiveMessageFrom", "asyncResult");
+                       /*SocketAsyncResult sockares =*/ ValidateEndIAsyncResult (asyncResult, "EndReceiveMessageFrom", "asyncResult");
 
                        throw new NotImplementedException ();
                }
diff --git a/mcs/class/System/System.Net.Sockets/SocketReceiveFromResult.cs b/mcs/class/System/System.Net.Sockets/SocketReceiveFromResult.cs
new file mode 100644 (file)
index 0000000..6059483
--- /dev/null
@@ -0,0 +1,40 @@
+//
+// SocketReceiveFromResult.cs
+//
+// Authors:
+//     Marek Safar  <marek.safar@gmail.com>
+//
+// Copyright (C) 2016 Xamarin Inc (http://www.xamarin.com)
+//
+// Permission is hereby granted, free of charge, to any person obtaining
+// a copy of this software and associated documentation files (the
+// "Software"), to deal in the Software without restriction, including
+// without limitation the rights to use, copy, modify, merge, publish,
+// distribute, sublicense, and/or sell copies of the Software, and to
+// permit persons to whom the Software is furnished to do so, subject to
+// the following conditions:
+//
+// The above copyright notice and this permission notice shall be
+// included in all copies or substantial portions of the Software.
+//
+// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
+// EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
+// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
+// NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
+// LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
+// OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
+// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
+//
+
+#if NETSTANDARD
+
+namespace System.Net.Sockets
+{
+       public struct SocketReceiveFromResult
+       {
+               public int ReceivedBytes;
+               public EndPoint RemoteEndPoint;
+       }
+}
+
+#endif
diff --git a/mcs/class/System/System.Net.Sockets/SocketReceiveMessageFromResult.cs b/mcs/class/System/System.Net.Sockets/SocketReceiveMessageFromResult.cs
new file mode 100644 (file)
index 0000000..f06b339
--- /dev/null
@@ -0,0 +1,42 @@
+//
+// SocketReceiveMessageFromResult.cs
+//
+// Authors:
+//     Marek Safar  <marek.safar@gmail.com>
+//
+// Copyright (C) 2016 Xamarin Inc (http://www.xamarin.com)
+//
+// Permission is hereby granted, free of charge, to any person obtaining
+// a copy of this software and associated documentation files (the
+// "Software"), to deal in the Software without restriction, including
+// without limitation the rights to use, copy, modify, merge, publish,
+// distribute, sublicense, and/or sell copies of the Software, and to
+// permit persons to whom the Software is furnished to do so, subject to
+// the following conditions:
+//
+// The above copyright notice and this permission notice shall be
+// included in all copies or substantial portions of the Software.
+//
+// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
+// EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
+// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
+// NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
+// LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
+// OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
+// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
+//
+
+#if NETSTANDARD
+
+namespace System.Net.Sockets
+{
+       public struct SocketReceiveMessageFromResult
+       {
+               public int ReceivedBytes;
+               public SocketFlags SocketFlags;
+               public EndPoint RemoteEndPoint;
+               public IPPacketInformation PacketInformation;
+       }
+}
+
+#endif
diff --git a/mcs/class/System/System.Net.Sockets/SocketTaskExtensions.cs b/mcs/class/System/System.Net.Sockets/SocketTaskExtensions.cs
new file mode 100644 (file)
index 0000000..33bb55a
--- /dev/null
@@ -0,0 +1,254 @@
+// Licensed to the .NET Foundation under one or more agreements.
+// The .NET Foundation licenses this file to you under the MIT license.
+// See the LICENSE file in the project root for more information.
+
+#if NETSTANDARD
+
+using System.Collections.Generic;
+using System.Threading.Tasks;
+
+namespace System.Net.Sockets
+{
+    public static class SocketTaskExtensions
+    {
+        public static Task<Socket> AcceptAsync(this Socket socket)
+        {
+            return Task<Socket>.Factory.FromAsync(
+                (callback, state) => ((Socket)state).BeginAccept(callback, state),
+                asyncResult => ((Socket)asyncResult.AsyncState).EndAccept(asyncResult),
+                state: socket);
+        }
+
+        public static Task<Socket> AcceptAsync(this Socket socket, Socket acceptSocket)
+        {
+            const int ReceiveSize = 0;
+            return Task<Socket>.Factory.FromAsync(
+                (socketForAccept, receiveSize, callback, state) => ((Socket)state).BeginAccept(socketForAccept, receiveSize, callback, state),
+                asyncResult => ((Socket)asyncResult.AsyncState).EndAccept(asyncResult),
+                acceptSocket,
+                ReceiveSize,
+                state: socket);
+        }
+
+        public static Task ConnectAsync(this Socket socket, EndPoint remoteEP)
+        {
+            return Task.Factory.FromAsync(
+                (targetEndPoint, callback, state) => ((Socket)state).BeginConnect(targetEndPoint, callback, state),
+                asyncResult => ((Socket)asyncResult.AsyncState).EndConnect(asyncResult),
+                remoteEP,
+                state: socket);
+        }
+
+        public static Task ConnectAsync(this Socket socket, IPAddress address, int port)
+        {
+            return Task.Factory.FromAsync(
+                (targetAddress, targetPort, callback, state) => ((Socket)state).BeginConnect(targetAddress, targetPort, callback, state),
+                asyncResult => ((Socket)asyncResult.AsyncState).EndConnect(asyncResult),
+                address,
+                port,
+                state: socket);
+        }
+
+        public static Task ConnectAsync(this Socket socket, IPAddress[] addresses, int port)
+        {
+            return Task.Factory.FromAsync(
+                (targetAddresses, targetPort, callback, state) => ((Socket)state).BeginConnect(targetAddresses, targetPort, callback, state),
+                asyncResult => ((Socket)asyncResult.AsyncState).EndConnect(asyncResult),
+                addresses,
+                port,
+                state: socket);
+        }
+
+        public static Task ConnectAsync(this Socket socket, string host, int port)
+        {
+            return Task.Factory.FromAsync(
+                (targetHost, targetPort, callback, state) => ((Socket)state).BeginConnect(targetHost, targetPort, callback, state),
+                asyncResult => ((Socket)asyncResult.AsyncState).EndConnect(asyncResult),
+                host,
+                port,
+                state: socket);
+        }
+
+        public static Task<int> ReceiveAsync(this Socket socket, ArraySegment<byte> buffer, SocketFlags socketFlags)
+        {
+            return Task<int>.Factory.FromAsync(
+                (targetBuffer, flags, callback, state) => ((Socket)state).BeginReceive(
+                                                              targetBuffer.Array,
+                                                              targetBuffer.Offset,
+                                                              targetBuffer.Count,
+                                                              flags,
+                                                              callback,
+                                                              state),
+                asyncResult => ((Socket)asyncResult.AsyncState).EndReceive(asyncResult),
+                buffer,
+                socketFlags,
+                state: socket);
+        }
+
+        public static Task<int> ReceiveAsync(
+            this Socket socket,
+            IList<ArraySegment<byte>> buffers,
+            SocketFlags socketFlags)
+        {
+            return Task<int>.Factory.FromAsync(
+                (targetBuffers, flags, callback, state) => ((Socket)state).BeginReceive(targetBuffers, flags, callback, state),
+                asyncResult => ((Socket)asyncResult.AsyncState).EndReceive(asyncResult),
+                buffers,
+                socketFlags,
+                state: socket);
+        }
+
+        public static Task<SocketReceiveFromResult> ReceiveFromAsync(
+            this Socket socket,
+            ArraySegment<byte> buffer,
+            SocketFlags socketFlags,
+            EndPoint remoteEndPoint)
+        {
+            object[] packedArguments = new object[] { socket, remoteEndPoint };
+
+            return Task<SocketReceiveFromResult>.Factory.FromAsync(
+                (targetBuffer, flags, callback, state) =>
+                {
+                    var arguments = (object[])state;
+                    var s = (Socket)arguments[0];
+                    var e = (EndPoint)arguments[1];
+
+                    IAsyncResult result = s.BeginReceiveFrom(
+                        targetBuffer.Array,
+                        targetBuffer.Offset,
+                        targetBuffer.Count,
+                        flags,
+                        ref e,
+                        callback,
+                        state);
+
+                    arguments[1] = e;
+                    return result;
+                },
+                asyncResult =>
+                {
+                    var arguments = (object[])asyncResult.AsyncState;
+                    var s = (Socket)arguments[0];
+                    var e = (EndPoint)arguments[1];
+
+                    int bytesReceived = s.EndReceiveFrom(asyncResult, ref e);
+
+                    return new SocketReceiveFromResult()
+                    {
+                        ReceivedBytes = bytesReceived,
+                        RemoteEndPoint = e
+                    };
+                },
+                buffer,
+                socketFlags,
+                state: packedArguments);
+        }
+
+        public static Task<SocketReceiveMessageFromResult> ReceiveMessageFromAsync(
+            this Socket socket,
+            ArraySegment<byte> buffer,
+            SocketFlags socketFlags,
+            EndPoint remoteEndPoint)
+        {
+            object[] packedArguments = new object[] { socket, socketFlags, remoteEndPoint };
+
+            return Task<SocketReceiveMessageFromResult>.Factory.FromAsync(
+                (targetBuffer, callback, state) =>
+                {
+                    var arguments = (object[])state;
+                    var s = (Socket)arguments[0];
+                    var f = (SocketFlags)arguments[1];
+                    var e = (EndPoint)arguments[2];
+
+                    IAsyncResult result = s.BeginReceiveMessageFrom(
+                        targetBuffer.Array,
+                        targetBuffer.Offset,
+                        targetBuffer.Count,
+                        f,
+                        ref e,
+                        callback,
+                        state);
+
+                    arguments[2] = e;
+                    return result;
+                },
+                asyncResult =>
+                {
+                    var arguments = (object[])asyncResult.AsyncState;
+                    var s = (Socket)arguments[0];
+                    var f = (SocketFlags)arguments[1];
+                    var e = (EndPoint)arguments[2];
+                    IPPacketInformation ipPacket;
+
+                    int bytesReceived = s.EndReceiveMessageFrom(
+                        asyncResult,
+                        ref f,
+                        ref e,
+                        out ipPacket);
+
+                    return new SocketReceiveMessageFromResult()
+                    {
+                        PacketInformation = ipPacket,
+                        ReceivedBytes = bytesReceived,
+                        RemoteEndPoint = e,
+                        SocketFlags = f
+                    };
+                },
+                buffer,
+                state: packedArguments);
+        }
+
+        public static Task<int> SendAsync(this Socket socket, ArraySegment<byte> buffer, SocketFlags socketFlags)
+        {
+            return Task<int>.Factory.FromAsync(
+                (targetBuffer, flags, callback, state) => ((Socket)state).BeginSend(
+                                                              targetBuffer.Array,
+                                                              targetBuffer.Offset,
+                                                              targetBuffer.Count,
+                                                              flags,
+                                                              callback,
+                                                              state),
+                asyncResult => ((Socket)asyncResult.AsyncState).EndSend(asyncResult),
+                buffer,
+                socketFlags,
+                state: socket);
+        }
+
+        public static Task<int> SendAsync(
+            this Socket socket,
+            IList<ArraySegment<byte>> buffers,
+            SocketFlags socketFlags)
+        {
+            return Task<int>.Factory.FromAsync(
+                (targetBuffers, flags, callback, state) => ((Socket)state).BeginSend(targetBuffers, flags, callback, state),
+                asyncResult => ((Socket)asyncResult.AsyncState).EndSend(asyncResult),
+                buffers,
+                socketFlags,
+                state: socket);
+        }
+
+        public static Task<int> SendToAsync(
+            this Socket socket,
+            ArraySegment<byte> buffer,
+            SocketFlags socketFlags,
+            EndPoint remoteEP)
+        {
+            return Task<int>.Factory.FromAsync(
+                (targetBuffer, flags, endPoint, callback, state) => ((Socket)state).BeginSendTo(
+                                                                        targetBuffer.Array,
+                                                                        targetBuffer.Offset,
+                                                                        targetBuffer.Count,
+                                                                        flags,
+                                                                        endPoint,
+                                                                        callback,
+                                                                        state),
+                asyncResult => ((Socket)asyncResult.AsyncState).EndSendTo(asyncResult),
+                buffer,
+                socketFlags,
+                remoteEP,
+                state: socket);
+        }
+    }
+}
+
+#endif
index a9c5bb9ee32bb7e7a7208fb5ff68081f11a143de..a12aa233b71643e260d48e1ed79834390f9d6de0 100644 (file)
@@ -370,7 +370,7 @@ namespace System.Net {
                                                return false;
                                        if (InputStream.EndRead (ares) <= 0)
                                                return true;
-                               } catch (ObjectDisposedException e) {
+                               } catch (ObjectDisposedException) {
                                        input_stream = null;
                                        return true;
                                } catch {
index 6a47f40ae2a3cf823bfda8923e86cb2a7334e2f1..03993e989590fdf086917fa523d314b1dfa6d68d 100644 (file)
@@ -97,7 +97,7 @@ namespace System.Net {
                                                        InternalWrite (bytes, 0, bytes.Length);
                                                        trailer_sent = true;
                                                }
-                                       } catch (IOException ex) {
+                                       } catch (IOException) {
                                                // Ignore error due to connection reset by peer
                                        }
                                }
index d379526e80b9cb0510bd1619ad782d4d339d5fa3..56d682bd402541a3c79e35f0bcc17c1922525f86 100644 (file)
@@ -158,7 +158,10 @@ namespace System.Net
                                return;
                        }
 #endif
+
+#pragma warning disable 618
                        manager = (ConnectionManagementData) ConfigurationSettings.GetConfig (configKey);
+#pragma warning restore 618
                        if (manager != null) {
                                defaultConnectionLimit = (int) manager.GetMaxConnections ("*");                         
                        }
index ac6db80037dfe506d1b2da49ad07c8196424eb33..2d7dd557095b3061703d872fd14f33aeff1e6d2f 100644 (file)
@@ -133,7 +133,7 @@ namespace System.Security.AccessControl
                        SetAuditRule((AuditRule)rule);
                }
                
-               internal new void Persist (SafeHandle handle)
+               internal void Persist (SafeHandle handle)
                {
                        WriteLock();
                        try {
index 9bbe99f86314cd4eb7e1eafbb667171e3133e079..7d0b3d1487cda4b4b5a74edbc957997fa56556f1 100644 (file)
@@ -35,13 +35,13 @@ extern alias MonoSecurity;
 using MonoSecurity::Mono.Security.Interface;
 using MX = MonoSecurity::Mono.Security.X509;
 #else
-#if !FEATURE_NO_BSD_SOCKETS
+#if MONO_FEATURE_BTLS
 using Mono.Security.Interface;
 #endif
 using MX = Mono.Security.X509;
 #endif
 
-#if !FEATURE_NO_BSD_SOCKETS
+#if MONO_FEATURE_BTLS
 using Mono.Btls;
 #endif
 #endif
@@ -94,7 +94,7 @@ namespace System.Security.Cryptography.X509Certificates
                        X509Helper.ThrowIfContextInvalid (impl);
                }
 
-#if FEATURE_NO_BSD_SOCKETS
+#if !MONO_FEATURE_BTLS
                static X509Certificate GetNativeInstance (X509CertificateImpl impl)
                {
                        throw new PlatformNotSupportedException ();
@@ -122,11 +122,11 @@ namespace System.Security.Cryptography.X509Certificates
                                x509.ExportAsPEM (bio, includeHumanReadableForm);
                        }
                }
-#endif // !FEATURE_NO_BSD_SOCKETS
+#endif // !MONO_FEATURE_BTLS
 
                internal static X509Certificate2Impl Import (byte[] rawData, string password, X509KeyStorageFlags keyStorageFlags, bool disableProvider = false)
                {
-#if !FEATURE_NO_BSD_SOCKETS
+#if MONO_FEATURE_BTLS
                        if (!disableProvider) {
                                var provider = MonoTlsProviderFactory.GetProvider ();
                                if (provider.HasNativeCertificates) {
@@ -134,7 +134,7 @@ namespace System.Security.Cryptography.X509Certificates
                                        return impl;
                                }
                        }
-#endif // FEATURE_NO_BSD_SOCKETS
+#endif // MONO_FEATURE_BTLS
                        var impl2 = new X509Certificate2ImplMono ();
                        impl2.Import (rawData, password, keyStorageFlags);
                        return impl2;
@@ -142,7 +142,7 @@ namespace System.Security.Cryptography.X509Certificates
 
                internal static X509Certificate2Impl Import (X509Certificate cert, bool disableProvider = false)
                {
-#if !FEATURE_NO_BSD_SOCKETS
+#if MONO_FEATURE_BTLS
                        if (!disableProvider) {
                                var provider = MonoTlsProviderFactory.GetProvider ();
                                if (provider.HasNativeCertificates) {
@@ -150,7 +150,7 @@ namespace System.Security.Cryptography.X509Certificates
                                        return impl;
                                }
                        }
-#endif // FEATURE_NO_BSD_SOCKETS
+#endif // MONO_FEATURE_BTLS
                        var impl2 = cert.Impl as X509Certificate2Impl;
                        if (impl2 != null)
                                return (X509Certificate2Impl)impl2.Clone ();
index ffb1bec695ae250a93af7939f9ed3cc7ef3a5527..e1cabcf69ae5cddbf98a5542667b8eba0b381f83 100644 (file)
@@ -380,6 +380,9 @@ System.Net.Sockets/Socket.cs
 System.Net.Sockets/SocketAsyncEventArgs.cs
 System.Net.Sockets/SocketAsyncResult.cs
 System.Net.Sockets/SocketOperation.cs
+System.Net.Sockets/SocketReceiveFromResult.cs
+System.Net.Sockets/SocketReceiveMessageFromResult.cs
+System.Net.Sockets/SocketTaskExtensions.cs
 System.Net/WebAsyncResult.cs
 System.Net/WebConnection.cs
 System.Net/WebConnectionData.cs
@@ -534,8 +537,8 @@ Mono.Btls/MonoBtlsX509Exception.cs
 Mono.Btls/MonoBtlsX509FileType.cs
 Mono.Btls/MonoBtlsX509Format.cs
 Mono.Btls/MonoBtlsX509Lookup.cs
-Mono.Btls/MonoBtlsX509LookupMono.cs
 Mono.Btls/MonoBtlsX509LookupMonoCollection.cs
+Mono.Btls/MonoBtlsX509LookupMono.cs
 Mono.Btls/MonoBtlsX509LookupType.cs
 Mono.Btls/MonoBtlsX509Name.cs
 Mono.Btls/MonoBtlsX509NameList.cs
index 3b048781f29ad6a15109241cb99f362d55b2f521..30531be7e880c09a3d69330be30fbc807154b7dc 100644 (file)
@@ -1778,6 +1778,9 @@ namespace MonoTests.System.Net
                }
 
                [Test]
+#if FEATURE_NO_BSD_SOCKETS
+               [ExpectedException (typeof (PlatformNotSupportedException))]
+#endif
                public void DefaultProxy ()
                {
                        WebClient wc = new WebClient ();
index 1a1b0f529166cf01d39b6a8e23a1967a655a97de..830e8c0db7ef2be804744d1a794e55acb39b20dd 100644 (file)
@@ -123,6 +123,9 @@ System.Net.Sockets/Socket.cs
 System.Net.Sockets/SocketAsyncEventArgs.cs
 System.Net.Sockets/SocketAsyncResult.cs
 System.Net.Sockets/SocketOperation.cs
+System.Net.Sockets/SocketReceiveFromResult.cs
+System.Net.Sockets/SocketReceiveMessageFromResult.cs
+System.Net.Sockets/SocketTaskExtensions.cs
 System.Net/AuthenticationManager.cs
 System.Net/BasicClient.cs
 System.Net/BindIPEndPoint.cs
index 1f1f61233b04f32ec4b5e7004d2673a8dd13f0d8..8d7969bf906d647a0c358b9c6080a17477d1153e 100644 (file)
@@ -107,6 +107,7 @@ Mono.Net.Security/MonoTlsProviderWrapper.cs
 Mono.Net.Security/MonoTlsStream.cs
 Mono.Net.Security/NoReflectionHelper.cs
 Mono.Net.Security/SystemCertificateValidator.cs
+System.Net/MacProxy.cs
 System.Net.Mail/SmtpClient.cs
 System.Net.Security/SslStream.cs
 System.Net.Sockets/TcpClient.cs
@@ -141,44 +142,6 @@ System.Net/WebConnection.cs
 System.Net/WebConnectionData.cs
 System.Net/WebConnectionGroup.cs
 System.Net/WebConnectionStream.cs
-Mono.Btls/MonoBtlsBio.cs
-Mono.Btls/MonoBtlsContext.cs
-Mono.Btls/MonoBtlsError.cs
-Mono.Btls/MonoBtlsException.cs
-Mono.Btls/MonoBtlsKey.cs
-Mono.Btls/MonoBtlsObject.cs
-Mono.Btls/MonoBtlsPkcs12.cs
-Mono.Btls/MonoBtlsProvider.cs
-Mono.Btls/MonoBtlsSsl.cs
-Mono.Btls/MonoBtlsSslCtx.cs
-Mono.Btls/MonoBtlsSslError.cs
-Mono.Btls/MonoBtlsStream.cs
-Mono.Btls/MonoBtlsUtils.cs
-Mono.Btls/MonoBtlsX509.cs
-Mono.Btls/MonoBtlsX509Chain.cs
-Mono.Btls/MonoBtlsX509Crl.cs
-Mono.Btls/MonoBtlsX509Error.cs
-Mono.Btls/MonoBtlsX509Exception.cs
-Mono.Btls/MonoBtlsX509FileType.cs
-Mono.Btls/MonoBtlsX509Format.cs
-Mono.Btls/MonoBtlsX509Lookup.cs
-Mono.Btls/MonoBtlsX509LookupMonoCollection.cs
-Mono.Btls/MonoBtlsX509LookupMono.cs
-Mono.Btls/MonoBtlsX509LookupType.cs
-Mono.Btls/MonoBtlsX509Name.cs
-Mono.Btls/MonoBtlsX509NameList.cs
-Mono.Btls/MonoBtlsX509NameEntryType.cs
-Mono.Btls/MonoBtlsX509Purpose.cs
-Mono.Btls/MonoBtlsX509Revoked.cs
-Mono.Btls/MonoBtlsX509Store.cs
-Mono.Btls/MonoBtlsX509StoreCtx.cs
-Mono.Btls/MonoBtlsX509StoreManager.cs
-Mono.Btls/MonoBtlsX509StoreType.cs
-Mono.Btls/MonoBtlsX509TrustKind.cs
-Mono.Btls/MonoBtlsX509VerifyFlags.cs
-Mono.Btls/MonoBtlsX509VerifyParam.cs
-Mono.Btls/X509CertificateImplBtls.cs
-Mono.Btls/X509ChainImplBtls.cs
 ../referencesource/System/net/System/Net/Sockets/TCPClient.cs
 ../referencesource/System/net/System/Net/Sockets/TCPListener.cs
 ../referencesource/System/net/System/Net/Sockets/UDPClient.cs
diff --git a/mcs/class/corlib/System.Diagnostics.Tracing/EventCounter.cs b/mcs/class/corlib/System.Diagnostics.Tracing/EventCounter.cs
new file mode 100644 (file)
index 0000000..4cb3625
--- /dev/null
@@ -0,0 +1,45 @@
+//
+// EventCounter.cs
+//
+// Authors:
+//     Marek Safar  <marek.safar@gmail.com>
+//
+// Copyright (C) 2016 Xamarin Inc (http://www.xamarin.com)
+//
+// Permission is hereby granted, free of charge, to any person obtaining
+// a copy of this software and associated documentation files (the
+// "Software"), to deal in the Software without restriction, including
+// without limitation the rights to use, copy, modify, merge, publish,
+// distribute, sublicense, and/or sell copies of the Software, and to
+// permit persons to whom the Software is furnished to do so, subject to
+// the following conditions:
+//
+// The above copyright notice and this permission notice shall be
+// included in all copies or substantial portions of the Software.
+//
+// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
+// EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
+// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
+// NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
+// LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
+// OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
+// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
+//
+
+#if NETSTANDARD
+
+namespace System.Diagnostics.Tracing
+{
+       public class EventCounter
+       {
+               public EventCounter (string name, EventSource eventSource)
+               {
+               }
+
+               public void WriteMetric (float value)
+               {
+               }
+       }
+}
+
+#endif
index a55f093678f618f00cb384f8fbd809f16264a1cd..8574472acb11f694c3b854866c76ed54070c7f2a 100644 (file)
@@ -1,10 +1,12 @@
-//
+//
 // ConditionalWeakTable.cs
 //
 // Author:
 //   Rodrigo Kumpera (rkumpera@novell.com)
+//   Tautvydas Žilys <zilys@unity3d.com>
 //
 // Copyright (C) 2010 Novell, Inc (http://www.novell.com)
+// Copyright (C) 2016 Unity Technologies (https://unity3d.com)
 //
 // Permission is hereby granted, free of charge, to any person obtaining
 // a copy of this software and associated documentation files (the
@@ -223,25 +225,94 @@ namespace System.Runtime.CompilerServices
 
                        return res;
                }
-               
+
+               //--------------------------------------------------------------------------------------------
+               // Find a key that equals (value equality) with the given key - don't use in perf critical path
+               // Note that it calls out to Object.Equals which may calls the override version of Equals
+               // and that may take locks and leads to deadlock
+               // Currently it is only used by WinRT event code and you should only use this function
+               // if you know for sure that either you won't run into dead locks or you need to live with the
+               // possiblity
+               //--------------------------------------------------------------------------------------------
+               [System.Security.SecuritySafeCritical]
+               [FriendAccessAllowed]
+               internal TKey FindEquivalentKeyUnsafe(TKey key, out TValue value)
+               {
+                       lock (_lock)
+                       {
+                               for (int i = 0; i < data.Length; ++i)
+                               {
+                                       var item = data[i];
+                                       if (Object.Equals(item.key, key))
+                                       {
+                                               value = (TValue)item.value;
+                                               return (TKey)item.key;
+                                       }
+                               }
+                       }
+
+                       value = default(TValue);
+                       return null;
+               }
+
+               //--------------------------------------------------------------------------------------------
+               // Clear all the key/value pairs
+               //--------------------------------------------------------------------------------------------
+               [System.Security.SecuritySafeCritical]
+               internal void Clear()
+               {
+                       lock (_lock)
+                       {
+                               for (int i = 0; i < data.Length; i++)
+                               {
+                                       data[i].key = GC.EPHEMERON_TOMBSTONE;
+                                       data[i].value = null;
+                               }
+
+                               size = 0;
+                       }
+               }
+
                // extracted from ../../../../external/referencesource/mscorlib/system/runtime/compilerservices/
                internal ICollection<TKey> Keys
                {
                        [System.Security.SecuritySafeCritical]
                        get
                        {
+                               var tombstone = GC.EPHEMERON_TOMBSTONE;
                                List<TKey> list = new List<TKey>(data.Length);
                                lock (_lock)
                                {
                                        for (int i = 0; i < data.Length; ++i)
                                        {
                                                TKey key = (TKey) data [i].key;
-                                               if (key != null)
+                                               if (key != null && key != tombstone)
                                                        list.Add (key);
                                        }
                                }
                                return list;
                        }
                }
+
+               internal ICollection<TValue> Values
+               {
+                       [System.Security.SecuritySafeCritical]
+                       get
+                       {
+                               var tombstone = GC.EPHEMERON_TOMBSTONE;
+                               List<TValue> list = new List<TValue>(data.Length);
+                               lock (_lock)
+                               {
+                                       for (int i = 0; i < data.Length; ++i)
+                                       {
+                                               var item = data[i];
+                                               if (item.key != null && item.key != tombstone)
+                                                       list.Add((TValue)item.value);
+                                       }
+                               }
+
+                               return list;
+                       }
+               }
        }
 }
diff --git a/mcs/class/corlib/System.Runtime.InteropServices.WindowsRuntime/DefaultInterfaceAttribute.cs b/mcs/class/corlib/System.Runtime.InteropServices.WindowsRuntime/DefaultInterfaceAttribute.cs
deleted file mode 100644 (file)
index 44c7662..0000000
+++ /dev/null
@@ -1,44 +0,0 @@
-//
-// DefaultInterfaceAttribute.cs
-//
-// Author:
-//       Martin Baulig <martin.baulig@xamarin.com>
-//
-// Copyright (c) 2013 Xamarin Inc. (http://www.xamarin.com)
-//
-// Permission is hereby granted, free of charge, to any person obtaining a copy
-// of this software and associated documentation files (the "Software"), to deal
-// in the Software without restriction, including without limitation the rights
-// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
-// copies of the Software, and to permit persons to whom the Software is
-// furnished to do so, subject to the following conditions:
-//
-// The above copyright notice and this permission notice shall be included in
-// all copies or substantial portions of the Software.
-//
-// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
-// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
-// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
-// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
-// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
-// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
-// THE SOFTWARE.
-using System;
-using System.Runtime.CompilerServices;
-
-namespace System.Runtime.InteropServices.WindowsRuntime
-{
-       [AttributeUsageAttribute(AttributeTargets.Class|AttributeTargets.Interface, AllowMultiple = false, Inherited = false)]
-       public sealed class DefaultInterfaceAttribute : Attribute
-       {
-               public Type DefaultInterface {
-                       get;
-                       private set;
-               }
-
-               public DefaultInterfaceAttribute (Type defaultInterface)
-               {
-                       DefaultInterface = defaultInterface;
-               }
-       }
-}
diff --git a/mcs/class/corlib/System.Runtime.InteropServices.WindowsRuntime/EventRegistrationToken.cs b/mcs/class/corlib/System.Runtime.InteropServices.WindowsRuntime/EventRegistrationToken.cs
deleted file mode 100644 (file)
index e3479eb..0000000
+++ /dev/null
@@ -1,57 +0,0 @@
-//
-// EventRegistrationToken.cs
-//
-// Author:
-//       Martin Baulig <martin.baulig@xamarin.com>
-//
-// Copyright (c) 2013 Xamarin Inc. (http://www.xamarin.com)
-//
-// Permission is hereby granted, free of charge, to any person obtaining a copy
-// of this software and associated documentation files (the "Software"), to deal
-// in the Software without restriction, including without limitation the rights
-// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
-// copies of the Software, and to permit persons to whom the Software is
-// furnished to do so, subject to the following conditions:
-//
-// The above copyright notice and this permission notice shall be included in
-// all copies or substantial portions of the Software.
-//
-// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
-// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
-// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
-// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
-// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
-// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
-// THE SOFTWARE.
-using System;
-using System.Runtime.CompilerServices;
-
-namespace System.Runtime.InteropServices.WindowsRuntime
-{
-       public struct EventRegistrationToken
-       {
-#pragma warning disable 0649
-               long value;
-#pragma warning restore 0649
-
-               public static bool operator == (EventRegistrationToken left, EventRegistrationToken right)
-               {
-                       return left.value == right.value;
-               }
-
-               public static bool operator != (EventRegistrationToken left, EventRegistrationToken right)
-               {
-                       return left.value != right.value;
-               }
-
-               public override bool Equals (object obj)
-               {
-                       return ((EventRegistrationToken)obj).value == value;
-               }
-
-               public override int GetHashCode ()
-               {
-                       return unchecked ((int)value);
-               }
-       }
-}
diff --git a/mcs/class/corlib/System.Runtime.InteropServices.WindowsRuntime/EventRegistrationTokenTable.cs b/mcs/class/corlib/System.Runtime.InteropServices.WindowsRuntime/EventRegistrationTokenTable.cs
deleted file mode 100644 (file)
index 0f09681..0000000
+++ /dev/null
@@ -1,66 +0,0 @@
-//
-// EventRegistrationTokenTable.cs
-//
-// Author:
-//       Martin Baulig <martin.baulig@xamarin.com>
-//
-// Copyright (c) 2013 Xamarin Inc. (http://www.xamarin.com)
-//
-// Permission is hereby granted, free of charge, to any person obtaining a copy
-// of this software and associated documentation files (the "Software"), to deal
-// in the Software without restriction, including without limitation the rights
-// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
-// copies of the Software, and to permit persons to whom the Software is
-// furnished to do so, subject to the following conditions:
-//
-// The above copyright notice and this permission notice shall be included in
-// all copies or substantial portions of the Software.
-//
-// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
-// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
-// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
-// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
-// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
-// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
-// THE SOFTWARE.
-using System;
-using System.Runtime.CompilerServices;
-
-namespace System.Runtime.InteropServices.WindowsRuntime
-{
-       [MonoTODO]
-       public sealed class EventRegistrationTokenTable<T>
-               where T : class
-       {
-               public EventRegistrationTokenTable ()
-               {
-                       throw new NotImplementedException ();
-               }
-
-               public T InvocationList {
-                       get { throw new NotImplementedException (); }
-                       set { throw new NotImplementedException (); }
-               }
-
-               public EventRegistrationToken AddEventHandler (T handler)
-               {
-                       throw new NotImplementedException ();
-               }
-
-               public static EventRegistrationTokenTable<T> GetOrCreateEventRegistrationTokenTable(ref EventRegistrationTokenTable<T> refEventTable)
-               {
-                       throw new NotImplementedException ();
-               }
-
-               public void RemoveEventHandler (T handler)
-               {
-                       throw new NotImplementedException ();
-               }
-
-               public void RemoveEventHandler (EventRegistrationToken token)
-               {
-                       throw new NotImplementedException ();
-               }
-       }
-}
-
diff --git a/mcs/class/corlib/System.Runtime.InteropServices.WindowsRuntime/IActivationFactory.cs b/mcs/class/corlib/System.Runtime.InteropServices.WindowsRuntime/IActivationFactory.cs
deleted file mode 100644 (file)
index 7c516aa..0000000
+++ /dev/null
@@ -1,36 +0,0 @@
-//
-// IActivationFactory.cs
-//
-// Author:
-//       Martin Baulig <martin.baulig@xamarin.com>
-//
-// Copyright (c) 2013 Xamarin Inc. (http://www.xamarin.com)
-//
-// Permission is hereby granted, free of charge, to any person obtaining a copy
-// of this software and associated documentation files (the "Software"), to deal
-// in the Software without restriction, including without limitation the rights
-// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
-// copies of the Software, and to permit persons to whom the Software is
-// furnished to do so, subject to the following conditions:
-//
-// The above copyright notice and this permission notice shall be included in
-// all copies or substantial portions of the Software.
-//
-// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
-// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
-// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
-// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
-// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
-// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
-// THE SOFTWARE.
-using System;
-using System.Runtime.CompilerServices;
-
-namespace System.Runtime.InteropServices.WindowsRuntime
-{
-       [Guid("00000035-0000-0000-C000-000000000046")]
-       public interface IActivationFactory
-       {
-               object ActivateInstance ();
-       }
-}
diff --git a/mcs/class/corlib/System.Runtime.InteropServices.WindowsRuntime/InterfaceImplementedInVersionAttribute.cs b/mcs/class/corlib/System.Runtime.InteropServices.WindowsRuntime/InterfaceImplementedInVersionAttribute.cs
deleted file mode 100644 (file)
index c489221..0000000
+++ /dev/null
@@ -1,69 +0,0 @@
-//
-// InterfaceImplementedInVersionAttribute.cs
-//
-// Author:
-//       Martin Baulig <martin.baulig@xamarin.com>
-//
-// Copyright (c) 2013 Xamarin Inc. (http://www.xamarin.com)
-//
-// Permission is hereby granted, free of charge, to any person obtaining a copy
-// of this software and associated documentation files (the "Software"), to deal
-// in the Software without restriction, including without limitation the rights
-// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
-// copies of the Software, and to permit persons to whom the Software is
-// furnished to do so, subject to the following conditions:
-//
-// The above copyright notice and this permission notice shall be included in
-// all copies or substantial portions of the Software.
-//
-// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
-// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
-// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
-// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
-// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
-// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
-// THE SOFTWARE.
-
-using System.Runtime.CompilerServices;
-
-namespace System.Runtime.InteropServices.WindowsRuntime
-{
-       [AttributeUsageAttribute(AttributeTargets.Class|AttributeTargets.Interface, AllowMultiple = true, Inherited = false)]
-       public sealed class InterfaceImplementedInVersionAttribute : Attribute
-       {
-               public InterfaceImplementedInVersionAttribute (Type interfaceType, byte majorVersion, byte minorVersion,
-                       byte buildVersion, byte revisionVersion)
-               {
-                       InterfaceType = interfaceType;
-                       MajorVersion = majorVersion;
-                       MinorVersion = minorVersion;
-                       BuildVersion = buildVersion;
-                       RevisionVersion = revisionVersion;
-               }
-
-               public byte BuildVersion {
-                       get;
-                       private set;
-               }
-
-               public Type InterfaceType {
-                       get;
-                       private set;
-               }
-
-               public byte MajorVersion {
-                       get;
-                       private set;
-               }
-
-               public byte MinorVersion {
-                       get;
-                       private set;
-               }
-       
-               public byte RevisionVersion {
-                       get;
-                       private set;
-               }
-       }
-}
diff --git a/mcs/class/corlib/System.Runtime.InteropServices.WindowsRuntime/ReadOnlyArrayAttribute.cs b/mcs/class/corlib/System.Runtime.InteropServices.WindowsRuntime/ReadOnlyArrayAttribute.cs
deleted file mode 100644 (file)
index 9aa41a0..0000000
+++ /dev/null
@@ -1,35 +0,0 @@
-//
-// ReadOnlyArrayAttribute.cs
-//
-// Author:
-//       Martin Baulig <martin.baulig@xamarin.com>
-//
-// Copyright (c) 2013 Xamarin Inc. (http://www.xamarin.com)
-//
-// Permission is hereby granted, free of charge, to any person obtaining a copy
-// of this software and associated documentation files (the "Software"), to deal
-// in the Software without restriction, including without limitation the rights
-// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
-// copies of the Software, and to permit persons to whom the Software is
-// furnished to do so, subject to the following conditions:
-//
-// The above copyright notice and this permission notice shall be included in
-// all copies or substantial portions of the Software.
-//
-// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
-// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
-// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
-// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
-// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
-// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
-// THE SOFTWARE.
-using System;
-using System.Runtime.CompilerServices;
-
-namespace System.Runtime.InteropServices.WindowsRuntime
-{
-       [AttributeUsageAttribute(AttributeTargets.Parameter, Inherited = false, AllowMultiple = false)]
-       public sealed class ReadOnlyArrayAttribute : Attribute
-       {
-       }
-}
diff --git a/mcs/class/corlib/System.Runtime.InteropServices.WindowsRuntime/ReturnValueNameAttribute.cs b/mcs/class/corlib/System.Runtime.InteropServices.WindowsRuntime/ReturnValueNameAttribute.cs
deleted file mode 100644 (file)
index 8fd0173..0000000
+++ /dev/null
@@ -1,44 +0,0 @@
-//
-// ReturnValueNameAttribute.cs
-//
-// Author:
-//       Martin Baulig <martin.baulig@xamarin.com>
-//
-// Copyright (c) 2013 Xamarin Inc. (http://www.xamarin.com)
-//
-// Permission is hereby granted, free of charge, to any person obtaining a copy
-// of this software and associated documentation files (the "Software"), to deal
-// in the Software without restriction, including without limitation the rights
-// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
-// copies of the Software, and to permit persons to whom the Software is
-// furnished to do so, subject to the following conditions:
-//
-// The above copyright notice and this permission notice shall be included in
-// all copies or substantial portions of the Software.
-//
-// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
-// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
-// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
-// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
-// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
-// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
-// THE SOFTWARE.
-using System;
-using System.Runtime.CompilerServices;
-
-namespace System.Runtime.InteropServices.WindowsRuntime
-{
-       [AttributeUsageAttribute(AttributeTargets.Delegate|AttributeTargets.ReturnValue, AllowMultiple = false, Inherited = false)]
-       public sealed class ReturnValueNameAttribute : Attribute
-       {
-               public ReturnValueNameAttribute (string name)
-               {
-                       Name = name;
-               }
-
-               public string Name {
-                       get;
-                       private set;
-               }
-       }
-}
diff --git a/mcs/class/corlib/System.Runtime.InteropServices.WindowsRuntime/UnsafeNativeMethods.cs b/mcs/class/corlib/System.Runtime.InteropServices.WindowsRuntime/UnsafeNativeMethods.cs
new file mode 100644 (file)
index 0000000..a7101cf
--- /dev/null
@@ -0,0 +1,51 @@
+//
+// UnsafeNativeMethods.cs
+//
+// Author:
+//   Tautvydas Žilys <zilys@unity3d.com>
+//
+// Copyright (c) 2016 Unity Technologies (https://www.unity3d.com)
+//
+// Permission is hereby granted, free of charge, to any person obtaining a copy
+// of this software and associated documentation files (the "Software"), to deal
+// in the Software without restriction, including without limitation the rights
+// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
+// copies of the Software, and to permit persons to whom the Software is
+// furnished to do so, subject to the following conditions:
+//
+// The above copyright notice and this permission notice shall be included in
+// all copies or substantial portions of the Software.
+//
+// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
+// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
+// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
+// THE SOFTWARE.
+
+using System.Runtime.CompilerServices;
+
+namespace System.Runtime.InteropServices.WindowsRuntime
+{
+       internal unsafe static class UnsafeNativeMethods
+       {
+               [MethodImplAttribute(MethodImplOptions.InternalCall)]
+               public static extern int WindowsCreateString(string sourceString, int length, IntPtr* hstring);
+               
+               [MethodImplAttribute(MethodImplOptions.InternalCall)]
+               public static extern int WindowsDeleteString(IntPtr hstring);
+               
+               [MethodImplAttribute(MethodImplOptions.InternalCall)]
+               public static extern char* WindowsGetStringRawBuffer(IntPtr hstring, uint* length);
+               
+               [MethodImplAttribute(MethodImplOptions.InternalCall)]
+               public static extern bool RoOriginateLanguageException(int error, string message, IntPtr languageException);
+               
+               [MethodImplAttribute(MethodImplOptions.InternalCall)]
+               public static extern void RoReportUnhandledError(IRestrictedErrorInfo error);
+               
+               [MethodImplAttribute(MethodImplOptions.InternalCall)]
+               public static extern IRestrictedErrorInfo GetRestrictedErrorInfo();
+       }
+}
\ No newline at end of file
diff --git a/mcs/class/corlib/System.Runtime.InteropServices.WindowsRuntime/WindowsRuntimeMarshal.cs b/mcs/class/corlib/System.Runtime.InteropServices.WindowsRuntime/WindowsRuntimeMarshal.cs
deleted file mode 100644 (file)
index eb324b5..0000000
+++ /dev/null
@@ -1,75 +0,0 @@
-//
-// WindowsRuntimeMarshal.cs
-//
-// Author:
-//       Martin Baulig <martin.baulig@xamarin.com>
-//
-// Copyright (c) 2013 Xamarin Inc. (http://www.xamarin.com)
-//
-// Permission is hereby granted, free of charge, to any person obtaining a copy
-// of this software and associated documentation files (the "Software"), to deal
-// in the Software without restriction, including without limitation the rights
-// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
-// copies of the Software, and to permit persons to whom the Software is
-// furnished to do so, subject to the following conditions:
-//
-// The above copyright notice and this permission notice shall be included in
-// all copies or substantial portions of the Software.
-//
-// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
-// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
-// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
-// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
-// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
-// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
-// THE SOFTWARE.
-using System;
-using System.Runtime.CompilerServices;
-
-namespace System.Runtime.InteropServices.WindowsRuntime
-{
-       [MonoTODO]
-       public static class WindowsRuntimeMarshal
-       {
-               public static void AddEventHandler<T> ( Func<T, EventRegistrationToken> addMethod, Action<EventRegistrationToken> removeMethod, T handler)
-               {
-                       throw new NotImplementedException ();
-               }
-
-               public static void FreeHString (IntPtr ptr)
-               {
-                       throw new NotImplementedException ();
-               }
-
-               public static IActivationFactory GetActivationFactory (Type type)
-               {
-                       throw new NotImplementedException ();
-               }
-
-               public static string PtrToStringHString (IntPtr ptr)
-               {
-                       throw new NotImplementedException ();
-               }
-
-               public static void RemoveAllEventHandlers(Action<EventRegistrationToken> removeMethod)
-               {
-                       throw new NotImplementedException ();
-               }
-
-               public static void RemoveEventHandler<T> (Action<EventRegistrationToken> removeMethod, T handler)
-               {
-                       throw new NotImplementedException ();
-               }
-
-               public static IntPtr StringToHString (string s)
-               {
-                       throw new NotImplementedException ();
-               }
-
-               internal static bool ReportUnhandledError (Exception e)
-               {
-                       return false;
-               }
-       }
-}
-
diff --git a/mcs/class/corlib/System.Runtime.InteropServices.WindowsRuntime/WriteOnlyArrayAttribute.cs b/mcs/class/corlib/System.Runtime.InteropServices.WindowsRuntime/WriteOnlyArrayAttribute.cs
deleted file mode 100644 (file)
index bfb3c06..0000000
+++ /dev/null
@@ -1,35 +0,0 @@
-//
-// WriteOnlyArrayAttribute.cs
-//
-// Author:
-//       Martin Baulig <martin.baulig@xamarin.com>
-//
-// Copyright (c) 2013 Xamarin Inc. (http://www.xamarin.com)
-//
-// Permission is hereby granted, free of charge, to any person obtaining a copy
-// of this software and associated documentation files (the "Software"), to deal
-// in the Software without restriction, including without limitation the rights
-// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
-// copies of the Software, and to permit persons to whom the Software is
-// furnished to do so, subject to the following conditions:
-//
-// The above copyright notice and this permission notice shall be included in
-// all copies or substantial portions of the Software.
-//
-// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
-// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
-// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
-// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
-// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
-// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
-// THE SOFTWARE.
-using System;
-using System.Runtime.CompilerServices;
-
-namespace System.Runtime.InteropServices.WindowsRuntime
-{
-       [AttributeUsageAttribute(AttributeTargets.Parameter, Inherited = false, AllowMultiple = false)]
-       public sealed class WriteOnlyArrayAttribute : Attribute
-       {
-       }
-}
index fddf9ec30eea342e229d4b2031c58d860551fa70..30ff8b74bce5a34540a6d9432ced77e7c6beb276 100644 (file)
@@ -1751,5 +1751,31 @@ namespace System.Runtime.InteropServices
                internal static void SetLastWin32Error (int error)
                {
                }
+
+               // Copied from referencesource/mscorlib/system/runtime/interopservices/marshal.cs
+               //====================================================================
+               // return the raw IUnknown* for a COM Object not related to current 
+               // context
+               // Does not call AddRef
+               //====================================================================
+               [MethodImplAttribute(MethodImplOptions.InternalCall)]
+               internal static extern IntPtr /* IUnknown* */ GetRawIUnknownForComObjectNoAddRef(Object o);
+               
+               // Copied from referencesource/mscorlib/system/runtime/interopservices/marshal.cs
+               //====================================================================
+               // Converts the CLR exception to an HRESULT. This function also sets
+               // up an IErrorInfo for the exception.
+               // This function is only used in WinRT and converts ObjectDisposedException
+               // to RO_E_CLOSED
+               //====================================================================
+               [MethodImplAttribute(MethodImplOptions.InternalCall)]
+               internal static extern int GetHRForException_WinRT(Exception e);
+
+               // Copied from referencesource/mscorlib/system/runtime/interopservices/marshal.cs
+               //========================================================================
+               // Create activation factory and wraps it with a unique RCW
+               //========================================================================
+               [MethodImplAttribute(MethodImplOptions.InternalCall)]
+               internal static extern object GetNativeActivationFactory(Type type);
        }
 }
diff --git a/mcs/class/corlib/System.Security.Cryptography/IncrementalHash.cs b/mcs/class/corlib/System.Security.Cryptography/IncrementalHash.cs
new file mode 100644 (file)
index 0000000..d52ed93
--- /dev/null
@@ -0,0 +1,46 @@
+//
+// IncrementalHash.cs
+//
+// Authors:
+//     Marek Safar  <marek.safar@gmail.com>
+//
+// Copyright (C) 2016 Xamarin Inc (http://www.xamarin.com)
+//
+// Permission is hereby granted, free of charge, to any person obtaining
+// a copy of this software and associated documentation files (the
+// "Software"), to deal in the Software without restriction, including
+// without limitation the rights to use, copy, modify, merge, publish,
+// distribute, sublicense, and/or sell copies of the Software, and to
+// permit persons to whom the Software is furnished to do so, subject to
+// the following conditions:
+//
+// The above copyright notice and this permission notice shall be
+// included in all copies or substantial portions of the Software.
+//
+// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
+// EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
+// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
+// NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
+// LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
+// OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
+// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
+//
+
+#if NETSTANDARD
+
+namespace System.Security.Cryptography
+{
+    public sealed class IncrementalHash : IDisposable
+    {
+        public IncrementalHash () { }
+        public HashAlgorithmName AlgorithmName { get { throw new NotImplementedException (); } }
+        public void AppendData (byte[] data) { }
+        public void AppendData (byte[] data, int offset, int count) { }
+        public static IncrementalHash CreateHash (HashAlgorithmName hashAlgorithm) { throw new NotImplementedException (); }
+        public static IncrementalHash CreateHMAC (HashAlgorithmName hashAlgorithm, byte[] key) { throw new NotImplementedException (); }
+        public void Dispose () { }
+        public byte[] GetHashAndReset () { throw new NotImplementedException (); }
+    }
+}
+
+#endif
\ No newline at end of file
index 19d17929c54a552b07f4b16c4f587d6aba2ef421..13e99d04b9a51c5f33a861c86cdc5a08c727e8be 100644 (file)
@@ -1040,6 +1040,15 @@ namespace System {
                        // Do not include a trailing newline for backwards compatibility
                        return st.ToString( System.Diagnostics.StackTrace.TraceFormat.Normal );
                }
+
+               // Copied from referencesource Environment
+               internal static bool IsWinRTSupported
+               {
+                       get
+                       {
+                               return true;
+                       }
+               }
        }
 }
 
index 6dd48b8cade7998030f2c4c44280be4e8526b328..9ab59b3150348e5d7cd398c3ed89a2c972f6185f 100644 (file)
     <Compile Include="..\referencesource\mscorlib\system\runtime\interopservices\ucomienumconnections.cs" />\r
     <Compile Include="..\referencesource\mscorlib\system\runtime\interopservices\unknownwrapper.cs" />\r
     <Compile Include="..\referencesource\mscorlib\system\runtime\interopservices\variantWrapper.cs" />\r
+    <Compile Include="..\referencesource\mscorlib\system\runtime\interopservices\windowsruntime\attributes.cs" />\r
+    <Compile Include="..\referencesource\mscorlib\system\runtime\interopservices\windowsruntime\eventregistrationtoken.cs" />\r
+    <Compile Include="..\referencesource\mscorlib\system\runtime\interopservices\windowsruntime\eventregistrationtokentable.cs" />\r
+    <Compile Include="..\referencesource\mscorlib\system\runtime\interopservices\windowsruntime\iactivationfactory.cs" />\r
+    <Compile Include="..\referencesource\mscorlib\system\runtime\interopservices\windowsruntime\irestrictederrorinfo.cs" />\r
+    <Compile Include="..\referencesource\mscorlib\system\runtime\interopservices\windowsruntime\windowsruntimemarshal.cs" />\r
     <Compile Include="..\referencesource\mscorlib\system\runtime\NgenServicingAttributes.cs" />\r
     <Compile Include="..\referencesource\mscorlib\system\runtime\remoting\callcontext.cs" />\r
     <Compile Include="..\referencesource\mscorlib\system\runtime\serialization\deserializationeventhandler.cs" />\r
     <Compile Include="System.Diagnostics.Tracing\EventAttribute.cs" />\r
     <Compile Include="System.Diagnostics.Tracing\EventCommand.cs" />\r
     <Compile Include="System.Diagnostics.Tracing\EventCommandEventArgs.cs" />\r
+    <Compile Include="System.Diagnostics.Tracing\EventCounter.cs" />\r
     <Compile Include="System.Diagnostics.Tracing\EventDataAttribute.cs" />\r
     <Compile Include="System.Diagnostics.Tracing\EventFieldAttribute.cs" />\r
     <Compile Include="System.Diagnostics.Tracing\EventFieldFormat.cs" />\r
     <Compile Include="System.Runtime.CompilerServices\RuntimeHelpers.cs" />\r
     <Compile Include="System.Runtime.Hosting\ActivationArguments.cs" />\r
     <Compile Include="System.Runtime.Hosting\ApplicationActivator.cs" />\r
-    <Compile Include="System.Runtime.InteropServices.WindowsRuntime\DefaultInterfaceAttribute.cs" />\r
     <Compile Include="System.Runtime.InteropServices.WindowsRuntime\DesignerNamespaceResolveEventArgs.cs" />\r
-    <Compile Include="System.Runtime.InteropServices.WindowsRuntime\EventRegistrationToken.cs" />\r
-    <Compile Include="System.Runtime.InteropServices.WindowsRuntime\EventRegistrationTokenTable.cs" />\r
-    <Compile Include="System.Runtime.InteropServices.WindowsRuntime\IActivationFactory.cs" />\r
-    <Compile Include="System.Runtime.InteropServices.WindowsRuntime\InterfaceImplementedInVersionAttribute.cs" />\r
     <Compile Include="System.Runtime.InteropServices.WindowsRuntime\NamespaceResolveEventArgs.cs" />\r
-    <Compile Include="System.Runtime.InteropServices.WindowsRuntime\ReadOnlyArrayAttribute.cs" />\r
-    <Compile Include="System.Runtime.InteropServices.WindowsRuntime\ReturnValueNameAttribute.cs" />\r
-    <Compile Include="System.Runtime.InteropServices.WindowsRuntime\WindowsRuntimeMarshal.cs" />\r
+    <Compile Include="System.Runtime.InteropServices.WindowsRuntime\UnsafeNativeMethods.cs" />\r
     <Compile Include="System.Runtime.InteropServices.WindowsRuntime\WindowsRuntimeMetadata.cs" />\r
-    <Compile Include="System.Runtime.InteropServices.WindowsRuntime\WriteOnlyArrayAttribute.cs" />\r
     <Compile Include="System.Runtime.InteropServices\_Activator.cs" />\r
     <Compile Include="System.Runtime.InteropServices\_Assembly.cs" />\r
     <Compile Include="System.Runtime.InteropServices\_AssemblyBuilder.cs" />\r
     <Compile Include="System.Security.Cryptography\DESCryptoServiceProvider.cs" />\r
     <Compile Include="System.Security.Cryptography\DSACryptoServiceProvider.cs" />\r
     <Compile Include="System.Security.Cryptography\ICspAsymmetricAlgorithm.cs" />\r
+    <Compile Include="System.Security.Cryptography\IncrementalHash.cs" />\r
     <Compile Include="System.Security.Cryptography\KeyNumber.cs" />\r
     <Compile Include="System.Security.Cryptography\MD5CryptoServiceProvider.cs" />\r
     <Compile Include="System.Security.Cryptography\RC2CryptoServiceProvider.cs" />\r
index e2dfdbb5b8f46859d56b68790614970ea4a9149e..f8107e8c3424f124adfc0df93471b26e460d6ef1 100644 (file)
@@ -164,6 +164,7 @@ System.Diagnostics/StackFrame.cs
 System.Diagnostics/StackTrace.cs
 System.Diagnostics.Tracing/EventAttribute.cs
 System.Diagnostics.Tracing/EventCommand.cs
+System.Diagnostics.Tracing/EventCounter.cs
 System.Diagnostics.Tracing/EventSource.cs
 System.Diagnostics.Tracing/EventSourceAttribute.cs
 System.Diagnostics.Tracing/EventSourceSettings.cs
@@ -423,18 +424,10 @@ System.Runtime.InteropServices/CustomQueryInterfaceMode.cs
 System.Runtime.InteropServices/ComAwareEventInfo.cs
 System.Runtime.InteropServices/ComEventsHelper.cs
 
-System.Runtime.InteropServices.WindowsRuntime/DefaultInterfaceAttribute.cs
 System.Runtime.InteropServices.WindowsRuntime/DesignerNamespaceResolveEventArgs.cs
-System.Runtime.InteropServices.WindowsRuntime/EventRegistrationToken.cs
-System.Runtime.InteropServices.WindowsRuntime/EventRegistrationTokenTable.cs
-System.Runtime.InteropServices.WindowsRuntime/IActivationFactory.cs
-System.Runtime.InteropServices.WindowsRuntime/InterfaceImplementedInVersionAttribute.cs
 System.Runtime.InteropServices.WindowsRuntime/NamespaceResolveEventArgs.cs
-System.Runtime.InteropServices.WindowsRuntime/ReadOnlyArrayAttribute.cs
-System.Runtime.InteropServices.WindowsRuntime/ReturnValueNameAttribute.cs
-System.Runtime.InteropServices.WindowsRuntime/WindowsRuntimeMarshal.cs
+System.Runtime.InteropServices.WindowsRuntime/UnsafeNativeMethods.cs
 System.Runtime.InteropServices.WindowsRuntime/WindowsRuntimeMetadata.cs
-System.Runtime.InteropServices.WindowsRuntime/WriteOnlyArrayAttribute.cs
 System.Runtime.Remoting/ActivatedClientTypeEntry.cs
 System.Runtime.Remoting/ActivatedServiceTypeEntry.cs
 System.Runtime.Remoting/CustomErrorsModes.cs
@@ -712,6 +705,7 @@ System.Security.Cryptography/CspKeyContainerInfo.cs
 System.Security.Cryptography/DESCryptoServiceProvider.cs
 System.Security.Cryptography/DSACryptoServiceProvider.cs
 System.Security.Cryptography/ICspAsymmetricAlgorithm.cs
+System.Security.Cryptography/IncrementalHash.cs
 System.Security.Cryptography/KeyNumber.cs
 System.Security.Cryptography/MD5CryptoServiceProvider.cs
 System.Security.Cryptography/RC2CryptoServiceProvider.cs
@@ -1346,6 +1340,13 @@ ReferenceSources/Type.cs
 
 ../referencesource/mscorlib/system/runtime/interopservices/expando/iexpando.cs
 
+../referencesource/mscorlib/system/runtime/interopservices/windowsruntime/attributes.cs
+../referencesource/mscorlib/system/runtime/interopservices/windowsruntime/eventregistrationtoken.cs
+../referencesource/mscorlib/system/runtime/interopservices/windowsruntime/eventregistrationtokentable.cs
+../referencesource/mscorlib/system/runtime/interopservices/windowsruntime/iactivationfactory.cs
+../referencesource/mscorlib/system/runtime/interopservices/windowsruntime/irestrictederrorinfo.cs
+../referencesource/mscorlib/system/runtime/interopservices/windowsruntime/windowsruntimemarshal.cs
+
 ../referencesource/mscorlib//system/runtime/reliability/criticalfinalizerobject.cs
 ../referencesource/mscorlib//system/runtime/reliability/prepreparemethodattribute.cs
 ../referencesource/mscorlib//system/runtime/reliability/reliabilitycontractattribute.cs
index cf77c9972b2967219bba6e0992252ca86961ca7c..17c7e0f4077176e2fa91f6be683afadc8abb0796 100644 (file)
@@ -2348,11 +2348,11 @@ namespace System.ComponentModel
             {
                 TypeDescriptionNode head = (TypeDescriptionNode)_providerTable[key];
                 TypeDescriptionNode target = head;
-                TypeDescriptionNode prev = null;
+//                TypeDescriptionNode prev = null;
 
                 while(target != null && target.Provider != provider)
                 {
-                    prev = target;
+//                    prev = target;
                     target = target.Next;
                 }
 
index c400a3e411cdb36b18b7ec5dae2ca8191195b43c..1a4cd98d9610c35ddffd981e873d86431f1cc08d 100644 (file)
@@ -18,8 +18,10 @@ namespace System.Diagnostics {
         [ThreadStatic]
         static int indentLevel;
         static volatile int indentSize;
+#if CONFIGURATION_DEP
         static volatile bool settingsInitialized;
         static volatile bool defaultInitialized;
+#endif
 
 
         // this is internal so TraceSource can use it.  We want to lock on the same object because both TraceInternal and 
@@ -303,7 +305,9 @@ namespace System.Diagnostics {
         // in the System.Diagnostics.Trace class
         static internal void Refresh() {
             lock (critSec) {
+#if CONFIGURATION_DEP
                 settingsInitialized = false;
+#endif
                 listeners = null;
             }
             InitializeSettings();
index e3273c4c9c95a17746b5cae33d505851391c123c..dce8967231569d9d14eec974bc8db728257042b2 100644 (file)
@@ -183,8 +183,8 @@ namespace System.Net {
                 // call !
                 //
                 SocketException e = null;
-                long   scope = 0;
 #if !MONO
+                long   scope = 0;
                 if(Socket.OSSupportsIPv6)
                 {
                     byte[] bytes = new byte[IPv6AddressBytes];
index 05732c28d3646eba263c003145863812cd75f45d..bcd27d93699729e0b16b473c2ae353aa9e4ed5af 100644 (file)
@@ -953,7 +953,7 @@ namespace System.Net {
         // There are threading tricks a malicious app can use to create an ArraySegment with mismatched 
         // array/offset/count.  Copy locally and make sure they're valid before using them.
         internal static void ValidateSegment(ArraySegment<byte> segment) {
-            if (segment == null || segment.Array == null) {
+            if (/*segment == null ||*/ segment.Array == null) {
                 throw new ArgumentNullException("segment");
             }
             // Length zero is explicitly allowed
index 16169a1b7a530a37fbfe7665dd326b55a15ae5de..ee56c48eabc29f3a64539b00758f7abba3abc914 100644 (file)
@@ -122,7 +122,9 @@ namespace System.Net.Sockets {
         internal static volatile bool s_SupportsIPv6;
         internal static volatile bool s_OSSupportsIPv6;
         internal static volatile bool s_Initialized;
+#if !MONO
         private static volatile WaitOrTimerCallback s_RegisteredWaitCallback;
+#endif
         private static volatile bool s_LoggingEnabled;
 #if !FEATURE_PAL // perfcounter
         internal static volatile bool s_PerfCountersEnabled;
index fec514b0dbc2bbdd1316a3f5521eb7ce3b01649a..a97f9ae48b1d21ff3d3c2b138bcb76b004c2d4bd 100644 (file)
@@ -379,7 +379,9 @@ namespace System.Net {
             DateTime tempUsed;
 
             CookieCollection lruCc = null;
+#if !MONO
             string   lruDomain =  null;
+#endif
             string   tempDomain = null;
 
             PathList pathList;
@@ -415,7 +417,9 @@ namespace System.Net {
                             // we also find the least used cookie collection in ENTIRE container
                             // we count the collection as LRU only if it holds 1+ elements
                             if (cc.Count > 0 && (tempUsed = cc.TimeStamp(CookieCollection.Stamp.Check)) < oldUsed) {
+#if !MONO
                                 lruDomain = tempDomain;
+#endif
                                 lruCc = cc;
                                 oldUsed = tempUsed;
                             }
index 8e2c50447f2275d3045433a231570f072dd588c1..db9d4cf6b280b082969542c428c3dbdffdc58587 100644 (file)
@@ -216,7 +216,9 @@ namespace System.Net {
         public override IAsyncResult BeginGetRequestStream(AsyncCallback callback, object state)
         {
             GlobalLog.Enter("FileWebRequest::BeginGetRequestStream");
+#if !MONO
             bool success = true;
+#endif
             try {
                 if (Aborted)
                     throw ExceptionHelper.RequestAbortedException;
@@ -244,7 +246,9 @@ namespace System.Net {
                 m_ReadAResult = new LazyAsyncResult(this, state, callback);
                 ThreadPool.QueueUserWorkItem(s_GetRequestStreamCallback, m_ReadAResult);
             } catch (Exception exception) {
+#if !MONO
                 success = false; 
+#endif
                 if(Logging.On)Logging.Exception(Logging.Web, this, "BeginGetRequestStream", exception);
                 throw;
             } finally {
@@ -263,7 +267,9 @@ namespace System.Net {
         public override IAsyncResult BeginGetResponse(AsyncCallback callback, object state)
         {
             GlobalLog.Enter("FileWebRequest::BeginGetResponse");
+#if !MONO
             bool success = true;
+#endif
 
             try {
                 if (Aborted)
@@ -280,7 +286,9 @@ namespace System.Net {
                 m_WriteAResult = new LazyAsyncResult(this,state,callback);
                 ThreadPool.QueueUserWorkItem(s_GetResponseCallback,m_WriteAResult);
             } catch (Exception exception) {
+#if !MONO
                 success = false;
+#endif
                 if(Logging.On)Logging.Exception(Logging.Web, this, "BeginGetResponse", exception);
                 throw;
             } finally {
@@ -304,7 +312,9 @@ namespace System.Net {
             GlobalLog.Enter("FileWebRequest::EndGetRequestStream");
 
             Stream stream;
+#if !MONO
             bool success = false;
+#endif
             try {
                 LazyAsyncResult  ar = asyncResult as LazyAsyncResult;
                 if (asyncResult == null || ar == null) {
@@ -319,7 +329,9 @@ namespace System.Net {
                 }
                 stream = (Stream) result;
                 m_writePending = false;
+#if !MONO
                 success = true;
+#endif
             } catch (Exception exception) {
                 if(Logging.On)Logging.Exception(Logging.Web, this, "EndGetRequestStream", exception);
                 throw;
@@ -340,7 +352,9 @@ namespace System.Net {
             GlobalLog.Enter("FileWebRequest::EndGetResponse");
 
             WebResponse response;
+#if !MONO
             bool success = false;
+#endif
             try {
                 LazyAsyncResult  ar = asyncResult as LazyAsyncResult;
                 if (asyncResult == null || ar == null) {
@@ -356,7 +370,9 @@ namespace System.Net {
                 }
                 response = (WebResponse) result;
                 m_readPending = false;
+#if !MONO
                 success = true;
+#endif
             } catch (Exception exception) {
                 if(Logging.On)Logging.Exception(Logging.Web, this, "EndGetResponse", exception);
                 throw;
index 8fa1b7eea41403f232d32a996504bfe9d9531882..5ae0b4b7f8e32be831ab846e40b66e43067b3611 100644 (file)
@@ -30,7 +30,7 @@ namespace System.Net.Mime
 
         //used when the length of the header name itself is known (i.e. Subject : )
         internal static string EncodeHeaderValue(string value, Encoding encoding, bool base64Encoding, int headerLength) {
-            StringBuilder newString = new StringBuilder();
+//            StringBuilder newString = new StringBuilder();
             
             //no need to encode if it's pure ascii
             if (IsAscii(value, false)) {
index fe5858875faa8c20236f15eb604adbe491b20c26..15840cd7022b9729306b19eac0cf0382fbe0f29a 100644 (file)
@@ -504,7 +504,9 @@ namespace System.Net {
 #if MONO
         public static IWebProxy CreateDefaultProxy ()
         {
-#if MONOTOUCH
+#if FEATURE_NO_BSD_SOCKETS
+            throw new PlatformNotSupportedException ();
+#elif MONOTOUCH
             return Mono.Net.CFNetwork.GetDefaultProxy ();
 #elif MONODROID
             // Return the system web proxy.  This only works for ICS+.
index 4675771138671184da9cab61a354f3441eebb24c..8d93ee8c2d0e56ccd2e5054bdf12f1ca0b8c67f8 100644 (file)
@@ -1408,12 +1408,16 @@ namespace System.Text.RegularExpressions {
         /// <devdoc>
         /// </devdoc>
         protected bool UseOptionC() {
-               /* Mono: Set to false until we investigate  https://bugzilla.xamarin.com/show_bug.cgi?id=25671 */
-           return false;
 #if FULL_AOT_RUNTIME
             return false;
 #else
+
+#if MONO
+            /* Mono: Set to false until we investigate  https://bugzilla.xamarin.com/show_bug.cgi?id=25671 */
+            return false;
+#else
             return(roptions & RegexOptions.Compiled) != 0;
+#endif
 #endif
         }
 #endif
index 8cf2d64a9db72d7fbd5253643d7d9e9cb7a25b28..d9c27a4ffec108c1cefd334bc83cec6e89e708ec 100644 (file)
@@ -567,11 +567,11 @@ namespace System.Text.RegularExpressions {
                     // This is code for Posix style properties - [:Ll:] or [:IsTibetan:].
                     // It currently doesn't do anything other than skip the whole thing!
                     if (CharsRight() > 0 && RightChar() == ':' && !inRange) {
-                        String name;
+//                        String name;
                         int savePos = Textpos();
 
                         MoveRight();
-                        name = ScanCapname();
+/*                        name = */ ScanCapname();
                         if (CharsRight() < 2 || MoveRightGetChar() != ':' || MoveRightGetChar() != ']')
                             Textto(savePos);
                         // else lookup name (nyi)
index 13016654b5ce11c726809607480a982610e976c0..1bae2cf63bf817810294f9c3df7bdad70719e510 100644 (file)
@@ -66,16 +66,20 @@ namespace System.Diagnostics {
         ProcessModuleCollection modules;
 #endif // !FEATURE_PAL        
 
+#if !MONO
         bool haveMainWindow;
         IntPtr mainWindowHandle;  // no need to use SafeHandle for window        
         string mainWindowTitle;
+#endif
         
         bool haveWorkingSetLimits;
         IntPtr minWorkingSet;
         IntPtr maxWorkingSet;
-        
+
+#if !MONO
         bool haveProcessorAffinity;
         IntPtr processorAffinity;
+#endif
 
         bool havePriorityClass;
         ProcessPriorityClass priorityClass;
@@ -1870,12 +1874,18 @@ namespace System.Diagnostics {
             threads = null;
             modules = null;
 #endif // !FEATURE_PAL            
+#if !MONO
             mainWindowTitle = null;
+#endif
             exited = false;
             signaled = false;
+#if !MONO
             haveMainWindow = false;
+#endif
             haveWorkingSetLimits = false;
+#if !MONO
             haveProcessorAffinity = false;
+#endif
             havePriorityClass = false;
             haveExitTime = false;
 #if !MONO
index eae169c364f07c1c70e52b8a7aac444dadda66b0..2ec06ebb237033e4279c08170534ccad8381eac1 100644 (file)
@@ -251,6 +251,9 @@ namespace System.Threading
 #endif
 
         // This exists in WaitHandle, but is oddly ifdefed for some reason...
+#if MONO
+        new
+#endif
         private enum OpenExistingResult
         {
             Success,
@@ -362,7 +365,7 @@ namespace System.Threading
             //Non-Zero return 
 
 #if MONO
-            if (!ReleaseSemaphore_internal(Handle, releaseCount, out previousCount))
+            if (!ReleaseSemaphore_internal(SafeWaitHandle.DangerousGetHandle(), releaseCount, out previousCount))
 #else
             if (!SafeNativeMethods.ReleaseSemaphore(SafeWaitHandle, releaseCount, out previousCount))
 #endif
index aacf09fdbb1dc4c4c5641f2798a1d2c64c7abf08..79d8a97c4db22670dbac130fce3cbd8a7e12efd9 100644 (file)
@@ -1278,11 +1278,13 @@ namespace System.Runtime.InteropServices.WindowsRuntime
             if (type == null)
                 throw new ArgumentNullException("type");
 
+#if FEATURE_COMINTEROP || MONO_COM
             if (type.IsWindowsRuntimeObject && type.IsImport)
             {
                 return (IActivationFactory)Marshal.GetNativeActivationFactory(type);
             }
             else
+#endif
             {
 #if FEATURE_COMINTEROP_WINRT_MANAGED_ACTIVATION
                 return GetManagedActivationFactory(type);
diff --git a/mcs/errors/cs8101.cs b/mcs/errors/cs8101.cs
new file mode 100644 (file)
index 0000000..eea62fd
--- /dev/null
@@ -0,0 +1,7 @@
+// CS8101: The pathmap option was incorrectly formatted
+// Line: 0
+// Compiler options: -pathmap:a=
+
+class X
+{
+}
\ No newline at end of file
index 33b05ff809b320ddcb69813f7fbc448007e81153..ddcb149f942a7c818e78b848558ae693882132d1 100644 (file)
@@ -674,13 +674,13 @@ namespace Mono.CSharp
                        if (all_source_files == null) {
                                all_source_files = new Dictionary<string, SourceFile> ();
                                foreach (var source in SourceFiles)
-                                       all_source_files[source.FullPathName] = source;
+                                       all_source_files[source.OriginalFullPathName] = source;
                        }
 
                        string path;
                        if (!Path.IsPathRooted (name)) {
                                var loc = comp_unit.SourceFile;
-                               string root = Path.GetDirectoryName (loc.FullPathName);
+                               string root = Path.GetDirectoryName (loc.OriginalFullPathName);
                                path = Path.GetFullPath (Path.Combine (root, name));
                                var dir = Path.GetDirectoryName (loc.Name);
                                if (!string.IsNullOrEmpty (dir))
index 2077f26bf2cf99d835fed105bbf4503bfeeae1d5..6f1b80596d04cf30d046b1c8439575558d1e2283 100644 (file)
@@ -5222,7 +5222,7 @@ namespace Mono.CSharp {
                                                if ((fp.ModFlags & Parameter.Modifier.CallerLineNumber) != 0) {
                                                        e = new IntLiteral (ec.BuiltinTypes, loc.Row, loc);
                                                } else if ((fp.ModFlags & Parameter.Modifier.CallerFilePath) != 0) {
-                                                       e = new StringLiteral (ec.BuiltinTypes, loc.NameFullPath, loc);
+                                                       e = new StringLiteral (ec.BuiltinTypes, loc.SourceFile.GetFullPathName (ec.Module.Compiler.Settings.PathMap), loc);
                                                } else if (ec.MemberContext.CurrentMemberDefinition != null) {
                                                        e = new StringLiteral (ec.BuiltinTypes, ec.MemberContext.CurrentMemberDefinition.GetCallerMemberName (), loc);
                                                }
index 79cee3cbf7db1dc87fb77e5acfa57ccfa3259f10..658f3b765fa4f48f4e9e1bce1787cca9a387e215 100644 (file)
@@ -15,6 +15,7 @@ using System.Collections.Generic;
 using Mono.CompilerServices.SymbolWriter;
 using System.Diagnostics;
 using System.Linq;
+using System.IO;
 
 namespace Mono.CSharp
 {
@@ -55,7 +56,7 @@ namespace Mono.CSharp
                static readonly byte[] MD5Algorith = { 96, 166, 110, 64, 207, 100, 130, 76, 182, 240, 66, 212, 129, 114, 167, 153 };
 
                public readonly string Name;
-               public readonly string FullPathName;
+               public readonly string OriginalFullPathName;
                public readonly int Index;
                public bool AutoGenerated;
 
@@ -67,7 +68,7 @@ namespace Mono.CSharp
                {
                        this.Index = index;
                        this.Name = name;
-                       this.FullPathName = path;
+                       this.OriginalFullPathName = path;
                }
 
                public byte[] Checksum {
@@ -99,21 +100,43 @@ namespace Mono.CSharp
                        this.checksum = checksum;
                }
 
-               public SourceFileEntry CreateSymbolInfo (MonoSymbolFile symwriter)
+               public SourceFileEntry CreateSymbolInfo (MonoSymbolFile symwriter, List<KeyValuePair<string, string>> pathMap)
                {
                        if (hidden_lines != null)
                                hidden_lines.Sort ();
 
-                       file = new SourceFileEntry (symwriter, FullPathName, algGuid, checksum);
+                       file = new SourceFileEntry (symwriter, GetFullPathName (pathMap), OriginalFullPathName, algGuid, checksum);
                        if (AutoGenerated)
                                file.SetAutoGenerated ();
 
                        return file;
                }
 
+               public string GetFullPathName (List<KeyValuePair<string, string>> pathMap)
+               {
+                       var path = OriginalFullPathName;
+                       if (pathMap != null) {
+                               foreach (var map in pathMap) {
+                                       var prefix = map.Key;
+                                       if (path.Length <= prefix.Length)
+                                               continue;
+
+                                       if (path [prefix.Length] != Path.DirectorySeparatorChar)
+                                               continue;
+
+                                       if (!path.StartsWith (prefix, StringComparison.Ordinal))
+                                               continue;
+
+                                       path = map.Value + path.Substring (prefix.Length);
+                               }
+                       }
+
+                       return path;
+               }
+
                public bool Equals (SourceFile other)
                {
-                       return FullPathName == other.FullPathName;
+                       return OriginalFullPathName == other.OriginalFullPathName;
                }
 
                public bool IsHiddenLocation (Location loc)
@@ -142,7 +165,7 @@ namespace Mono.CSharp
 
                public override string ToString ()
                {
-                       return String.Format ("SourceFile ({0}:{1}:{2})", Name, FullPathName, Index);
+                       return String.Format ("SourceFile ({0}:{1}:{2})", Name, OriginalFullPathName, Index);
                }
        }
 
@@ -326,10 +349,10 @@ namespace Mono.CSharp
                public string NameFullPath {
                        get {
                                int index = File;
-                               if (token == 0 || index <= 0)
+                               if (index <= 0)
                                        return null;
 
-                               return source_list[index - 1].FullPathName;
+                               return source_list[index - 1].OriginalFullPathName;
                        }
                }
 
@@ -369,18 +392,6 @@ if (checkpoints.Length <= CheckpointIndex) throw new Exception (String.Format ("
                        }
                }
 
-               // The ISymbolDocumentWriter interface is used by the symbol writer to
-               // describe a single source file - for each source file there's exactly
-               // one corresponding ISymbolDocumentWriter instance.
-               //
-               // This class has an internal hash table mapping source document names
-               // to such ISymbolDocumentWriter instances - so there's exactly one
-               // instance per document.
-               //
-               // This property returns the ISymbolDocumentWriter instance which belongs
-               // to the location's source file.
-               //
-               // If we don't have a symbol writer, this property is always null.
                public SourceFile SourceFile {
                        get {
                                int index = File;
index b5379056ee7f9ae38bc0166c9c8f191465762f2f..5384ee1368607a30ea61290b5f19610aa15349e0 100644 (file)
@@ -624,8 +624,8 @@ namespace Mono.CSharp {
                        if (include_files == null)
                                include_files = new Dictionary<string, SourceFile> ();
 
-                       if (!include_files.ContainsKey (file.FullPathName))
-                               include_files.Add (file.FullPathName, file);
+                       if (!include_files.ContainsKey (file.OriginalFullPathName))
+                               include_files.Add (file.OriginalFullPathName, file);
                }
 
                public void AddDefine (string value)
@@ -648,7 +648,7 @@ namespace Mono.CSharp {
                {
                        var sw = Module.DeclaringAssembly.SymbolWriter;
                        if (sw != null) {
-                               CreateUnitSymbolInfo (sw);
+                               CreateUnitSymbolInfo (sw, Compiler.Settings.PathMap);
                        }
 
                        base.PrepareEmit ();
@@ -657,14 +657,14 @@ namespace Mono.CSharp {
                //
                // Creates symbol file index in debug symbol file
                //
-               void CreateUnitSymbolInfo (MonoSymbolFile symwriter)
+               void CreateUnitSymbolInfo (MonoSymbolFile symwriter, List<KeyValuePair<string, string>> pathMap)
                {
-                       var si = file.CreateSymbolInfo (symwriter);
+                       var si = file.CreateSymbolInfo (symwriter, pathMap);
                        comp_unit = new CompileUnitEntry (symwriter, si);
 
                        if (include_files != null) {
                                foreach (SourceFile include in include_files.Values) {
-                                       si = include.CreateSymbolInfo (symwriter);
+                                       si = include.CreateSymbolInfo (symwriter, pathMap);
                                        comp_unit.AddFile (si);
                                }
                        }
index 5a76b965889697d1462b92b3b08540348942ee71..63c6c41d516971168f969c39e4c1f75b1e73ba36 100644 (file)
@@ -87,6 +87,8 @@ namespace Mono.CSharp {
                //
                public List<Tuple<string, string>> AssemblyReferencesAliases;
 
+               public List<KeyValuePair<string, string>> PathMap;
+
                //
                // Modules to be embedded
                //
@@ -1210,6 +1212,31 @@ namespace Mono.CSharp {
                                settings.RuntimeMetadataVersion = value;
                                return ParseResult.Success;
 
+                       case "/pathmap":
+                               if (value.Length == 0) {
+                                       return ParseResult.Success;
+                               }
+
+                               foreach (var pair in value.Split (',')) {
+                                       var kv = pair.Split ('=');
+                                       if (kv.Length != 2) {
+                                               report.Error (8101, "The pathmap option was incorrectly formatted");
+                                               return ParseResult.Error;
+                                       }
+
+                                       if (settings.PathMap == null)
+                                               settings.PathMap = new List<KeyValuePair<string, string>> ();
+
+                                       var key = kv [0].TrimEnd (Path.DirectorySeparatorChar);
+                                       var path = kv [1].TrimEnd (Path.DirectorySeparatorChar);
+                                       if (key.Length == 0 || path.Length == 0)
+                                               report.Error (8101, "The pathmap option was incorrectly formatted");
+
+                                       settings.PathMap.Add (new KeyValuePair<string, string> (key, path));
+                               }
+
+                               return ParseResult.Success;
+
                        // csc options that we don't support
                        case "/analyzer":
                        case "/appconfig":
@@ -1224,7 +1251,6 @@ namespace Mono.CSharp {
                        case "/link":
                        case "/moduleassemblyname":
                        case "/nowin32manifest":
-                       case "/pathmap":
                        case "/pdb":
                        case "/preferreduilang":
                        case "/publicsign":
@@ -1595,7 +1621,7 @@ namespace Mono.CSharp {
                                "   -help                Lists all compiler options (short: -?)\n" +
                                "   -keycontainer:NAME   The key pair container used to sign the output assembly\n" +
                                "   -keyfile:FILE        The key file used to strongname the ouput assembly\n" +
-                               "   -langversion:TEXT    Specifies language version: ISO-1, ISO-2, 3, 4, 5, Default or Experimental\n" +
+                               "   -langversion:TEXT    Specifies language version: ISO-1, ISO-2, 3, 4, 5, 6, Default or Experimental\n" +
                                "   -lib:PATH1[,PATHn]   Specifies the location of referenced assemblies\n" +
                                "   -main:CLASS          Specifies the class with the Main method (short: -m)\n" +
                                "   -noconfig            Disables implicitly referenced assemblies\n" +
@@ -1603,6 +1629,7 @@ namespace Mono.CSharp {
                                "   -nowarn:W1[,Wn]      Suppress one or more compiler warnings\n" +
                                "   -optimize[+|-]       Enables advanced compiler optimizations (short: -o)\n" +
                                "   -out:FILE            Specifies output assembly name\n" +
+                               "   -pathmap:K=V[,Kn=Vn] Sets a mapping for source path names used in generated output\n" +
                                "   -pkg:P1[,Pn]         References packages P1..Pn\n" +
                                "   -platform:ARCH       Specifies the target platform of the output assembly\n" +
                                "                        ARCH can be one of: anycpu, anycpu32bitpreferred, arm,\n" +
index b871a0f5e14ee95af074ce1db6a962ec50c33407..b551fa782c6852c06adbf366c711836a0b2ee039 100644 (file)
@@ -6,4 +6,12 @@ LOCAL_MCS_FLAGS =
 LIB_REFS = System Mono.Security Mono.Btls.Interface
 PROGRAM = btls-cert-sync.exe
 
+ifndef HAVE_BTLS
+PROGRAM_NAME = dummy-btls-cert-sync.exe
+NO_INSTALL = yes
+NO_SIGN_ASSEMBLY = yes
+NO_TEST = yes
+NO_BUILD = yes
+endif
+
 include ../../build/executable.make
index 75b22b934c83c16f46c9d255ce384d5ab8b53368..567c766e6cb5092bce1e1803a64f8e78e1647eb7 100644 (file)
@@ -55,7 +55,7 @@ namespace Mono {
                        var startup_files = new string [settings.SourceFiles.Count];
                        int i = 0;
                        foreach (var source in settings.SourceFiles)
-                               startup_files [i++] = source.FullPathName;
+                               startup_files [i++] = source.OriginalFullPathName;
                        settings.SourceFiles.Clear ();
 
                        TextWriter agent_stderr = null;
index 749b77506bbdf6667df67edfe9e6be9beee9aabf..95b8a92d38d3c7046aa9f8ad98b66d21f1238651 100644 (file)
@@ -152,7 +152,7 @@ and `bin'. You can specify
 
 Example:
 
-monoliner -d ../../libs -a program.exe
+monolinker -d ../../libs -a program.exe
 
 8) Adding custom steps to the linker.
 
index 05faf5e8c685e1ec0ce4d295e848619f974d28c8..64a1b9cbf928bc1824705bdebd3d95049321cb23 100644 (file)
@@ -11,10 +11,23 @@ RESOURCE_FILES = $(OTHER_RES)
 LOCAL_MCS_FLAGS= $(OTHER_RES:%=-resource:%)
 
 LOCAL_MCS_FLAGS += -d:STATIC,NO_SYMBOL_WRITER,NO_AUTHENTICODE
-LIB_REFS = System.Xml System System.Core
+LIB_REFS = System.Xml System System.Core System.IO.Compression.FileSystem
 
 EXTRA_DISTFILES = $(RESOURCE_FILES)
 
 include ../../build/executable.make
 
 mkbundle.exe: $(RESOURCE_FILES)
+
+test-simple: simple.exe
+       mono --debug $(the_lib) --simple simple.exe -o foo && ./foo
+       mono --debug $(the_lib) --cross default simple.exe -o foo && ./foo
+       mono --debug $(the_lib) --sdk `dirname \`which mono\``/.. simple.exe -o foo && ./foo
+       -rm DEMO.zip
+       mono-package-runtime `dirname \`which mono\``/.. DEMO
+       mkdir -p ~/.mono/targets/DEMO
+       unzip -d ~/.mono/targets/DEMO DEMO.zip
+       mono --debug $(the_lib) --cross DEMO simple.exe -o foo && ./foo
+
+simple.exe: Makefile
+       echo 'class X { static void Main () { System.Console.WriteLine ("OK");}}' > simple.cs && mcs simple.cs
index 014353d8bcc5a1a24b422558d2d47ef881bf83f7..f9ba0a189f33dca017f7f2f42800aca06c77cb91 100644 (file)
       <Project>{359142A1-D80F-401E-AA64-7167C9317649}</Project>\r
       <Name>System.Core-net_4_x</Name>\r
     </ProjectReference>\r
+    <ProjectReference Include="../../class/System.IO.Compression.FileSystem/System.IO.Compression.FileSystem-net_4_x.csproj">\r
+      <Project>{9E61FF2E-493E-4CA0-BBDA-2EF96A4CB058}</Project>\r
+      <Name>System.IO.Compression.FileSystem-net_4_x</Name>\r
+    </ProjectReference>\r
   </ItemGroup>\r
   <ItemGroup>\r
     <Folder Include="Properties\" />\r
index 447540860f50024ec14df5685b4cf49d5fc3218d..1ea1d7402455704a22e4b237c25c8fe15f3d3f9b 100755 (executable)
@@ -3,6 +3,16 @@
 //
 // Based on the `make-bundle' Perl script written by Paolo Molaro (lupus@debian.org)
 //
+// TODO:
+//   [x] Rename the paths for the zip file that is downloaded
+//   [x] Update documentation with new flag
+//   [x] Load internationalized assemblies
+//   [x] Dependencies - if System.dll -> include Mono.Security.* (not needed, automatic)
+//   [x] --list-targets should download from a different url
+//   [x] --fetch-target should unpack zip file
+//   [x] Update --cross to use not a runtime, but an SDK
+//   [x] Update --local-targets to show the downloaded SDKs
+//
 // Author:
 //   Miguel de Icaza
 //
@@ -52,6 +62,8 @@ class MakeBundle {
        static bool custom_mode = true;
        static string embedded_options = null;
        static string runtime = null;
+       static string sdk_path = null;
+       static string lib_path = null;
        static Dictionary<string,string> environment = new Dictionary<string,string>();
        static string [] i18n = new string [] {
                "West",
@@ -74,7 +86,7 @@ class MakeBundle {
                link_paths.Add (".");
 
                DetectOS ();
-               
+
                for (int i = 0; i < top; i++){
                        switch (args [i]){
                        case "--help": case "-h": case "-?":
@@ -121,6 +133,8 @@ class MakeBundle {
                                        Help (); 
                                        return 1;
                                }
+                               if (sdk_path != null || runtime != null)
+                                       Error ("You can not specify one of --runtime, --sdk or --cross");
                                custom_mode = false;
                                autodeps = true;
                                cross_target = args [++i];
@@ -146,10 +160,8 @@ class MakeBundle {
                                        alias = lspec.Substring (0, p);
                                        path = lspec.Substring (p+1);
                                }
-                               if (!File.Exists (path)){
-                                       Console.Error.WriteLine ($"The specified library file {path} does not exist");
-                                       return 1;
-                               }
+                               if (!File.Exists (path))
+                                       Error ($"The specified library file {path} does not exist");
                                libraries [alias] = path;
                                break;
 
@@ -162,10 +174,10 @@ class MakeBundle {
                                break;
 
                        case "--list-targets":
+                               CommandLocalTargets ();
                                var wc = new WebClient ();
-                               var s = wc.DownloadString (new Uri (target_server + "target-list.txt"));
-                               Console.WriteLine ("Cross-compilation targets available:\n" + s);
-                               
+                               var s = wc.DownloadString (new Uri (target_server + "target-sdks.txt"));
+                               Console.WriteLine ("Targets available for download with --fetch-target:\n" + s);
                                return 0;
                                
                        case "--target-server":
@@ -191,11 +203,24 @@ class MakeBundle {
                                }
                                embedded_options = args [++i];
                                break;
+                       case "--sdk":
+                               if (i + 1 == top) {
+                                       Help ();
+                                       return 1;
+                               }
+                               custom_mode = false;
+                               autodeps = true;
+                               sdk_path = args [++i];
+                               if (cross_target != null || runtime != null)
+                                       Error ("You can not specify one of --runtime, --sdk or --cross");
+                               break;
                        case "--runtime":
                                if (i+1 == top){
                                        Help (); 
                                        return 1;
                                }
+                               if (sdk_path != null || cross_target != null)
+                                       Error ("You can only specify one of --runtime, --sdk or --cross");
                                custom_mode = false;
                                autodeps = true;
                                runtime = args [++i];
@@ -283,7 +308,7 @@ class MakeBundle {
                                case "linux":
                                        break;
                                default:
-                                       Console.Error.WriteLine ("Invalid style '{0}' - only 'windows', 'mac' and 'linux' are supported for --style argument", style);
+                                       Error ("Invalid style '{0}' - only 'windows', 'mac' and 'linux' are supported for --style argument", style);
                                        return 1;
                                }
                                        
@@ -328,21 +353,39 @@ class MakeBundle {
                        }
 
                }
+               // Modern bundling starts here
+               if (!custom_mode){
+                       if (runtime != null){
+                               // Nothing to do here, the user has chosen to manually specify --runtime nad libraries
+                       } else if (sdk_path != null) {
+                               VerifySdk (sdk_path);
+                       } else if (cross_target == "default" || cross_target == null){
+                               sdk_path = Path.GetFullPath (Path.Combine (Process.GetCurrentProcess().MainModule.FileName, "..", ".."));
+                               VerifySdk (sdk_path);
+                       } else {
+                               sdk_path = Path.Combine (targets_dir, cross_target);
+                               Console.WriteLine ("From: " + sdk_path);
+                               VerifySdk (sdk_path);
+                       }
+               }
 
                if (fetch_target != null){
-                       var truntime = Path.Combine (targets_dir, fetch_target, "mono");
-                       Directory.CreateDirectory (Path.GetDirectoryName (truntime));
+                       var directory = Path.Combine (targets_dir, fetch_target);
+                       var zip_download = Path.Combine (directory, "sdk.zip");
+                       Directory.CreateDirectory (Path.GetDirectoryName (directory));
                        var wc = new WebClient ();
                        var uri = new Uri ($"{target_server}{fetch_target}");
                        try {
                                if (!quiet){
-                                       Console.WriteLine ($"Downloading runtime {uri} to {truntime}");
+                                       Console.WriteLine ($"Downloading runtime {uri} to {zip_download}");
                                }
                                
-                               wc.DownloadFile (uri, truntime);
+                               wc.DownloadFile (uri, zip_download);
+                               ZipFile.ExtractToDirectory(zip_download, directory);
+                               File.Delete (zip_download);
                        } catch {
                                Console.Error.WriteLine ($"Failure to download the specified runtime from {uri}");
-                               File.Delete (truntime);
+                               File.Delete (zip_download);
                                return 1;
                        }
                        return 0;
@@ -359,48 +402,41 @@ class MakeBundle {
                }
 
                List<string> assemblies = LoadAssemblies (sources);
+               LoadLocalizedAssemblies (assemblies);
                List<string> files = new List<string> ();
                foreach (string file in assemblies)
                        if (!QueueAssembly (files, file))
                                return 1;
                if (custom_mode)
                        GenerateBundles (files);
-               else {
-                       if (cross_target == "default")
-                               runtime = null;
-                       else {
-                               if (runtime == null){
-                                       if (cross_target == null){
-                                               Console.Error.WriteLine ("you should specify either a --runtime or a --cross compilation target");
-                                               Environment.Exit (1);
-                                       }
-                                       runtime = Path.Combine (targets_dir, cross_target, "mono");
-                                       if (!File.Exists (runtime)){
-                                               Console.Error.WriteLine ($"The runtime for the {cross_target} does not exist, use --fetch-target {cross_target} to download first");
-                                               return 1;
-                                       }
-                               } else {
-                                       if (!File.Exists (runtime)){
-                                               Console.Error.WriteLine ($"The Mono runtime specified with --runtime does not exist");
-                                               return 1;
-                                       }
-                               }
-                               
-                       }
+               else 
                        GeneratePackage (files);
-               }
+
                Console.WriteLine ("Generated {0}", output);
 
                return 0;
        }
 
+       static void VerifySdk (string path)
+       {
+               if (!Directory.Exists (path))
+                       Error ($"The specified SDK path does not exist: {path}");
+               runtime = Path.Combine (sdk_path, "bin", "mono");
+               if (!File.Exists (runtime))
+                       Error ($"The SDK location does not contain a {path}/bin/mono runtime");
+               lib_path = Path.Combine (path, "lib", "mono", "4.5");
+               if (!Directory.Exists (lib_path))
+                       Error ($"The SDK location does not contain a {path}/lib/mono/4.5 directory");
+               link_paths.Add (lib_path);
+       }
+
        static string targets_dir = Path.Combine (Environment.GetFolderPath (Environment.SpecialFolder.Personal), ".mono", "targets");
        
        static void CommandLocalTargets ()
        {
                string [] targets;
 
-               Console.WriteLine ("Available targets:");
+               Console.WriteLine ("Available targets locally:");
                Console.WriteLine ("\tdefault\t- Current System Mono");
                try {
                        targets = Directory.GetDirectories (targets_dir);
@@ -408,7 +444,7 @@ class MakeBundle {
                        return;
                }
                foreach (var target in targets){
-                       var p = Path.Combine (target, "mono");
+                       var p = Path.Combine (target, "bin", "mono");
                        if (File.Exists (p))
                                Console.WriteLine ("\t{0}", Path.GetFileName (target));
                }
@@ -580,7 +616,7 @@ class MakeBundle {
                        return true;
                
                if (!File.Exists (file)){
-                       Console.Error.WriteLine ("The file {0} does not exist", file);
+                       Error ("The file {0} does not exist", file);
                        return false;
                }
                maker.Add (code, file);
@@ -593,17 +629,17 @@ class MakeBundle {
                        if (IsUnix)
                                runtime = Process.GetCurrentProcess().MainModule.FileName;
                        else {
-                               Console.Error.WriteLine ("You must specify at least one runtime with --runtime or --cross");
+                               Error ("You must specify at least one runtime with --runtime or --cross");
                                Environment.Exit (1);
                        }
                }
                if (!File.Exists (runtime)){
-                       Console.Error.WriteLine ($"The specified runtime at {runtime} does not exist");
+                       Error ($"The specified runtime at {runtime} does not exist");
                        Environment.Exit (1);
                }
                
                if (ctor_func != null){
-                       Console.Error.WriteLine ("--static-ctor not supported with package bundling, you must use native compilation for this");
+                       Error ("--static-ctor not supported with package bundling, you must use native compilation for this");
                        return false;
                }
                
@@ -786,7 +822,7 @@ void          mono_register_config_for_assembly (const char* assembly_name, cons
                                try {
                                        conf = File.OpenRead (config_file);
                                } catch {
-                                       Error (String.Format ("Failure to open {0}", config_file));
+                                       Error ("Failure to open {0}", config_file);
                                        return;
                                }
                                if (!quiet)
@@ -805,7 +841,7 @@ void          mono_register_config_for_assembly (const char* assembly_name, cons
                                try {
                                        conf = File.OpenRead (machine_config_file);
                                } catch {
-                                       Error (String.Format ("Failure to open {0}", machine_config_file));
+                                       Error ("Failure to open {0}", machine_config_file);
                                        return;
                                }
                                if (!quiet)
@@ -1014,11 +1050,9 @@ void          mono_register_config_for_assembly (const char* assembly_name, cons
                List<string> assemblies = new List<string> ();
                bool error = false;
 
-               var other = i18n.Select (x=> "I18N." + x + (x.Length > 0 ? "." : "") + "dll");
-               
-               foreach (string name in sources.Concat (other)){
+               foreach (string name in sources){
                        try {
-                               Assembly a = LoadAssembly (name);
+                               Assembly a = LoadAssemblyFile (name);
 
                                if (a == null){
                                        error = true;
@@ -1039,9 +1073,40 @@ void          mono_register_config_for_assembly (const char* assembly_name, cons
 
                if (error)
                        Environment.Exit (1);
-
+               
                return assemblies;
        }
+
+       static void LoadLocalizedAssemblies (List<string> assemblies)
+       {
+               var other = i18n.Select (x => "I18N." + x + (x.Length > 0 ? "." : "") + "dll");
+               bool error = false;
+
+               foreach (string name in other) {
+                       try {
+                               Assembly a = LoadAssembly (name);
+
+                               if (a == null) {
+                                       error = true;
+                                       continue;
+                               }
+
+                               assemblies.Add (a.CodeBase);
+                       } catch (Exception) {
+                               if (skip_scan) {
+                                       if (!quiet)
+                                               Console.WriteLine ("File will not be scanned: {0}", name);
+                                       assemblies.Add (new Uri (new FileInfo (name).FullName).ToString ());
+                               } else {
+                                       throw;
+                               }
+                       }
+               }
+
+               if (error)
+                       Environment.Exit (1);
+       }
+
        
        static readonly Universe universe = new Universe ();
        static readonly Dictionary<string, string> loaded_assemblies = new Dictionary<string, string> ();
@@ -1076,7 +1141,7 @@ void          mono_register_config_for_assembly (const char* assembly_name, cons
                var name = GetAssemblyName (path);
                string found;
                if (loaded_assemblies.TryGetValue (name, out found)) {
-                       Error (string.Format ("Duplicate assembly name `{0}'. Both `{1}' and `{2}' use same assembly name.", name, path, found));
+                       Error ("Duplicate assembly name `{0}'. Both `{1}' and `{2}' use same assembly name.", name, path, found);
                        return false;
                }
 
@@ -1089,7 +1154,7 @@ void          mono_register_config_for_assembly (const char* assembly_name, cons
                        Assembly a = universe.LoadFile (path);
 
                        foreach (AssemblyName an in a.GetReferencedAssemblies ()) {
-                               a = universe.Load (an.FullName);
+                               LoadAssembly (an.FullName);
                                if (!QueueAssembly (files, a.CodeBase))
                                        return false;
                        }
@@ -1101,56 +1166,57 @@ void          mono_register_config_for_assembly (const char* assembly_name, cons
                return true;
        }
 
-       static Assembly LoadAssembly (string assembly)
+       //
+       // Loads an assembly from a specific path
+       //
+       static Assembly LoadAssemblyFile (string assembly)
        {
-               Assembly a;
+               Assembly a = null;
                
                try {
-                       char[] path_chars = { '/', '\\' };
-                       
-                       if (assembly.IndexOfAny (path_chars) != -1) {
-                               a = universe.LoadFile (assembly);
-                       } else {
-                               string ass = assembly;
-                               if (ass.EndsWith (".dll"))
-                                       ass = assembly.Substring (0, assembly.Length - 4);
-                               a = universe.Load (ass);
-                       }
-                       return a;
+                       a = universe.LoadFile (assembly);
                } catch (FileNotFoundException){
-                       string total_log = "";
-                       
-                       foreach (string dir in link_paths){
-                               string full_path = Path.Combine (dir, assembly);
-                               if (!assembly.EndsWith (".dll") && !assembly.EndsWith (".exe"))
-                                       full_path += ".dll";
-                               
-                               try {
-                                       a = universe.LoadFile (full_path);
-                                       return a;
-                               } catch (FileNotFoundException ff) {
-                                       total_log += ff.FusionLog;
-                                       continue;
-                               }
-                       }
-                       Error ("Cannot find assembly `" + assembly + "'" );
-                       if (!quiet)
-                               Console.WriteLine ("Log: \n" + total_log);
+                       Error ($"Cannot find assembly `{assembly}'");
                } catch (IKVM.Reflection.BadImageFormatException f) {
                        if (skip_scan)
                                throw;
-                       Error ("Cannot load assembly (bad file format) " + f.Message);
+                       Error ($"Cannot load assembly (bad file format) " + f.Message);
                } catch (FileLoadException f){
-                       Error ("Cannot load assembly " + f.Message);
+                       Error ($"Cannot load assembly " + f.Message);
                } catch (ArgumentNullException){
-                       Error("Cannot load assembly (null argument)");
+                       Error( $"Cannot load assembly (null argument)");
                }
-               return null;
+               return a;
        }
 
-       static void Error (string msg)
+       //
+       // Loads an assembly from any of the link directories provided
+       //
+       static Assembly LoadAssembly (string assembly)
+       {
+               string total_log = "";
+               foreach (string dir in link_paths){
+                       string full_path = Path.Combine (dir, assembly);
+                       if (!assembly.EndsWith (".dll") && !assembly.EndsWith (".exe"))
+                               full_path += ".dll";
+                       
+                       try {
+                               var a = universe.LoadFile (full_path);
+                               return a;
+                       } catch (FileNotFoundException ff) {
+                               total_log += ff.FusionLog;
+                               continue;
+                       }
+               }
+               if (!quiet)
+                       Console.WriteLine ("Log: \n" + total_log);
+               return null;
+       }
+       
+       static void Error (string msg, params object [] args)
        {
-               Console.Error.WriteLine ("ERROR: " + msg);
+               Console.Error.WriteLine ("ERROR: {0}", string.Format (msg, args));
+               throw new Exception ();
                Environment.Exit (1);
        }
 
@@ -1172,12 +1238,14 @@ void          mono_register_config_for_assembly (const char* assembly_name, cons
                                   "--simple   Simple mode does not require a C toolchain and can cross compile\n" + 
                                   "    --cross TARGET       Generates a binary for the given TARGET\n"+
                                   "    --env KEY=VALUE      Hardcodes an environment variable for the target\n" +
+                                  "    --fetch-target NAME  Downloads the target SDK from the remote server\n" + 
                                   "    --library [LIB,]PATH Bundles the specified dynamic library to be used at runtime\n" +
                                   "                         LIB is optional shortname for file located at PATH\n" + 
                                   "    --list-targets       Lists available targets on the remote server\n" +
                                   "    --local-targets      Lists locally available targets\n" +
                                   "    --options OPTIONS    Embed the specified Mono command line options on target\n" +
                                   "    --runtime RUNTIME    Manually specifies the Mono runtime to use\n" +
+                                  "    --sdk PATH           Use a Mono SDK root location instead of a target\n" + 
                                   "    --target-server URL  Specified a server to download targets from, default is " + target_server + "\n" +
                                   "\n" +
                                   "--custom   Builds a custom launcher, options for --custom\n" +
@@ -1308,7 +1376,7 @@ void          mono_register_config_for_assembly (const char* assembly_name, cons
                        p.WaitForExit ();
                        int ret = p.ExitCode;
                        if (ret != 0){
-                               Error (String.Format("[Fail] {0}", ret));
+                               Error ("[Fail] {0}", ret);
                        }
                }
        }
index aba7440e5058120c4c82cc779bc23d4582236425..0e01496e9fa75e6b56c8e01140b564279673b79b 100644 (file)
@@ -79,10 +79,12 @@ set (
        ${BORINGSSL_OBJECTS}
 )
 
-if (BUILD_SHARED_LIBS)
+if (BUILD_DYNAMIC_BTLS)
+       add_library (mono-btls-shared SHARED ${MONO_BTLS_SOURCES})
+elseif (BUILD_SHARED_LIBS)
        add_library (mono-btls-shared SHARED ${MONO_BTLS_SOURCES})
        set_target_properties (mono-btls-shared PROPERTIES RULE_LAUNCH_LINK
-               "${PROJECT_SOURCE_DIR}/create-object-library.sh ${CMAKE_BINARY_DIR} mono-btls-shared.txt mono-btls-shared-lo.txt libmono-btls-shared.a shared ${CMAKE_AR} ${CMAKE_RANLIB} <OBJECTS> --"
+               "${PROJECT_SOURCE_DIR}/create-object-library.sh ${CMAKE_BINARY_DIR} mono-btls-shared.txt mono-btls-shared-lo.txt libmono-btls-shared.a shared ${CMAKE_AR} ${CMAKE_RANLIB} <OBJECTS> --"
        )
 else ()
        add_library (mono-btls-static STATIC ${MONO_BTLS_SOURCES})
index 0bb00bf184e34924b76ab1d5e6c7d545f38d1116..714bfb1a863e03a6a7dc0fc4dbc7305ebc6b2859 100644 (file)
@@ -46,9 +46,15 @@ CMAKE_ARGS = -D CMAKE_INSTALL_PREFIX:PATH=$(prefix) -D BTLS_ROOT:PATH=$(BTLS_ROO
 
 all-local: $(BTLS_STATIC_LIST) $(BTLS_SHARED_LIST)
 
+if DYNAMIC_BTLS
+build-shared/Makefile:
+       -mkdir -p build-shared
+       (cd build-shared && $(CMAKE) $(CMAKE_ARGS) $(BTLS_CMAKE_ARGS) -DBUILD_DYNAMIC_BTLS=1 $(abs_top_srcdir)/mono/btls)
+else
 build-shared/Makefile:
        -mkdir -p build-shared
        (cd build-shared && $(CMAKE) $(CMAKE_ARGS) $(BTLS_CMAKE_ARGS) -DBUILD_SHARED_LIBS=1 $(abs_top_srcdir)/mono/btls)
+endif
 
 build-static/Makefile:
        -mkdir -p build-static
@@ -64,3 +70,7 @@ clean-local:
        -rm -rf build-static
        -rm -rf build-shared
 
+if DYNAMIC_BTLS
+install-exec-local:
+       $(install_sh) build-shared/libmono-btls-shared.* "$(DESTDIR)/$(libdir)"
+endif
index 5af2d86ecd6346a6ed26dff03076b2360a0c1baf..ea8fda67dc35096689e0e580561e7e4b68b38577 100644 (file)
@@ -114,7 +114,7 @@ static const BIO_METHOD mono_method = {
        NULL, NULL, mono_ctrl, mono_new, mono_free, NULL
 };
 
-BIO *
+MONO_API BIO *
 mono_btls_bio_mono_new (void)
 {
        BIO *bio;
@@ -136,7 +136,7 @@ mono_btls_bio_mono_new (void)
        return bio;
 }
 
-void
+MONO_API void
 mono_btls_bio_mono_initialize (BIO *bio, const void *instance,
                              MonoBtlsReadFunc read_func, MonoBtlsWriteFunc write_func,
                              MonoBtlsControlFunc control_func)
@@ -151,55 +151,55 @@ mono_btls_bio_mono_initialize (BIO *bio, const void *instance,
        bio->init = 1;
 }
 
-int
+MONO_API int
 mono_btls_bio_read (BIO *bio, void *data, int len)
 {
        return BIO_read (bio, data, len);
 }
 
-int
+MONO_API int
 mono_btls_bio_write (BIO *bio, const void *data, int len)
 {
        return BIO_write (bio, data, len);
 }
 
-int
+MONO_API int
 mono_btls_bio_flush (BIO *bio)
 {
        return BIO_flush (bio);
 }
 
-int
+MONO_API int
 mono_btls_bio_indent (BIO *bio, unsigned indent, unsigned max_indent)
 {
        return BIO_indent (bio, indent, max_indent);
 }
 
-int
+MONO_API int
 mono_btls_bio_hexdump (BIO *bio, const uint8_t *data, int len, unsigned indent)
 {
        return BIO_hexdump (bio, data, len, indent);
 }
 
-void
+MONO_API void
 mono_btls_bio_print_errors (BIO *bio)
 {
        BIO_print_errors (bio);
 }
 
-void
+MONO_API void
 mono_btls_bio_free (BIO *bio)
 {
        BIO_free (bio);
 }
 
-BIO *
+MONO_API BIO *
 mono_btls_bio_mem_new (void)
 {
        return BIO_new (BIO_s_mem ());
 }
 
-int
+MONO_API int
 mono_btls_bio_mem_get_data (BIO *bio, void **data)
 {
        return (int)BIO_get_mem_data (bio, (char**)data);
index 8ed950c7e66b7c2229dd24c0cc8bf8ec6b17e266..75252162a2a24392761f5ae7ec98ea0ce43a713a 100644 (file)
@@ -7,27 +7,28 @@
 //
 
 #include <btls-error.h>
+#include <btls-util.h>
 #include <assert.h>
 
-int
+MONO_API int
 mono_btls_error_peek_error (void)
 {
        return ERR_peek_error ();
 }
 
-int
+MONO_API int
 mono_btls_error_get_error (void)
 {
        return ERR_get_error ();
 }
 
-void
+MONO_API void
 mono_btls_error_clear_error (void)
 {
        ERR_clear_error ();
 }
 
-void
+MONO_API void
 mono_btls_error_get_error_string_n (int error, char *buf, int len)
 {
        ERR_error_string_n (error, buf, len);
index 756f9c75649a4b1c0fbb8f2ddd5d7398004f97ce..65909a527d9944e0aa27ca42b05505552ca4584d 100644 (file)
@@ -8,31 +8,31 @@
 
 #include <btls-key.h>
 
-void
+MONO_API void
 mono_btls_key_free (EVP_PKEY *pkey)
 {
        EVP_PKEY_free (pkey);
 }
 
-EVP_PKEY *
+MONO_API EVP_PKEY *
 mono_btls_key_up_ref (EVP_PKEY *pkey)
 {
        return EVP_PKEY_up_ref (pkey);
 }
 
-int
+MONO_API int
 mono_btls_key_get_bits (EVP_PKEY *pkey)
 {
        return EVP_PKEY_bits (pkey);
 }
 
-int
+MONO_API int
 mono_btls_key_is_rsa (EVP_PKEY *pkey)
 {
        return pkey->type == EVP_PKEY_RSA;
 }
 
-int
+MONO_API int
 mono_btls_key_get_bytes (EVP_PKEY *pkey, uint8_t **buffer, int *size, int include_private_bits)
 {
        size_t len;
index d037ddb89107733b14fed9b897122a821364c3e0..6e1a79e60bd26fbdded10fab416ddd2a9e51318d 100644 (file)
@@ -15,7 +15,7 @@ struct MonoBtlsPkcs12 {
        CRYPTO_refcount_t references;
 };
 
-MonoBtlsPkcs12 *
+MONO_API MonoBtlsPkcs12 *
 mono_btls_pkcs12_new (void)
 {
        MonoBtlsPkcs12 *pkcs12 = (MonoBtlsPkcs12 *)OPENSSL_malloc (sizeof (MonoBtlsPkcs12));
@@ -28,13 +28,13 @@ mono_btls_pkcs12_new (void)
        return pkcs12;
 }
 
-int
+MONO_API int
 mono_btls_pkcs12_get_count (MonoBtlsPkcs12 *pkcs12)
 {
        return (int)sk_X509_num (pkcs12->certs);
 }
 
-X509 *
+MONO_API X509 *
 mono_btls_pkcs12_get_cert (MonoBtlsPkcs12 *pkcs12, int index)
 {
        X509 *cert;
@@ -47,13 +47,13 @@ mono_btls_pkcs12_get_cert (MonoBtlsPkcs12 *pkcs12, int index)
        return cert;
 }
 
-STACK_OF(X509) *
+MONO_API STACK_OF(X509) *
 mono_btls_pkcs12_get_certs (MonoBtlsPkcs12 *pkcs12)
 {
        return pkcs12->certs;
 }
 
-int
+MONO_API int
 mono_btls_pkcs12_free (MonoBtlsPkcs12 *pkcs12)
 {
        if (!CRYPTO_refcount_dec_and_test_zero (&pkcs12->references))
@@ -64,21 +64,21 @@ mono_btls_pkcs12_free (MonoBtlsPkcs12 *pkcs12)
        return 1;
 }
 
-MonoBtlsPkcs12 *
+MONO_API MonoBtlsPkcs12 *
 mono_btls_pkcs12_up_ref (MonoBtlsPkcs12 *pkcs12)
 {
        CRYPTO_refcount_inc (&pkcs12->references);
        return pkcs12;
 }
 
-void
+MONO_API void
 mono_btls_pkcs12_add_cert (MonoBtlsPkcs12 *pkcs12, X509 *x509)
 {
        X509_up_ref (x509);
        sk_X509_push (pkcs12->certs, x509);
 }
 
-int
+MONO_API int
 mono_btls_pkcs12_import (MonoBtlsPkcs12 *pkcs12, const void *data, int len, const void *password)
 {
        CBS cbs;
@@ -86,13 +86,13 @@ mono_btls_pkcs12_import (MonoBtlsPkcs12 *pkcs12, const void *data, int len, cons
        return PKCS12_get_key_and_certs (&pkcs12->private_key, pkcs12->certs, &cbs, password);
 }
 
-int
+MONO_API int
 mono_btls_pkcs12_has_private_key (MonoBtlsPkcs12 *pkcs12)
 {
        return pkcs12->private_key != NULL;
 }
 
-EVP_PKEY *
+MONO_API EVP_PKEY *
 mono_btls_pkcs12_get_private_key (MonoBtlsPkcs12 *pkcs12)
 {
        if (!pkcs12->private_key)
index ddbb02f5517e13d2b34416d485b82df69e0a8077..1f9d43c536e790af0c3c5840bd1e5037b468d913 100644 (file)
@@ -31,13 +31,13 @@ mono_btls_ssl_ctx_debug_printf (ptr, "%s:%d:%s(): " fmt, __FILE__, __LINE__, \
 
 void ssl_cipher_preference_list_free (struct ssl_cipher_preference_list_st *cipher_list);
 
-int
+MONO_API int
 mono_btls_ssl_ctx_is_debug_enabled (MonoBtlsSslCtx *ctx)
 {
        return ctx->debug_bio != NULL;
 }
 
-int
+MONO_API int
 mono_btls_ssl_ctx_debug_printf (MonoBtlsSslCtx *ctx, const char *format, ...)
 {
        va_list args;
@@ -52,7 +52,7 @@ mono_btls_ssl_ctx_debug_printf (MonoBtlsSslCtx *ctx, const char *format, ...)
        return ret;
 }
 
-MonoBtlsSslCtx *
+MONO_API MonoBtlsSslCtx *
 mono_btls_ssl_ctx_new (void)
 {
        MonoBtlsSslCtx *ctx;
@@ -67,14 +67,14 @@ mono_btls_ssl_ctx_new (void)
        return ctx;
 }
 
-MonoBtlsSslCtx *
+MONO_API MonoBtlsSslCtx *
 mono_btls_ssl_ctx_up_ref (MonoBtlsSslCtx *ctx)
 {
        CRYPTO_refcount_inc (&ctx->references);
        return ctx;
 }
 
-int
+MONO_API int
 mono_btls_ssl_ctx_free (MonoBtlsSslCtx *ctx)
 {
        if (!CRYPTO_refcount_dec_and_test_zero (&ctx->references))
@@ -85,13 +85,13 @@ mono_btls_ssl_ctx_free (MonoBtlsSslCtx *ctx)
        return 1;
 }
 
-SSL_CTX *
+MONO_API SSL_CTX *
 mono_btls_ssl_ctx_get_ctx (MonoBtlsSslCtx *ctx)
 {
        return ctx->ctx;
 }
 
-void
+MONO_API void
 mono_btls_ssl_ctx_set_debug_bio (MonoBtlsSslCtx *ctx, BIO *debug_bio)
 {
        if (debug_bio)
@@ -100,7 +100,7 @@ mono_btls_ssl_ctx_set_debug_bio (MonoBtlsSslCtx *ctx, BIO *debug_bio)
                ctx->debug_bio = NULL;
 }
 
-void
+MONO_API void
 mono_btls_ssl_ctx_initialize (MonoBtlsSslCtx *ctx, void *instance)
 {
        ctx->instance = instance;
@@ -122,7 +122,7 @@ cert_verify_callback (X509_STORE_CTX *storeCtx, void *arg)
        return ret;
 }
 
-void
+MONO_API void
 mono_btls_ssl_ctx_set_cert_verify_callback (MonoBtlsSslCtx *ptr, MonoBtlsVerifyFunc func, int cert_required)
 {
        int mode;
@@ -151,32 +151,32 @@ cert_select_callback (SSL *ssl, void *arg)
        return ret;
 }
 
-void
+MONO_API void
 mono_btls_ssl_ctx_set_cert_select_callback (MonoBtlsSslCtx *ptr, MonoBtlsSelectFunc func)
 {
        ptr->select_func = func;
        SSL_CTX_set_cert_cb (ptr->ctx, cert_select_callback, ptr);
 }
 
-X509_STORE *
+MONO_API X509_STORE *
 mono_btls_ssl_ctx_peek_store (MonoBtlsSslCtx *ctx)
 {
        return SSL_CTX_get_cert_store (ctx->ctx);
 }
 
-void
+MONO_API void
 mono_btls_ssl_ctx_set_min_version (MonoBtlsSslCtx *ctx, int version)
 {
        SSL_CTX_set_min_version (ctx->ctx, version);
 }
 
-void
+MONO_API void
 mono_btls_ssl_ctx_set_max_version (MonoBtlsSslCtx *ctx, int version)
 {
        SSL_CTX_set_max_version (ctx->ctx, version);
 }
 
-int
+MONO_API int
 mono_btls_ssl_ctx_is_cipher_supported (MonoBtlsSslCtx *ctx, uint16_t value)
 {
        const SSL_CIPHER *cipher;
@@ -185,7 +185,7 @@ mono_btls_ssl_ctx_is_cipher_supported (MonoBtlsSslCtx *ctx, uint16_t value)
        return cipher != NULL;
 }
 
-int
+MONO_API int
 mono_btls_ssl_ctx_set_ciphers (MonoBtlsSslCtx *ctx, int count, const uint16_t *data,
                                   int allow_unsupported)
 {
@@ -247,7 +247,7 @@ err:
        return 0;
 }
 
-int
+MONO_API int
 mono_btls_ssl_ctx_set_verify_param (MonoBtlsSslCtx *ctx, const MonoBtlsX509VerifyParam *param)
 {
        return SSL_CTX_set1_param (ctx->ctx, mono_btls_x509_verify_param_peek_param (param));
index fa3e53d4cdf86cfa6de30b1c15802ca3c4ce2105..f18d6c19247d968557f054379b1a22e1d54b2571 100644 (file)
@@ -26,7 +26,7 @@ __func__, __VA_ARGS__); } while (0)
 
 STACK_OF(SSL_CIPHER) *ssl_bytes_to_cipher_list (SSL *s, const CBS *cbs);
 
-MonoBtlsSsl *
+MONO_API MonoBtlsSsl *
 mono_btls_ssl_new (MonoBtlsSslCtx *ctx)
 {
        MonoBtlsSsl *ptr;
@@ -41,7 +41,7 @@ mono_btls_ssl_new (MonoBtlsSslCtx *ctx)
        return ptr;
 }
 
-void
+MONO_API void
 mono_btls_ssl_destroy (MonoBtlsSsl *ptr)
 {
        mono_btls_ssl_close (ptr);
@@ -56,92 +56,92 @@ mono_btls_ssl_destroy (MonoBtlsSsl *ptr)
        free (ptr);
 }
 
-void
+MONO_API void
 mono_btls_ssl_close (MonoBtlsSsl *ptr)
 {
        ;
 }
 
-void
+MONO_API void
 mono_btls_ssl_set_bio (MonoBtlsSsl *ptr, BIO *bio)
 {
        BIO_up_ref (bio);
        SSL_set_bio (ptr->ssl, bio, bio);
 }
 
-void
+MONO_API void
 mono_btls_ssl_print_errors_cb (ERR_print_errors_callback_t callback, void *ctx)
 {
        ERR_print_errors_cb (callback, ctx);
 }
 
-int
+MONO_API int
 mono_btls_ssl_use_certificate (MonoBtlsSsl *ptr, X509 *x509)
 {
        return SSL_use_certificate (ptr->ssl, x509);
 }
 
-int
+MONO_API int
 mono_btls_ssl_use_private_key (MonoBtlsSsl *ptr, EVP_PKEY *key)
 {
        return SSL_use_PrivateKey (ptr->ssl, key);
 }
 
-int
+MONO_API int
 mono_btls_ssl_add_chain_certificate (MonoBtlsSsl *ptr, X509 *x509)
 {
        return SSL_add1_chain_cert (ptr->ssl, x509);
 }
 
-int
+MONO_API int
 mono_btls_ssl_accept (MonoBtlsSsl *ptr)
 {
        return SSL_accept (ptr->ssl);
 }
 
-int
+MONO_API int
 mono_btls_ssl_connect (MonoBtlsSsl *ptr)
 {
        return SSL_connect (ptr->ssl);
 }
 
-int
+MONO_API int
 mono_btls_ssl_handshake (MonoBtlsSsl *ptr)
 {
        return SSL_do_handshake (ptr->ssl);
 }
 
-int
+MONO_API int
 mono_btls_ssl_read (MonoBtlsSsl *ptr, void *buf, int count)
 {
        return SSL_read (ptr->ssl, buf, count);
 }
 
-int
+MONO_API int
 mono_btls_ssl_write (MonoBtlsSsl *ptr, void *buf, int count)
 {
        return SSL_write (ptr->ssl, buf, count);
 }
 
-int
+MONO_API int
 mono_btls_ssl_get_version (MonoBtlsSsl *ptr)
 {
        return SSL_version (ptr->ssl);
 }
 
-void
+MONO_API void
 mono_btls_ssl_set_min_version (MonoBtlsSsl *ptr, int version)
 {
        SSL_set_min_version (ptr->ssl, version);
 }
 
-void
+MONO_API void
 mono_btls_ssl_set_max_version (MonoBtlsSsl *ptr, int version)
 {
        SSL_set_max_version (ptr->ssl, version);
 }
 
-int
+MONO_API int
 mono_btls_ssl_get_cipher (MonoBtlsSsl *ptr)
 {
        const SSL_CIPHER *cipher;
@@ -152,13 +152,13 @@ mono_btls_ssl_get_cipher (MonoBtlsSsl *ptr)
        return (uint16_t)SSL_CIPHER_get_id (cipher);
 }
 
-int
+MONO_API int
 mono_btls_ssl_set_cipher_list (MonoBtlsSsl *ptr, const char *str)
 {
        return SSL_set_cipher_list(ptr->ssl, str);
 }
 
-int
+MONO_API int
 mono_btls_ssl_get_ciphers (MonoBtlsSsl *ptr, uint16_t **data)
 {
        STACK_OF(SSL_CIPHER) *ciphers;
@@ -184,25 +184,25 @@ mono_btls_ssl_get_ciphers (MonoBtlsSsl *ptr, uint16_t **data)
        return count;
 }
 
-X509 *
+MONO_API X509 *
 mono_btls_ssl_get_peer_certificate (MonoBtlsSsl *ptr)
 {
        return SSL_get_peer_certificate (ptr->ssl);
 }
 
-int
+MONO_API int
 mono_btls_ssl_get_error (MonoBtlsSsl *ptr, int ret_code)
 {
        return SSL_get_error (ptr->ssl, ret_code);
 }
 
-int
+MONO_API int
 mono_btls_ssl_set_verify_param (MonoBtlsSsl *ptr, const MonoBtlsX509VerifyParam *param)
 {
        return SSL_set1_param (ptr->ssl, mono_btls_x509_verify_param_peek_param (param));
 }
 
-int
+MONO_API int
 mono_btls_ssl_set_server_name (MonoBtlsSsl *ptr, const char *name)
 {
        return SSL_set_tlsext_host_name (ptr->ssl, name);
index d28763a0fd1277cef7cca4b6c9126481593d5f9d..824b101f34c50ed68b88fd0e804a050ed7add745 100644 (file)
@@ -17,7 +17,7 @@ extern time_t timegm (struct tm* const t);
 
 extern int asn1_generalizedtime_to_tm (struct tm *tm, const ASN1_GENERALIZEDTIME *d);
 
-void
+MONO_API void
 mono_btls_free (void *data)
 {
        OPENSSL_free (data);
index a77bfcd61d06e1a3c1528b7fb0d06388a97c55b2..525e619975075b353cf87ca15b5669e87cb2f06a 100644 (file)
 #include <string.h>
 #include <openssl/ssl.h>
 
+#ifndef MONO_API
+#if defined(_MSC_VER)
+
+#define MONO_API __declspec(dllexport)
+
+#else
+
+#ifdef __GNUC__
+#define MONO_API __attribute__ ((visibility ("default")))
+#else
+#define MONO_API
+#endif
+
+#endif
+#endif
+
 void
 mono_btls_free (void *data);
 
index 0584791dedf5f37d7c6c5feadfeec4fc1e9af7cd..5b7082ddb135f645fc74dd3a05197f70c7b1468a 100644 (file)
@@ -13,7 +13,7 @@ struct MonoBtlsX509Chain {
        CRYPTO_refcount_t references;
 };
 
-MonoBtlsX509Chain *
+MONO_API MonoBtlsX509Chain *
 mono_btls_x509_chain_new (void)
 {
        MonoBtlsX509Chain *chain = (MonoBtlsX509Chain *)OPENSSL_malloc (sizeof (MonoBtlsX509Chain));
@@ -26,7 +26,7 @@ mono_btls_x509_chain_new (void)
        return chain;
 }
 
-MonoBtlsX509Chain *
+MONO_API MonoBtlsX509Chain *
 mono_btls_x509_chain_from_certs (STACK_OF(X509) *certs)
 {
        MonoBtlsX509Chain *chain = (MonoBtlsX509Chain *)OPENSSL_malloc (sizeof (MonoBtlsX509Chain));
@@ -39,19 +39,19 @@ mono_btls_x509_chain_from_certs (STACK_OF(X509) *certs)
        return chain;
 }
 
-STACK_OF(X509) *
+MONO_API STACK_OF(X509) *
 mono_btls_x509_chain_peek_certs (MonoBtlsX509Chain *chain)
 {
        return chain->certs;
 }
 
-int
+MONO_API int
 mono_btls_x509_chain_get_count (MonoBtlsX509Chain *chain)
 {
        return (int)sk_X509_num(chain->certs);
 }
 
-X509 *
+MONO_API X509 *
 mono_btls_x509_chain_get_cert (MonoBtlsX509Chain *chain, int index)
 {
        X509 *cert;
@@ -64,13 +64,13 @@ mono_btls_x509_chain_get_cert (MonoBtlsX509Chain *chain, int index)
        return cert;
 }
 
-STACK_OF(X509) *
+MONO_API STACK_OF(X509) *
 mono_btls_x509_chain_get_certs (MonoBtlsX509Chain *chain)
 {
        return chain->certs;
 }
 
-int
+MONO_API int
 mono_btls_x509_chain_free (MonoBtlsX509Chain *chain)
 {
        if (!CRYPTO_refcount_dec_and_test_zero(&chain->references))
@@ -81,14 +81,14 @@ mono_btls_x509_chain_free (MonoBtlsX509Chain *chain)
        return 1;
 }
 
-MonoBtlsX509Chain *
+MONO_API MonoBtlsX509Chain *
 mono_btls_x509_chain_up_ref (MonoBtlsX509Chain *chain)
 {
        CRYPTO_refcount_inc(&chain->references);
        return chain;
 }
 
-void
+MONO_API void
 mono_btls_x509_chain_add_cert (MonoBtlsX509Chain *chain, X509 *x509)
 {
        X509_up_ref(x509);
index ccd3e2873145e4f613327cafa3ceac68b0b8822a..b4e861234cac0ed758b794fd3089de0f08689056 100644 (file)
@@ -14,7 +14,7 @@ struct MonoBtlsX509Crl {
        CRYPTO_refcount_t references;
 };
 
-MonoBtlsX509Crl *
+MONO_API MonoBtlsX509Crl *
 mono_btls_x509_crl_from_data (const void *buf, int len, MonoBtlsX509Format format)
 {
        MonoBtlsX509Crl *crl;
@@ -43,14 +43,14 @@ mono_btls_x509_crl_from_data (const void *buf, int len, MonoBtlsX509Format forma
        return crl;
 }
 
-MonoBtlsX509Crl *
+MONO_API MonoBtlsX509Crl *
 mono_btls_x509_crl_ref (MonoBtlsX509Crl *crl)
 {
        CRYPTO_refcount_inc (&crl->references);
        return crl;
 }
 
-int
+MONO_API int
 mono_btls_x509_crl_free (MonoBtlsX509Crl *crl)
 {
        if (!CRYPTO_refcount_dec_and_test_zero (&crl->references))
@@ -61,7 +61,7 @@ mono_btls_x509_crl_free (MonoBtlsX509Crl *crl)
        return 1;
 }
 
-MonoBtlsX509Revoked *
+MONO_API MonoBtlsX509Revoked *
 mono_btls_x509_crl_get_by_cert (MonoBtlsX509Crl *crl, X509 *x509)
 {
        X509_REVOKED *revoked;
@@ -77,7 +77,7 @@ mono_btls_x509_crl_get_by_cert (MonoBtlsX509Crl *crl, X509 *x509)
        return mono_btls_x509_revoked_new (crl, revoked);
 }
 
-MonoBtlsX509Revoked *
+MONO_API MonoBtlsX509Revoked *
 mono_btls_x509_crl_get_by_serial (MonoBtlsX509Crl *crl, void *serial, int len)
 {
        ASN1_INTEGER si;
@@ -98,7 +98,7 @@ mono_btls_x509_crl_get_by_serial (MonoBtlsX509Crl *crl, void *serial, int len)
        return mono_btls_x509_revoked_new (crl, revoked);
 }
 
-int
+MONO_API int
 mono_btls_x509_crl_get_revoked_count (MonoBtlsX509Crl *crl)
 {
        STACK_OF(X509_REVOKED) *stack;
@@ -107,7 +107,7 @@ mono_btls_x509_crl_get_revoked_count (MonoBtlsX509Crl *crl)
        return (int)sk_X509_REVOKED_num (stack);
 }
 
-MonoBtlsX509Revoked *
+MONO_API MonoBtlsX509Revoked *
 mono_btls_x509_crl_get_revoked (MonoBtlsX509Crl *crl, int index)
 {
        STACK_OF(X509_REVOKED) *stack;
@@ -124,25 +124,25 @@ mono_btls_x509_crl_get_revoked (MonoBtlsX509Crl *crl, int index)
        return mono_btls_x509_revoked_new (crl, revoked);
 }
 
-long
+MONO_API long
 mono_btls_x509_crl_get_last_update (MonoBtlsX509Crl *crl)
 {
        return mono_btls_util_asn1_time_to_ticks (X509_CRL_get_lastUpdate (crl->crl));
 }
 
-long
+MONO_API long
 mono_btls_x509_crl_get_next_update (MonoBtlsX509Crl *crl)
 {
        return mono_btls_util_asn1_time_to_ticks (X509_CRL_get_nextUpdate (crl->crl));
 }
 
-long
+MONO_API long
 mono_btls_x509_crl_get_version (MonoBtlsX509Crl *crl)
 {
        return X509_CRL_get_version (crl->crl);
 }
 
-MonoBtlsX509Name *
+MONO_API MonoBtlsX509Name *
 mono_btls_x509_crl_get_issuer (MonoBtlsX509Crl *crl)
 {
        return mono_btls_x509_name_copy (X509_CRL_get_issuer (crl->crl));
index cce736894696f50e2ed0b24d789c447890994c75..1d8f7d3ee51f081d4674000fc9160995939a80c3 100644 (file)
@@ -29,7 +29,7 @@ struct MonoBtlsX509LookupMono {
        MonoLookup *lookup;
 };
 
-MonoBtlsX509LookupMono *
+MONO_API MonoBtlsX509LookupMono *
 mono_btls_x509_lookup_mono_new (void)
 {
        MonoBtlsX509LookupMono *mono;
@@ -42,7 +42,7 @@ mono_btls_x509_lookup_mono_new (void)
        return mono;
 }
 
-void
+MONO_API void
 mono_btls_x509_lookup_mono_init (MonoBtlsX509LookupMono *mono, const void *instance,
                                 MonoBtlsX509LookupMono_BySubject by_subject_func)
 {
@@ -85,7 +85,7 @@ mono_lookup_uninstall (MonoBtlsX509LookupMono *mono)
        return 0;
 }
 
-int
+MONO_API int
 mono_btls_x509_lookup_mono_free (MonoBtlsX509LookupMono *mono)
 {
        mono->instance = NULL;
@@ -211,13 +211,13 @@ static X509_LOOKUP_METHOD mono_lookup_method = {
        NULL,                           /* get_by_alias */
 };
 
-X509_LOOKUP_METHOD *
+MONO_API X509_LOOKUP_METHOD *
 mono_btls_x509_lookup_mono_method (void)
 {
        return &mono_lookup_method;
 }
 
-int
+MONO_API int
 mono_btls_x509_lookup_add_mono (MonoBtlsX509Lookup *lookup, MonoBtlsX509LookupMono *mono)
 {
        if (mono_btls_x509_lookup_get_type (lookup) != MONO_BTLS_X509_LOOKUP_TYPE_MONO)
index 1cfc1741a363736559a345dee6b04cbb2db9b8b3..567d19c237aef062c42788196b7b6aed81941f1c 100644 (file)
@@ -32,7 +32,7 @@ get_lookup_method (MonoBtlsX509LookupType type)
        }
 }
 
-MonoBtlsX509Lookup *
+MONO_API MonoBtlsX509Lookup *
 mono_btls_x509_lookup_new (MonoBtlsX509Store *store, MonoBtlsX509LookupType type)
 {
        MonoBtlsX509Lookup *lookup;
@@ -61,26 +61,26 @@ mono_btls_x509_lookup_new (MonoBtlsX509Store *store, MonoBtlsX509LookupType type
        return lookup;
 }
 
-int
+MONO_API int
 mono_btls_x509_lookup_load_file (MonoBtlsX509Lookup *lookup, const char *file, MonoBtlsX509FileType type)
 {
        return X509_LOOKUP_load_file (lookup->lookup, file, type);
 }
 
-int
+MONO_API int
 mono_btls_x509_lookup_add_dir (MonoBtlsX509Lookup *lookup, const char *dir, MonoBtlsX509FileType type)
 {
        return X509_LOOKUP_add_dir (lookup->lookup, dir, type);
 }
 
-MonoBtlsX509Lookup *
+MONO_API MonoBtlsX509Lookup *
 mono_btls_x509_lookup_up_ref (MonoBtlsX509Lookup *lookup)
 {
        CRYPTO_refcount_inc (&lookup->references);
        return lookup;
 }
 
-int
+MONO_API int
 mono_btls_x509_lookup_free (MonoBtlsX509Lookup *lookup)
 {
        if (!CRYPTO_refcount_dec_and_test_zero (&lookup->references))
@@ -101,31 +101,31 @@ mono_btls_x509_lookup_free (MonoBtlsX509Lookup *lookup)
        return 1;
 }
 
-int
+MONO_API int
 mono_btls_x509_lookup_init (MonoBtlsX509Lookup *lookup)
 {
        return X509_LOOKUP_init (lookup->lookup);
 }
 
-int
+MONO_API int
 mono_btls_x509_lookup_shutdown (MonoBtlsX509Lookup *lookup)
 {
        return X509_LOOKUP_shutdown (lookup->lookup);
 }
 
-MonoBtlsX509LookupType
+MONO_API MonoBtlsX509LookupType
 mono_btls_x509_lookup_get_type (MonoBtlsX509Lookup *lookup)
 {
        return lookup->type;
 }
 
-X509_LOOKUP *
+MONO_API X509_LOOKUP *
 mono_btls_x509_lookup_peek_lookup (MonoBtlsX509Lookup *lookup)
 {
        return lookup->lookup;
 }
 
-X509 *
+MONO_API X509 *
 mono_btls_x509_lookup_by_subject (MonoBtlsX509Lookup *lookup, MonoBtlsX509Name *name)
 {
        X509_OBJECT obj;
@@ -142,7 +142,7 @@ mono_btls_x509_lookup_by_subject (MonoBtlsX509Lookup *lookup, MonoBtlsX509Name *
        return x509;
 }
 
-X509 *
+MONO_API X509 *
 mono_btls_x509_lookup_by_fingerprint (MonoBtlsX509Lookup *lookup, unsigned char *bytes, int len)
 {
        X509_OBJECT obj;
index 7a40f75b53bd2b8a720d51886a72fb146323afb8..782743f875259bfe50b4c4d3a8a6e91ea36d2f19 100644 (file)
@@ -13,7 +13,7 @@ struct MonoBtlsX509Name {
        X509_NAME *name;
 };
 
-MonoBtlsX509Name *
+MONO_API MonoBtlsX509Name *
 mono_btls_x509_name_from_name (X509_NAME *xn)
 {
        MonoBtlsX509Name *name;
@@ -27,7 +27,7 @@ mono_btls_x509_name_from_name (X509_NAME *xn)
        return name;
 }
 
-MonoBtlsX509Name *
+MONO_API MonoBtlsX509Name *
 mono_btls_x509_name_copy (X509_NAME *xn)
 {
        MonoBtlsX509Name *name;
@@ -42,7 +42,7 @@ mono_btls_x509_name_copy (X509_NAME *xn)
        return name;
 }
 
-void
+MONO_API void
 mono_btls_x509_name_free (MonoBtlsX509Name *name)
 {
        if (name->owns) {
@@ -54,19 +54,19 @@ mono_btls_x509_name_free (MonoBtlsX509Name *name)
        OPENSSL_free(name);
 }
 
-X509_NAME *
+MONO_API X509_NAME *
 mono_btls_x509_name_peek_name (MonoBtlsX509Name *name)
 {
        return name->name;
 }
 
-int
+MONO_API int
 mono_btls_x509_name_print_bio (MonoBtlsX509Name *name, BIO *bio)
 {
        return X509_NAME_print_ex (bio, name->name, 0, ASN1_STRFLGS_RFC2253 | XN_FLAG_FN_SN | XN_FLAG_SEP_CPLUS_SPC | XN_FLAG_DN_REV);
 }
 
-int
+MONO_API int
 mono_btls_x509_name_get_raw_data (MonoBtlsX509Name *name, void **buffer, int use_canon_enc)
 {
        int len;
@@ -91,7 +91,7 @@ mono_btls_x509_name_get_raw_data (MonoBtlsX509Name *name, void **buffer, int use
        return len;
 }
 
-MonoBtlsX509Name *
+MONO_API MonoBtlsX509Name *
 mono_btls_x509_name_from_data (const void *data, int len, int use_canon_enc)
 {
        MonoBtlsX509Name *name;
@@ -146,26 +146,26 @@ mono_btls_x509_name_from_data (const void *data, int len, int use_canon_enc)
        return name;
 }
 
-int
+MONO_API int
 mono_btls_x509_name_print_string (MonoBtlsX509Name *name, char *buffer, int size)
 {
        *buffer = 0;
        return X509_NAME_oneline (name->name, buffer, size) != NULL;
 }
 
-long
+MONO_API long
 mono_btls_x509_name_hash (MonoBtlsX509Name *name)
 {
        return X509_NAME_hash (name->name);
 }
 
-long
+MONO_API long
 mono_btls_x509_name_hash_old (MonoBtlsX509Name *name)
 {
        return X509_NAME_hash_old (name->name);
 }
 
-int
+MONO_API int
 mono_btls_x509_name_get_entry_count (MonoBtlsX509Name *name)
 {
        return X509_NAME_entry_count (name->name);
@@ -210,7 +210,7 @@ nid2mono (int nid)
        }
 }
 
-MonoBtlsX509NameEntryType
+MONO_API MonoBtlsX509NameEntryType
 mono_btls_x509_name_get_entry_type (MonoBtlsX509Name *name, int index)
 {
        X509_NAME_ENTRY *entry;
@@ -230,7 +230,7 @@ mono_btls_x509_name_get_entry_type (MonoBtlsX509Name *name, int index)
        return nid2mono (OBJ_obj2nid (obj));
 }
 
-int
+MONO_API int
 mono_btls_x509_name_get_entry_oid (MonoBtlsX509Name *name, int index, char *buffer, int size)
 {
        X509_NAME_ENTRY *entry;
@@ -250,7 +250,7 @@ mono_btls_x509_name_get_entry_oid (MonoBtlsX509Name *name, int index, char *buff
        return OBJ_obj2txt (buffer, size, obj, 1);
 }
 
-int
+MONO_API int
 mono_btls_x509_name_get_entry_oid_data (MonoBtlsX509Name *name, int index, const void **data)
 {
        X509_NAME_ENTRY *entry;
@@ -271,7 +271,7 @@ mono_btls_x509_name_get_entry_oid_data (MonoBtlsX509Name *name, int index, const
        return obj->length;
 }
 
-int
+MONO_API int
 mono_btls_x509_name_get_entry_value (MonoBtlsX509Name *name, int index, int *tag, unsigned char **str)
 {
        X509_NAME_ENTRY *entry;
index e6fb4b0035fcc2a2b4128e13c3b600152971c281..d0540e6ca10f872f868719aee9007e493739a325 100644 (file)
@@ -13,7 +13,7 @@ struct MonoBtlsX509Revoked {
        X509_REVOKED *revoked;
 };
 
-MonoBtlsX509Revoked *
+MONO_API MonoBtlsX509Revoked *
 mono_btls_x509_revoked_new (MonoBtlsX509Crl *owner, X509_REVOKED *revoked)
 {
        MonoBtlsX509Revoked *instance;
@@ -26,14 +26,14 @@ mono_btls_x509_revoked_new (MonoBtlsX509Crl *owner, X509_REVOKED *revoked)
        return instance;
 }
 
-void
+MONO_API void
 mono_btls_x509_revoked_free (MonoBtlsX509Revoked *revoked)
 {
        mono_btls_x509_crl_free (revoked->owner);
        OPENSSL_free (revoked);
 }
 
-int
+MONO_API int
 mono_btls_x509_revoked_get_serial_number (MonoBtlsX509Revoked *revoked, char *buffer, int size)
 {
        ASN1_INTEGER *serial;
@@ -46,7 +46,7 @@ mono_btls_x509_revoked_get_serial_number (MonoBtlsX509Revoked *revoked, char *bu
        return serial->length;
 }
 
-long
+MONO_API long
 mono_btls_x509_revoked_get_revocation_date (MonoBtlsX509Revoked *revoked)
 {
        ASN1_TIME *date;
@@ -58,13 +58,13 @@ mono_btls_x509_revoked_get_revocation_date (MonoBtlsX509Revoked *revoked)
        return mono_btls_util_asn1_time_to_ticks (date);
 }
 
-int
+MONO_API int
 mono_btls_x509_revoked_get_reason (MonoBtlsX509Revoked *revoked)
 {
        return revoked->revoked->reason;
 }
 
-int
+MONO_API int
 mono_btls_x509_revoked_get_sequence (MonoBtlsX509Revoked *revoked)
 {
        return revoked->revoked->sequence;
index f023e31a8485464cbb7139fe3e4e5795a873126b..8bbb732ac7325b95550c0d1521d33500705cc003 100644 (file)
@@ -16,7 +16,7 @@ struct MonoBtlsX509StoreCtx {
        MonoBtlsX509Chain *chain;
 };
 
-MonoBtlsX509StoreCtx *
+MONO_API MonoBtlsX509StoreCtx *
 mono_btls_x509_store_ctx_from_ptr (X509_STORE_CTX *ptr)
 {
        MonoBtlsX509StoreCtx *ctx;
@@ -31,7 +31,7 @@ mono_btls_x509_store_ctx_from_ptr (X509_STORE_CTX *ptr)
        return ctx;
 }
 
-MonoBtlsX509StoreCtx *
+MONO_API MonoBtlsX509StoreCtx *
 mono_btls_x509_store_ctx_new (void)
 {
        MonoBtlsX509StoreCtx *ctx;
@@ -47,14 +47,14 @@ mono_btls_x509_store_ctx_new (void)
        return ctx;
 }
 
-MonoBtlsX509StoreCtx *
+MONO_API MonoBtlsX509StoreCtx *
 mono_btls_x509_store_ctx_up_ref (MonoBtlsX509StoreCtx *ctx)
 {
        CRYPTO_refcount_inc (&ctx->references);
        return ctx;
 }
 
-int
+MONO_API int
 mono_btls_x509_store_ctx_free (MonoBtlsX509StoreCtx *ctx)
 {
        if (!CRYPTO_refcount_dec_and_test_zero (&ctx->references))
@@ -77,7 +77,7 @@ mono_btls_x509_store_ctx_free (MonoBtlsX509StoreCtx *ctx)
        return 1;
 }
 
-int
+MONO_API int
 mono_btls_x509_store_ctx_get_error (MonoBtlsX509StoreCtx *ctx, const char **error_string)
 {
        int error;
@@ -88,13 +88,13 @@ mono_btls_x509_store_ctx_get_error (MonoBtlsX509StoreCtx *ctx, const char **erro
        return error;
 }
 
-int
+MONO_API int
 mono_btls_x509_store_ctx_get_error_depth (MonoBtlsX509StoreCtx *ctx)
 {
        return X509_STORE_CTX_get_error_depth (ctx->ctx);
 }
 
-MonoBtlsX509Chain *
+MONO_API MonoBtlsX509Chain *
 mono_btls_x509_store_ctx_get_chain (MonoBtlsX509StoreCtx *ctx)
 {
        STACK_OF(X509) *certs;
@@ -106,7 +106,7 @@ mono_btls_x509_store_ctx_get_chain (MonoBtlsX509StoreCtx *ctx)
        return mono_btls_x509_chain_from_certs (certs);
 }
 
-MonoBtlsX509Chain *
+MONO_API MonoBtlsX509Chain *
 mono_btls_x509_store_ctx_get_untrusted (MonoBtlsX509StoreCtx *ctx)
 {
        STACK_OF(X509) *untrusted;
@@ -124,7 +124,7 @@ mono_btls_x509_store_ctx_get_untrusted (MonoBtlsX509StoreCtx *ctx)
        return mono_btls_x509_chain_from_certs (untrusted);
 }
 
-int
+MONO_API int
 mono_btls_x509_store_ctx_init (MonoBtlsX509StoreCtx *ctx,
                                   MonoBtlsX509Store *store, MonoBtlsX509Chain *chain)
 {
@@ -151,19 +151,19 @@ mono_btls_x509_store_ctx_init (MonoBtlsX509StoreCtx *ctx,
        return 1;
 }
 
-int
+MONO_API int
 mono_btls_x509_store_ctx_set_param (MonoBtlsX509StoreCtx *ctx, MonoBtlsX509VerifyParam *param)
 {
        return X509_VERIFY_PARAM_set1 (X509_STORE_CTX_get0_param (ctx->ctx), mono_btls_x509_verify_param_peek_param (param));
 }
 
-int
+MONO_API int
 mono_btls_x509_store_ctx_verify_cert (MonoBtlsX509StoreCtx *ctx)
 {
        return X509_verify_cert (ctx->ctx);
 }
 
-X509 *
+MONO_API X509 *
 mono_btls_x509_store_ctx_get_by_subject (MonoBtlsX509StoreCtx *ctx, MonoBtlsX509Name *name)
 {
        X509_OBJECT obj;
@@ -180,7 +180,7 @@ mono_btls_x509_store_ctx_get_by_subject (MonoBtlsX509StoreCtx *ctx, MonoBtlsX509
        return x509;
 }
 
-X509 *
+MONO_API X509 *
 mono_btls_x509_store_ctx_get_current_cert (MonoBtlsX509StoreCtx *ctx)
 {
        X509 *x509 = X509_STORE_CTX_get_current_cert (ctx->ctx);
@@ -189,7 +189,7 @@ mono_btls_x509_store_ctx_get_current_cert (MonoBtlsX509StoreCtx *ctx)
        return X509_up_ref (x509);
 }
 
-X509 *
+MONO_API X509 *
 mono_btls_x509_store_ctx_get_current_issuer (MonoBtlsX509StoreCtx *ctx)
 {
        X509 *x509 = X509_STORE_CTX_get0_current_issuer (ctx->ctx);
@@ -198,7 +198,7 @@ mono_btls_x509_store_ctx_get_current_issuer (MonoBtlsX509StoreCtx *ctx)
        return X509_up_ref (x509);
 }
 
-MonoBtlsX509VerifyParam *
+MONO_API MonoBtlsX509VerifyParam *
 mono_btls_x509_store_ctx_get_verify_param (MonoBtlsX509StoreCtx *ctx)
 {
        X509_VERIFY_PARAM *param;
@@ -210,8 +210,8 @@ mono_btls_x509_store_ctx_get_verify_param (MonoBtlsX509StoreCtx *ctx)
        return mono_btls_x509_verify_param_from_store_ctx (ctx, param);
 }
 
-int
+MONO_API int
 mono_btls_x509_store_ctx_get_foo (MonoBtlsX509StoreCtx *ctx)
 {
        return 0;
-}
\ No newline at end of file
+}
index f2c826e11f4be867c81ef1c49940733bc79867ea..3534739a6ee72b352b48c063646413dbb4fd59c6 100644 (file)
@@ -13,7 +13,7 @@ struct MonoBtlsX509Store {
        CRYPTO_refcount_t references;
 };
 
-MonoBtlsX509Store *
+MONO_API MonoBtlsX509Store *
 mono_btls_x509_store_from_store (X509_STORE *ctx)
 {
        MonoBtlsX509Store *store;
@@ -29,13 +29,13 @@ mono_btls_x509_store_from_store (X509_STORE *ctx)
        return store;
 }
 
-MonoBtlsX509Store *
+MONO_API MonoBtlsX509Store *
 mono_btls_x509_store_from_ctx (X509_STORE_CTX *ctx)
 {
        return mono_btls_x509_store_from_store (ctx->ctx);
 }
 
-MonoBtlsX509Store *
+MONO_API MonoBtlsX509Store *
 mono_btls_x509_store_new (void)
 {
        MonoBtlsX509Store *store;
@@ -50,20 +50,20 @@ mono_btls_x509_store_new (void)
        return store;
 }
 
-X509_STORE *
+MONO_API X509_STORE *
 mono_btls_x509_store_peek_store (MonoBtlsX509Store *store)
 {
        return store->store;
 }
 
-MonoBtlsX509Store *
+MONO_API MonoBtlsX509Store *
 mono_btls_x509_store_from_ssl_ctx (MonoBtlsSslCtx *ctx)
 {
        X509_STORE *store = mono_btls_ssl_ctx_peek_store (ctx);
        return mono_btls_x509_store_from_store (store);
 }
 
-int
+MONO_API int
 mono_btls_x509_store_free (MonoBtlsX509Store *store)
 {
        if (!CRYPTO_refcount_dec_and_test_zero(&store->references))
@@ -77,32 +77,32 @@ mono_btls_x509_store_free (MonoBtlsX509Store *store)
        return 1;
 }
 
-MonoBtlsX509Store *
+MONO_API MonoBtlsX509Store *
 mono_btls_x509_store_up_ref (MonoBtlsX509Store *store)
 {
        CRYPTO_refcount_inc (&store->references);
        return store;
 }
 
-int
+MONO_API int
 mono_btls_x509_store_add_cert (MonoBtlsX509Store *store, X509 *cert)
 {
        return X509_STORE_add_cert (store->store, cert);
 }
 
-int
+MONO_API int
 mono_btls_x509_store_load_locations (MonoBtlsX509Store *store, const char *file, const char *path)
 {
        return X509_STORE_load_locations (store->store, file, path);
 }
 
-int
+MONO_API int
 mono_btls_x509_store_set_default_paths (MonoBtlsX509Store *store)
 {
        return X509_STORE_set_default_paths (store->store);
 }
 
-int
+MONO_API int
 mono_btls_x509_store_get_count (MonoBtlsX509Store *store)
 {
        return (int)sk_X509_OBJECT_num (store->store->objs);
index 643fdcd43d2ce569385310db48bee7f2604fea7f..5ac8bdbb099c574de77c2cef4c7831829a107271 100644 (file)
@@ -15,7 +15,7 @@ struct MonoBtlsX509VerifyParam {
        X509_VERIFY_PARAM *param;
 };
 
-MonoBtlsX509VerifyParam *
+MONO_API MonoBtlsX509VerifyParam *
 mono_btls_x509_verify_param_new (void)
 {
        MonoBtlsX509VerifyParam *param;
@@ -29,7 +29,7 @@ mono_btls_x509_verify_param_new (void)
        return param;
 }
 
-MonoBtlsX509VerifyParam *
+MONO_API MonoBtlsX509VerifyParam *
 mono_btls_x509_verify_param_from_store_ctx (MonoBtlsX509StoreCtx *ctx, X509_VERIFY_PARAM *param)
 {
        MonoBtlsX509VerifyParam *instance;
@@ -43,7 +43,7 @@ mono_btls_x509_verify_param_from_store_ctx (MonoBtlsX509StoreCtx *ctx, X509_VERI
        return instance;
 }
 
-MonoBtlsX509VerifyParam *
+MONO_API MonoBtlsX509VerifyParam *
 mono_btls_x509_verify_param_copy (const MonoBtlsX509VerifyParam *from)
 {
        MonoBtlsX509VerifyParam *param;
@@ -56,19 +56,19 @@ mono_btls_x509_verify_param_copy (const MonoBtlsX509VerifyParam *from)
        return param;
 }
 
-const X509_VERIFY_PARAM *
+MONO_API const X509_VERIFY_PARAM *
 mono_btls_x509_verify_param_peek_param (const MonoBtlsX509VerifyParam *param)
 {
        return param->param;
 }
 
-int
+MONO_API int
 mono_btls_x509_verify_param_can_modify (MonoBtlsX509VerifyParam *param)
 {
        return param->owns;
 }
 
-MonoBtlsX509VerifyParam *
+MONO_API MonoBtlsX509VerifyParam *
 mono_btls_x509_verify_param_lookup (const char *name)
 {
        MonoBtlsX509VerifyParam *param;
@@ -86,7 +86,7 @@ mono_btls_x509_verify_param_lookup (const char *name)
        return param;
 }
 
-void
+MONO_API void
 mono_btls_x509_verify_param_free (MonoBtlsX509VerifyParam *param)
 {
        if (param->owns) {
@@ -102,7 +102,7 @@ mono_btls_x509_verify_param_free (MonoBtlsX509VerifyParam *param)
        OPENSSL_free (param);
 }
 
-int
+MONO_API int
 mono_btls_x509_verify_param_set_name (MonoBtlsX509VerifyParam *param, const char *name)
 {
        if (!param->owns)
@@ -110,7 +110,7 @@ mono_btls_x509_verify_param_set_name (MonoBtlsX509VerifyParam *param, const char
        return X509_VERIFY_PARAM_set1_name (param->param, name);
 }
 
-int
+MONO_API int
 mono_btls_x509_verify_param_set_host (MonoBtlsX509VerifyParam *param, const char *host, int namelen)
 {
        if (!param->owns)
@@ -118,7 +118,7 @@ mono_btls_x509_verify_param_set_host (MonoBtlsX509VerifyParam *param, const char
        return X509_VERIFY_PARAM_set1_host (param->param, host, namelen);
 }
 
-int
+MONO_API int
 mono_btls_x509_verify_param_add_host (MonoBtlsX509VerifyParam *param, const char *host, int namelen)
 {
        if (!param->owns)
@@ -126,13 +126,13 @@ mono_btls_x509_verify_param_add_host (MonoBtlsX509VerifyParam *param, const char
        return X509_VERIFY_PARAM_set1_host (param->param, host, namelen);
 }
 
-unsigned long
+MONO_API unsigned long
 mono_btls_x509_verify_param_get_flags (MonoBtlsX509VerifyParam *param)
 {
        return X509_VERIFY_PARAM_get_flags (param->param);
 }
 
-int
+MONO_API int
 mono_btls_x509_verify_param_set_flags (MonoBtlsX509VerifyParam *param, unsigned long flags)
 {
        if (!param->owns)
@@ -140,7 +140,7 @@ mono_btls_x509_verify_param_set_flags (MonoBtlsX509VerifyParam *param, unsigned
        return X509_VERIFY_PARAM_set_flags (param->param, flags);
 }
 
-MonoBtlsX509VerifyFlags
+MONO_API MonoBtlsX509VerifyFlags
 mono_btls_x509_verify_param_get_mono_flags (MonoBtlsX509VerifyParam *param)
 {
        MonoBtlsX509VerifyFlags current;
@@ -162,7 +162,7 @@ mono_btls_x509_verify_param_get_mono_flags (MonoBtlsX509VerifyParam *param)
        return current;
 }
 
-int
+MONO_API int
 mono_btls_x509_verify_param_set_mono_flags (MonoBtlsX509VerifyParam *param, MonoBtlsX509VerifyFlags flags)
 {
        unsigned long current;
@@ -181,7 +181,7 @@ mono_btls_x509_verify_param_set_mono_flags (MonoBtlsX509VerifyParam *param, Mono
        return X509_VERIFY_PARAM_set_flags (param->param, current);
 }
 
-int
+MONO_API int
 mono_btls_x509_verify_param_set_purpose (MonoBtlsX509VerifyParam *param, MonoBtlsX509Purpose purpose)
 {
        if (!param->owns)
@@ -189,13 +189,13 @@ mono_btls_x509_verify_param_set_purpose (MonoBtlsX509VerifyParam *param, MonoBtl
        return X509_VERIFY_PARAM_set_purpose (param->param, purpose);
 }
 
-int
+MONO_API int
 mono_btls_x509_verify_param_get_depth (MonoBtlsX509VerifyParam *param)
 {
        return X509_VERIFY_PARAM_get_depth (param->param);
 }
 
-int
+MONO_API int
 mono_btls_x509_verify_param_set_depth (MonoBtlsX509VerifyParam *param, int depth)
 {
        if (!param->owns)
@@ -204,7 +204,7 @@ mono_btls_x509_verify_param_set_depth (MonoBtlsX509VerifyParam *param, int depth
        return 1;
 }
 
-int
+MONO_API int
 mono_btls_x509_verify_param_set_time (MonoBtlsX509VerifyParam *param, long time)
 {
        if (!param->owns)
@@ -213,7 +213,7 @@ mono_btls_x509_verify_param_set_time (MonoBtlsX509VerifyParam *param, long time)
        return 1;
 }
 
-char *
+MONO_API char *
 mono_btls_x509_verify_param_get_peername (MonoBtlsX509VerifyParam *param)
 {
        char *peer = X509_VERIFY_PARAM_get0_peername (param->param);
index bd3100885ccad1dfb4890f10f140ec29468a0e58..ae75f3ce9128b95cb9d53d34b7292a84b06b1e15 100644 (file)
@@ -10,7 +10,7 @@
 #include <openssl/x509v3.h>
 #include <openssl/pkcs12.h>
 
-X509 *
+MONO_API X509 *
 mono_btls_x509_from_data (const void *buf, int len, MonoBtlsX509Format format)
 {
        BIO *bio;
@@ -29,52 +29,52 @@ mono_btls_x509_from_data (const void *buf, int len, MonoBtlsX509Format format)
        return cert;
 }
 
-X509 *
+MONO_API X509 *
 mono_btls_x509_up_ref (X509 *x509)
 {
        X509_up_ref (x509);
        return x509;
 }
 
-void
+MONO_API void
 mono_btls_x509_free (X509 *x509)
 {
        X509_free (x509);
 }
 
-X509 *
+MONO_API X509 *
 mono_btls_x509_dup (X509 *x509)
 {
        return X509_dup (x509);
 }
 
-MonoBtlsX509Name *
+MONO_API MonoBtlsX509Name *
 mono_btls_x509_get_subject_name (X509 *x509)
 {
        return mono_btls_x509_name_copy (X509_get_subject_name (x509));
 }
 
-MonoBtlsX509Name *
+MONO_API MonoBtlsX509Name *
 mono_btls_x509_get_issuer_name (X509 *x509)
 {
        return mono_btls_x509_name_copy (X509_get_issuer_name (x509));
 }
 
-int
+MONO_API int
 mono_btls_x509_get_subject_name_string (X509 *name, char *buffer, int size)
 {
        *buffer = 0;
        return X509_NAME_oneline (X509_get_subject_name (name), buffer, size) != NULL;
 }
 
-int
+MONO_API int
 mono_btls_x509_get_issuer_name_string (X509 *name, char *buffer, int size)
 {
        *buffer = 0;
        return X509_NAME_oneline (X509_get_issuer_name (name), buffer, size) != NULL;
 }
 
-int
+MONO_API int
 mono_btls_x509_get_raw_data (X509 *x509, BIO *bio, MonoBtlsX509Format format)
 {
        switch (format) {
@@ -87,13 +87,13 @@ mono_btls_x509_get_raw_data (X509 *x509, BIO *bio, MonoBtlsX509Format format)
        }
 }
 
-int
+MONO_API int
 mono_btls_x509_cmp (const X509 *a, const X509 *b)
 {
        return X509_cmp (a, b);
 }
 
-int
+MONO_API int
 mono_btls_x509_get_hash (X509 *x509, const void **data)
 {
        X509_check_purpose (x509, -1, 0);
@@ -101,19 +101,19 @@ mono_btls_x509_get_hash (X509 *x509, const void **data)
        return SHA_DIGEST_LENGTH;
 }
 
-long
+MONO_API long
 mono_btls_x509_get_not_before (X509 *x509)
 {
        return mono_btls_util_asn1_time_to_ticks (X509_get_notBefore (x509));
 }
 
-long
+MONO_API long
 mono_btls_x509_get_not_after (X509 *x509)
 {
        return mono_btls_util_asn1_time_to_ticks (X509_get_notAfter (x509));
 }
 
-int
+MONO_API int
 mono_btls_x509_get_public_key (X509 *x509, BIO *bio)
 {
        EVP_PKEY *pkey;
@@ -135,7 +135,7 @@ mono_btls_x509_get_public_key (X509 *x509, BIO *bio)
        return ret;
 }
 
-int
+MONO_API int
 mono_btls_x509_get_serial_number (X509 *x509, char *buffer, int size, int mono_style)
 {
        ASN1_INTEGER *serial;
@@ -172,7 +172,7 @@ mono_btls_x509_get_serial_number (X509 *x509, char *buffer, int size, int mono_s
        return len;
 }
 
-int
+MONO_API int
 mono_btls_x509_get_public_key_algorithm (X509 *x509, char *buffer, int size)
 {
        X509_PUBKEY *pkey;
@@ -191,13 +191,13 @@ mono_btls_x509_get_public_key_algorithm (X509 *x509, char *buffer, int size)
        return OBJ_obj2txt (buffer, size, ppkalg, 1);
 }
 
-int
+MONO_API int
 mono_btls_x509_get_version (X509 *x509)
 {
        return (int)X509_get_version (x509) + 1;
 }
 
-int
+MONO_API int
 mono_btls_x509_get_signature_algorithm (X509 *x509, char *buffer, int size)
 {
        const ASN1_OBJECT *obj;
@@ -214,7 +214,7 @@ mono_btls_x509_get_signature_algorithm (X509 *x509, char *buffer, int size)
        return OBJ_obj2txt (buffer, size, obj, 1);
 }
 
-int
+MONO_API int
 mono_btls_x509_get_public_key_asn1 (X509 *x509, char *out_oid, int oid_len, uint8_t **buffer, int *size)
 {
        X509_PUBKEY *pkey;
@@ -251,7 +251,7 @@ mono_btls_x509_get_public_key_asn1 (X509 *x509, char *out_oid, int oid_len, uint
 
 }
 
-int
+MONO_API int
 mono_btls_x509_get_public_key_parameters (X509 *x509, char *out_oid, int oid_len, uint8_t **buffer, int *size)
 {
        X509_PUBKEY *pkey;
@@ -310,13 +310,13 @@ mono_btls_x509_get_public_key_parameters (X509 *x509, char *out_oid, int oid_len
        }
 }
 
-EVP_PKEY *
+MONO_API EVP_PKEY *
 mono_btls_x509_get_pubkey (X509 *x509)
 {
        return X509_get_pubkey (x509);
 }
 
-int
+MONO_API int
 mono_btls_x509_get_subject_key_identifier (X509 *x509, uint8_t **buffer, int *size)
 {
        ASN1_OCTET_STRING *skid;
@@ -340,7 +340,7 @@ mono_btls_x509_get_subject_key_identifier (X509 *x509, uint8_t **buffer, int *si
        return 1;
 }
 
-int
+MONO_API int
 mono_btls_x509_print (X509 *x509, BIO *bio)
 {
        return X509_print_ex (bio, x509, XN_FLAG_COMPAT, X509_FLAG_COMPAT);
@@ -359,7 +359,7 @@ get_trust_nid (MonoBtlsX509Purpose purpose)
        }
 }
 
-int
+MONO_API int
 mono_btls_x509_add_trust_object (X509 *x509, MonoBtlsX509Purpose purpose)
 {
        ASN1_OBJECT *trust;
@@ -377,7 +377,7 @@ mono_btls_x509_add_trust_object (X509 *x509, MonoBtlsX509Purpose purpose)
        return X509_add1_trust_object (x509, trust);
 }
 
-int
+MONO_API int
 mono_btls_x509_add_reject_object (X509 *x509, MonoBtlsX509Purpose purpose)
 {
        ASN1_OBJECT *reject;
@@ -395,7 +395,7 @@ mono_btls_x509_add_reject_object (X509 *x509, MonoBtlsX509Purpose purpose)
        return X509_add1_reject_object (x509, reject);
 }
 
-int
+MONO_API int
 mono_btls_x509_add_explicit_trust (X509 *x509, MonoBtlsX509TrustKind kind)
 {
        int ret = 0;
index 3f754d04f3f26b85edc3d982fa69080c81d79737..a3c116e51348fa00ecc3c6ca8df69197f11a1a1a 100644 (file)
@@ -50,6 +50,7 @@ if PLATFORM_ANDROID
 platform_sources += ../../support/libm/complex.c
 endif
 
+if !DYNAMIC_BTLS
 if BTLS
 btls_file_list := $(shell cat ../btls/build-shared/mono-btls-shared-lo.txt)
 btls_static_file_list := $(shell cat ../btls/build-static/mono-btls-static-lo.txt)
@@ -57,6 +58,7 @@ btls_libs = $(btls_file_list)
 btls_static_libs = $(btls_static_file_list)
 btls_cflags = -I$(top_srcdir)/external/boringssl/include -I$(top_srcdir)/mono/btls
 endif
+endif
 
 #
 # libtool is not capable of creating static/shared versions of the same
@@ -277,10 +279,6 @@ boehm_sources = \
        boehm-gc.c
 
 sgen_sources = \
-       sgen-os-posix.c         \
-       sgen-os-mach.c          \
-       sgen-os-win32.c         \
-       sgen-os-coop.c          \
        sgen-bridge.c           \
        sgen-bridge.h           \
        sgen-bridge-internals.h \
index d4cbfa285b3116b323d886d0b2e97230be488c6c..209e4ab4f988192fe280953fe7d5017c547d56b3 100644 (file)
@@ -570,7 +570,7 @@ mono_assembly_getrootdir (void)
  * Returns: a string with the directory, this string should be freed by
  * the caller.
  */
-G_CONST_RETURN gchar *
+gchar *
 mono_native_getrootdir (void)
 {
        gchar* fullpath = g_build_path (G_DIR_SEPARATOR_S, mono_assembly_getrootdir (), mono_config_get_reloc_lib_dir(), NULL);
index 6126feda0e1c9053ddc792e2a466a1aa60dd2953..0cde65a2b5b1d244f5ae0e5818ee303180332e75 100644 (file)
@@ -37,8 +37,8 @@ MONO_RT_EXTERNAL_ONLY MONO_API MonoImage*    mono_assembly_load_module (MonoAsse
 MONO_API void          mono_assembly_close      (MonoAssembly *assembly);
 MONO_API void          mono_assembly_setrootdir (const char *root_dir);
 MONO_API MONO_CONST_RETURN char *mono_assembly_getrootdir (void);
-MONO_API MONO_CONST_RETURN char *mono_native_getrootdir (void);
-MONO_API void        mono_assembly_foreach    (MonoFunc func, void* user_data);
+MONO_API char         *mono_native_getrootdir (void);
+MONO_API void         mono_assembly_foreach    (MonoFunc func, void* user_data);
 MONO_API void          mono_assembly_set_main   (MonoAssembly *assembly);
 MONO_API MonoAssembly *mono_assembly_get_main   (void);
 MONO_API MonoImage    *mono_assembly_get_image  (MonoAssembly *assembly);
index d3debe1cd03665f7ffe5df29c3a55de1bd885660..2c648c85da6d7bf8bb36a165c5931bafe013fe3a 100644 (file)
@@ -1352,11 +1352,6 @@ mono_gc_get_nursery (int *shift_bits, size_t *size)
        return NULL;
 }
 
-void
-mono_gc_set_current_thread_appdomain (MonoDomain *domain)
-{
-}
-
 gboolean
 mono_gc_precise_stack_mark_enabled (void)
 {
index 8f46bbc25c6fa507301b1b8e4c35304e641b0755..b2af4f795564c8bbd8231d00b2470a4b46250465 100644 (file)
@@ -194,7 +194,7 @@ struct _MonoEvent {
 };
 
 /* type of exception being "on hold" for later processing (see exception_type) */
-enum {
+typedef enum {
        MONO_EXCEPTION_NONE = 0,
        MONO_EXCEPTION_INVALID_PROGRAM = 3,
        MONO_EXCEPTION_UNVERIFIABLE_IL = 4,
@@ -211,7 +211,7 @@ enum {
        MONO_EXCEPTION_INLINE_FAILED = 15,
        MONO_EXCEPTION_MONO_ERROR = 16,
        /* add other exception type */
-};
+} MonoExceptionType;
 
 /* This struct collects the info needed for the runtime use of a class,
  * like the vtables for a domain, the GC descriptor, etc.
index 39dd1ca416571b02f73e94eb4afea4fc677457ed..adb8909f460117ceebfa8be3facd485151765bd6 100644 (file)
@@ -66,7 +66,6 @@ MONO_FAST_TLS_DECLARE(tls_appdomain);
        MonoThreadInfo *info; \
        MONO_FAST_TLS_SET (tls_appdomain,x); \
        mono_native_tls_set_value (appdomain_thread_id, x); \
-       mono_gc_set_current_thread_appdomain (x); \
        info = mono_thread_info_current (); \
        if (info) \
                mono_thread_info_tls_set (info, TLS_KEY_DOMAIN, (x));   \
@@ -78,7 +77,6 @@ MONO_FAST_TLS_DECLARE(tls_appdomain);
 #define SET_APPDOMAIN(x) do {                                          \
                MonoThreadInfo *info;                                                           \
                mono_native_tls_set_value (appdomain_thread_id, x);     \
-               mono_gc_set_current_thread_appdomain (x);               \
                info = mono_thread_info_current ();                             \
                if (info)                                                                                                \
                        mono_thread_info_tls_set (info, TLS_KEY_DOMAIN, (x));   \
index d3d81f272a8820b14d5710c4bee0a7b532548485..afb6522d1cba060c2c664bc069377fcc0aa1b621 100644 (file)
@@ -297,8 +297,6 @@ gboolean mono_gc_card_table_nursery_check (void);
 
 void* mono_gc_get_nursery (int *shift_bits, size_t *size);
 
-void mono_gc_set_current_thread_appdomain (MonoDomain *domain);
-
 void mono_gc_set_skip_thread (gboolean skip);
 
 #ifndef HOST_WIN32
index 46a2bedb529dec03dc6a2b62581acbce19f3ead1..11ba22a6e617dc706d2dcd2d0701dcf7047dd54e 100644 (file)
@@ -78,7 +78,7 @@ ICALL(NATIVEMETHODS_10, "TerminateProcess", ves_icall_Microsoft_Win32_NativeMeth
 ICALL(NATIVEMETHODS_11, "WaitForInputIdle", ves_icall_Microsoft_Win32_NativeMethods_WaitForInputIdle)
 #endif /* !DISABLE_PROCESS_HANDLING */
 
-#if HAVE_BTLS
+#if defined(HAVE_BTLS) && !defined(HAVE_DYNAMIC_BTLS)
 ICALL_TYPE(BTLS_BIO, "Mono.Btls.MonoBtlsBio", BTLS_BIO_1)
 ICALL(BTLS_BIO_1, "mono_btls_bio_flush", mono_btls_bio_flush)
 ICALL(BTLS_BIO_2, "mono_btls_bio_free", mono_btls_bio_free)
@@ -921,12 +921,15 @@ ICALL(MARSHAL_8, "GetComSlotForMethodInfoInternal", ves_icall_System_Runtime_Int
 ICALL(MARSHAL_9, "GetDelegateForFunctionPointerInternal", ves_icall_System_Runtime_InteropServices_Marshal_GetDelegateForFunctionPointerInternal)
 ICALL(MARSHAL_10, "GetFunctionPointerForDelegateInternal", ves_icall_System_Runtime_InteropServices_Marshal_GetFunctionPointerForDelegateInternal)
 #ifndef DISABLE_COM
+ICALL(MARSHAL_52, "GetHRForException_WinRT", ves_icall_System_Runtime_InteropServices_Marshal_GetHRForException_WinRT)
 ICALL(MARSHAL_45, "GetIDispatchForObjectInternal", ves_icall_System_Runtime_InteropServices_Marshal_GetIDispatchForObjectInternal)
 ICALL(MARSHAL_46, "GetIUnknownForObjectInternal", ves_icall_System_Runtime_InteropServices_Marshal_GetIUnknownForObjectInternal)
 #endif
 ICALL(MARSHAL_11, "GetLastWin32Error", ves_icall_System_Runtime_InteropServices_Marshal_GetLastWin32Error)
 #ifndef DISABLE_COM
+ICALL(MARSHAL_53, "GetNativeActivationFactory", ves_icall_System_Runtime_InteropServices_Marshal_GetNativeActivationFactory)
 ICALL(MARSHAL_47, "GetObjectForCCW", ves_icall_System_Runtime_InteropServices_Marshal_GetObjectForCCW)
+ICALL(MARSHAL_54, "GetRawIUnknownForComObjectNoAddRef", ves_icall_System_Runtime_InteropServices_Marshal_GetRawIUnknownForComObjectNoAddRef)
 ICALL(MARSHAL_48, "IsComObject", ves_icall_System_Runtime_InteropServices_Marshal_IsComObject)
 #endif
 ICALL(MARSHAL_12, "OffsetOf", ves_icall_System_Runtime_InteropServices_Marshal_OffsetOf)
@@ -960,6 +963,16 @@ ICALL(MARSHAL_35, "UnsafeAddrOfPinnedArrayElement", ves_icall_System_Runtime_Int
 ICALL(MARSHAL_41, "copy_from_unmanaged", ves_icall_System_Runtime_InteropServices_Marshal_copy_from_unmanaged)
 ICALL(MARSHAL_42, "copy_to_unmanaged", ves_icall_System_Runtime_InteropServices_Marshal_copy_to_unmanaged)
 
+#ifndef DISABLE_COM
+ICALL_TYPE(WINDOWSRUNTIME_UNM, "System.Runtime.InteropServices.WindowsRuntime.UnsafeNativeMethods", WINDOWSRUNTIME_UNM_0)
+ICALL(WINDOWSRUNTIME_UNM_0, "GetRestrictedErrorInfo", ves_icall_System_Runtime_InteropServices_WindowsRuntime_UnsafeNativeMethods_GetRestrictedErrorInfo)
+ICALL(WINDOWSRUNTIME_UNM_1, "RoOriginateLanguageException", ves_icall_System_Runtime_InteropServices_WindowsRuntime_UnsafeNativeMethods_RoOriginateLanguageException)
+ICALL(WINDOWSRUNTIME_UNM_2, "RoReportUnhandledError", ves_icall_System_Runtime_InteropServices_WindowsRuntime_UnsafeNativeMethods_RoReportUnhandledError)
+ICALL(WINDOWSRUNTIME_UNM_3, "WindowsCreateString", ves_icall_System_Runtime_InteropServices_WindowsRuntime_UnsafeNativeMethods_WindowsCreateString)
+ICALL(WINDOWSRUNTIME_UNM_4, "WindowsDeleteString", ves_icall_System_Runtime_InteropServices_WindowsRuntime_UnsafeNativeMethods_WindowsDeleteString)
+ICALL(WINDOWSRUNTIME_UNM_5, "WindowsGetStringRawBuffer", ves_icall_System_Runtime_InteropServices_WindowsRuntime_UnsafeNativeMethods_WindowsGetStringRawBuffer)
+#endif
+
 ICALL_TYPE(ACTS, "System.Runtime.Remoting.Activation.ActivationServices", ACTS_1)
 ICALL(ACTS_1, "AllocateUninitializedClassInstance", ves_icall_System_Runtime_Activation_ActivationServices_AllocateUninitializedClassInstance)
 ICALL(ACTS_2, "EnableProxyActivation", ves_icall_System_Runtime_Activation_ActivationServices_EnableProxyActivation)
index a1cec1aa33a86a7eb84cc24b7f6ce56381c7f0b3..116a44fa837339ec5c74482052b421c40b379fb8 100644 (file)
 #include <sys/utsname.h>
 #endif
 
-#if HAVE_BTLS
+#if defined(HAVE_BTLS) && !defined(HAVE_DYNAMIC_BTLS)
 #include <btls/btls-ssl.h>
 #include <btls/btls-bio.h>
 #include <btls/btls-error.h>
@@ -8099,6 +8099,73 @@ ves_icall_Mono_TlsProviderFactory_IsBtlsSupported (void)
 #endif
 }
 
+#ifndef DISABLE_COM
+
+ICALL_EXPORT int
+ves_icall_System_Runtime_InteropServices_Marshal_GetHRForException_WinRT(MonoException* ex)
+{
+       mono_set_pending_exception(mono_get_exception_not_implemented("System.Runtime.InteropServices.Marshal.GetHRForException_WinRT internal call is not implemented."));
+       return 0;
+}
+
+ICALL_EXPORT MonoObject*
+ves_icall_System_Runtime_InteropServices_Marshal_GetNativeActivationFactory(MonoObject* type)
+{
+       mono_set_pending_exception(mono_get_exception_not_implemented("System.Runtime.InteropServices.Marshal.GetNativeActivationFactory internal call is not implemented."));
+       return NULL;
+}
+
+ICALL_EXPORT void*
+ves_icall_System_Runtime_InteropServices_Marshal_GetRawIUnknownForComObjectNoAddRef(MonoObject* obj)
+{
+       mono_set_pending_exception(mono_get_exception_not_implemented("System.Runtime.InteropServices.Marshal.GetRawIUnknownForComObjectNoAddRef internal call is not implemented."));
+       return NULL;
+}
+
+ICALL_EXPORT MonoObject*
+ves_icall_System_Runtime_InteropServices_WindowsRuntime_UnsafeNativeMethods_GetRestrictedErrorInfo()
+{
+       mono_set_pending_exception(mono_get_exception_not_implemented("System.Runtime.InteropServices.WindowsRuntime.UnsafeNativeMethods.GetRestrictedErrorInfo internal call is not implemented."));
+       return NULL;
+}
+
+ICALL_EXPORT MonoBoolean
+ves_icall_System_Runtime_InteropServices_WindowsRuntime_UnsafeNativeMethods_RoOriginateLanguageException(int error, MonoString* message, void* languageException)
+{
+       mono_set_pending_exception(mono_get_exception_not_implemented("System.Runtime.InteropServices.WindowsRuntime.UnsafeNativeMethods.RoOriginateLanguageException internal call is not implemented."));
+       return FALSE;
+}
+
+ICALL_EXPORT void
+ves_icall_System_Runtime_InteropServices_WindowsRuntime_UnsafeNativeMethods_RoReportUnhandledError(MonoObject* error)
+{
+       mono_set_pending_exception(mono_get_exception_not_implemented("System.Runtime.InteropServices.WindowsRuntime.UnsafeNativeMethods.RoReportUnhandledError internal call is not implemented."));
+}
+
+ICALL_EXPORT int
+ves_icall_System_Runtime_InteropServices_WindowsRuntime_UnsafeNativeMethods_WindowsCreateString(MonoString* sourceString, int length, void** hstring)
+{
+       mono_set_pending_exception(mono_get_exception_not_implemented("System.Runtime.InteropServices.WindowsRuntime.UnsafeNativeMethods.WindowsCreateString internal call is not implemented."));
+       return 0;
+}
+
+ICALL_EXPORT int
+ves_icall_System_Runtime_InteropServices_WindowsRuntime_UnsafeNativeMethods_WindowsDeleteString(void* hstring)
+{
+       mono_set_pending_exception(mono_get_exception_not_implemented("System.Runtime.InteropServices.WindowsRuntime.UnsafeNativeMethods.WindowsDeleteString internal call is not implemented."));
+       return 0;
+}
+
+ICALL_EXPORT mono_unichar2*
+ves_icall_System_Runtime_InteropServices_WindowsRuntime_UnsafeNativeMethods_WindowsGetStringRawBuffer(void* hstring, unsigned* length)
+{
+       mono_set_pending_exception(mono_get_exception_not_implemented("System.Runtime.InteropServices.WindowsRuntime.UnsafeNativeMethods.WindowsGetStringRawBuffer internal call is not implemented."));
+       return NULL;
+}
+
+#endif
+
+
 #ifndef DISABLE_ICALL_TABLES
 
 #define ICALL_TYPE(id,name,first)
index acf4e390fee995fdeb12b02a67ffddc9b989d0c2..a9a1042aee535ed693236c55c534486013e9e3ed 100644 (file)
@@ -2877,6 +2877,7 @@ cache_generic_delegate_wrapper (GHashTable *cache, MonoMethod *orig_method, Mono
 {
        MonoError error;
        MonoMethod *inst, *res;
+       WrapperInfo *ginfo, *info;
 
        /*
         * We use the same cache for the generic definition and the instances.
@@ -2884,6 +2885,16 @@ cache_generic_delegate_wrapper (GHashTable *cache, MonoMethod *orig_method, Mono
        inst = mono_class_inflate_generic_method_checked (def, ctx, &error);
        g_assert (mono_error_ok (&error)); /* FIXME don't swallow the error */
 
+       ginfo = mono_marshal_get_wrapper_info (def);
+       if (ginfo) {
+               info = (WrapperInfo *)mono_image_alloc0 (def->klass->image, sizeof (WrapperInfo));
+               info->subtype = ginfo->subtype;
+               if (info->subtype == WRAPPER_SUBTYPE_NONE) {
+                       info->d.delegate_invoke.method = mono_class_inflate_generic_method_checked (ginfo->d.delegate_invoke.method, ctx, &error);
+                       mono_error_assert_ok (&error);
+               }
+       }
+
        mono_memory_barrier ();
        mono_marshal_lock ();
        res = (MonoMethod *)g_hash_table_lookup (cache, orig_method->klass);
@@ -3554,7 +3565,7 @@ mono_marshal_get_delegate_invoke_internal (MonoMethod *method, gboolean callvirt
 #endif /* DISABLE_JIT */
 
        info = mono_wrapper_info_create (mb, subtype);
-       info->d.delegate_invoke.method = orig_method;
+       info->d.delegate_invoke.method = method;
 
        if (ctx) {
                MonoMethod *def;
@@ -6678,7 +6689,8 @@ emit_marshal_array (EmitMarshalContext *m, int argnum, MonoType *t,
                        mono_mb_emit_icon (mb, esize);
                        mono_mb_emit_byte (mb, CEE_MUL);
                        mono_mb_emit_byte (mb, CEE_PREFIX1);
-                       mono_mb_emit_byte (mb, CEE_CPBLK);                      
+                       mono_mb_emit_byte (mb, CEE_CPBLK);
+                       mono_mb_patch_branch (mb, label1);
                        break;
                }
 
index c3beaa4553795cf7d9285b3b0f68c5d3c88abf7e..9b4ca91bc753965ceaba0e55cf9b8f096af0ee08 100644 (file)
@@ -2397,7 +2397,7 @@ verify_typeref_table (VerifyContext *ctx)
 }
 
 /*bits 9,11,14,15,19,21,24-31 */
-#define INVALID_TYPEDEF_FLAG_BITS ((1 << 6) | (1 << 9) | (1 << 14) | (1 << 15) | (1 << 19) | (1 << 21) | 0xFF000000)
+#define INVALID_TYPEDEF_FLAG_BITS ((1 << 6) | (1 << 9) | (1 << 15) | (1 << 19) | (1 << 21) | 0xFF000000)
 static void
 verify_typedef_table (VerifyContext *ctx)
 {
index cfe15393594f0ab94ec70b8f9479f1f4837d3aca..fe82c2e037bef78c7074f11e22a817abd3093f40 100644 (file)
@@ -314,7 +314,7 @@ dllmap_start (gpointer user_data,
                        else if (strcmp (attribute_names [i], "target") == 0){
                                char *p = strstr (attribute_values [i], "$mono_libdir");
                                if (p != NULL){
-                                       const char *libdir = mono_native_getrootdir ();
+                                       char *libdir = mono_native_getrootdir ();
                                        size_t libdir_len = strlen (libdir);
                                        char *result;
                                        
index b3224372ddef5b678b1d512be8e23fa527bbdf8e..0990ff875fd9a661ce35792db960492ebe1ecb64 100644 (file)
@@ -444,11 +444,6 @@ mono_gc_get_nursery (int *shift_bits, size_t *size)
        return NULL;
 }
 
-void
-mono_gc_set_current_thread_appdomain (MonoDomain *domain)
-{
-}
-
 gboolean
 mono_gc_precise_stack_mark_enabled (void)
 {
index eee26b706018d4efcd05204190364373da3d096f..cb60f3b58ec2b86b58701a4fb1e194a177135c2e 100644 (file)
@@ -39,9 +39,6 @@ struct _SgenClientThreadInfo {
        gboolean skip, suspend_done;
        volatile int in_critical_region;
 
-       gpointer stopped_ip;    /* only valid if the thread is stopped */
-       MonoDomain *stopped_domain; /* dsto */
-
        /*
        This is set the argument of mono_gc_set_skip_thread.
 
@@ -700,11 +697,6 @@ sgen_client_binary_protocol_pin_stats (int objects_pinned_in_nursery, size_t byt
 {
 }
 
-int sgen_thread_handshake (BOOL suspend);
-gboolean sgen_suspend_thread (SgenThreadInfo *info);
-gboolean sgen_resume_thread (SgenThreadInfo *info);
-void sgen_wait_for_suspend_ack (int count);
-
 #ifdef HAVE_KW_THREAD
 extern __thread SgenThreadInfo *sgen_thread_info;
 #define TLAB_ACCESS_INIT
index 725a7eccc638d2b2bf8b0c30b57f9f9e27f8d73e..6372084d21dfb43b801fd1a0374c5aeb12a463c1 100644 (file)
@@ -29,6 +29,7 @@
 #include "utils/mono-logger-internals.h"
 #include "utils/mono-threads-coop.h"
 #include "sgen/sgen-thread-pool.h"
+#include "utils/mono-threads.h"
 
 #ifdef HEAVY_STATISTICS
 static guint64 stat_wbarrier_set_arrayref = 0;
@@ -184,6 +185,18 @@ mono_gc_wbarrier_value_copy_bitmap (gpointer _dest, gpointer _src, int size, uns
        sgen_wbarrier_value_copy_bitmap (_dest, _src, size, bitmap);
 }
 
+int
+mono_gc_get_suspend_signal (void)
+{
+       return mono_threads_suspend_get_suspend_signal ();
+}
+
+int
+mono_gc_get_restart_signal (void)
+{
+       return mono_threads_suspend_get_restart_signal ();
+}
+
 static MonoMethod *write_barrier_conc_method;
 static MonoMethod *write_barrier_noconc_method;
 
@@ -732,18 +745,6 @@ mono_gc_ephemeron_array_add (MonoObject *obj)
  * Appdomain handling
  */
 
-void
-mono_gc_set_current_thread_appdomain (MonoDomain *domain)
-{
-       SgenThreadInfo *info = mono_thread_info_current ();
-
-       /* Could be called from sgen_thread_unregister () with a NULL info */
-       if (domain) {
-               g_assert (info);
-               info->client_info.stopped_domain = domain;
-       }
-}
-
 static gboolean
 need_remove_object_for_domain (GCObject *start, MonoDomain *domain)
 {
@@ -2214,8 +2215,6 @@ sgen_client_thread_register (SgenThreadInfo* info, void *stack_bottom_fallback)
 #endif
 
        info->client_info.skip = 0;
-       info->client_info.stopped_ip = NULL;
-       info->client_info.stopped_domain = NULL;
 
        info->client_info.stack_start = NULL;
 
@@ -2876,13 +2875,6 @@ sgen_client_init (void)
        }
 #endif
 
-       /*
-        * This needs to happen before any internal allocations because
-        * it inits the small id which is required for hazard pointer
-        * operations.
-        */
-       sgen_os_init ();
-
        mono_gc_register_thread (&dummy);
 }
 
diff --git a/mono/metadata/sgen-os-coop.c b/mono/metadata/sgen-os-coop.c
deleted file mode 100644 (file)
index aab29b6..0000000
+++ /dev/null
@@ -1,76 +0,0 @@
-/*
- * sgen-os-coop.c: SGen Cooperative backend support.
- *
- * Author:
- *     João Matos (joao.matos@xamarin.com)
- * Copyright (C) 2015 Xamarin Inc
- *
- * Licensed under the MIT license. See LICENSE file in the project root for full license information.
- */
-
-#include "config.h"
-
-#ifdef HAVE_SGEN_GC
-
-
-#include <glib.h>
-#include "sgen/sgen-gc.h"
-#include "sgen/sgen-archdep.h"
-#include "sgen/sgen-protocol.h"
-#include "metadata/object-internals.h"
-#include "metadata/gc-internals.h"
-
-
-#if defined(USE_COOP_GC)
-
-gboolean
-sgen_resume_thread (SgenThreadInfo *info)
-{
-       g_error ("FIXME");
-       return FALSE;
-}
-
-gboolean
-sgen_suspend_thread (SgenThreadInfo *info)
-{
-       g_error ("FIXME");
-       return FALSE;
-}
-
-void
-sgen_wait_for_suspend_ack (int count)
-{
-}
-
-/* LOCKING: assumes the GC lock is held */
-int
-sgen_thread_handshake (BOOL suspend)
-{
-       g_error ("FIXME");
-       return 0;
-}
-
-void
-sgen_os_init (void)
-{
-}
-
-int
-mono_gc_get_suspend_signal (void)
-{
-       return -1;
-}
-
-int
-mono_gc_get_restart_signal (void)
-{
-       return -1;
-}
-#else
-
-#ifdef _MSC_VER
-// Quiet Visual Studio linker warning, LNK4221, in cases when this source file intentional ends up empty.
-void __mono_win32_sgen_os_coop_quiet_lnk4221(void) {}
-#endif
-#endif /* USE_COOP_GC */
-#endif
diff --git a/mono/metadata/sgen-os-mach.c b/mono/metadata/sgen-os-mach.c
deleted file mode 100644 (file)
index 1f87eb1..0000000
+++ /dev/null
@@ -1,153 +0,0 @@
-/*
- * sgen-os-mach.c: Mach-OS support.
- *
- * Author:
- *     Paolo Molaro (lupus@ximian.com)
- *     Mark Probst (mprobst@novell.com)
- *     Geoff Norton (gnorton@novell.com)
- *
- * Copyright 2010 Novell, Inc (http://www.novell.com)
- * Copyright (C) 2012 Xamarin Inc
- *
- * Licensed under the MIT license. See LICENSE file in the project root for full license information.
- */
-
-#include "config.h"
-#ifdef HAVE_SGEN_GC
-
-
-#include <glib.h>
-#include "sgen/sgen-gc.h"
-#include "sgen/sgen-archdep.h"
-#include "sgen/sgen-protocol.h"
-#include "sgen/sgen-thread-pool.h"
-#include "metadata/object-internals.h"
-#include "metadata/gc-internals.h"
-
-#if defined(__MACH__)
-#include "utils/mach-support.h"
-#endif
-
-#if defined(__MACH__) && MONO_MACH_ARCH_SUPPORTED
-
-#if !defined(USE_COOP_GC)
-gboolean
-sgen_resume_thread (SgenThreadInfo *info)
-{
-       kern_return_t ret;
-       do {
-               ret = thread_resume (info->client_info.info.native_handle);
-       } while (ret == KERN_ABORTED);
-       return ret == KERN_SUCCESS;
-}
-
-gboolean
-sgen_suspend_thread (SgenThreadInfo *info)
-{
-       mach_msg_type_number_t num_state;
-       thread_state_t state;
-       kern_return_t ret;
-       ucontext_t ctx;
-       mcontext_t mctx;
-
-       gpointer stack_start;
-
-       state = (thread_state_t) alloca (mono_mach_arch_get_thread_state_size ());
-       mctx = (mcontext_t) alloca (mono_mach_arch_get_mcontext_size ());
-
-       do {
-               ret = thread_suspend (info->client_info.info.native_handle);
-       } while (ret == KERN_ABORTED);
-       if (ret != KERN_SUCCESS)
-               return FALSE;
-
-       do {
-               ret = mono_mach_arch_get_thread_state (info->client_info.info.native_handle, state, &num_state);
-       } while (ret == KERN_ABORTED);
-       if (ret != KERN_SUCCESS)
-               return FALSE;
-
-       mono_mach_arch_thread_state_to_mcontext (state, mctx);
-       ctx.uc_mcontext = mctx;
-
-       info->client_info.stopped_domain = mono_thread_info_tls_get (info, TLS_KEY_DOMAIN);
-       info->client_info.stopped_ip = (gpointer) mono_mach_arch_get_ip (state);
-       info->client_info.stack_start = NULL;
-       stack_start = (char*) mono_mach_arch_get_sp (state) - REDZONE_SIZE;
-       /* If stack_start is not within the limits, then don't set it in info and we will be restarted. */
-       if (stack_start >= info->client_info.stack_start_limit && stack_start <= info->client_info.stack_end) {
-               info->client_info.stack_start = stack_start;
-
-               mono_sigctx_to_monoctx (&ctx, &info->client_info.ctx);
-       } else {
-               g_assert (!info->client_info.stack_start);
-       }
-
-       /* Notify the JIT */
-       if (mono_gc_get_gc_callbacks ()->thread_suspend_func)
-               mono_gc_get_gc_callbacks ()->thread_suspend_func (info->client_info.runtime_data, &ctx, NULL);
-
-       SGEN_LOG (2, "thread %p stopped at %p stack_start=%p", (void*)(gsize)info->client_info.info.native_handle, info->client_info.stopped_ip, info->client_info.stack_start);
-       binary_protocol_thread_suspend ((gpointer)mono_thread_info_get_tid (info), info->client_info.stopped_ip);
-
-       return TRUE;
-}
-
-void
-sgen_wait_for_suspend_ack (int count)
-{
-    /* mach thread_resume is synchronous so we dont need to wait for them */
-}
-
-/* LOCKING: assumes the GC lock is held */
-int
-sgen_thread_handshake (BOOL suspend)
-{
-       SgenThreadInfo *cur_thread = mono_thread_info_current ();
-       kern_return_t ret;
-
-       int count = 0;
-
-       cur_thread->client_info.suspend_done = TRUE;
-       FOREACH_THREAD (info) {
-               if (info == cur_thread || sgen_thread_pool_is_thread_pool_thread (mono_thread_info_get_tid (info)))
-                       continue;
-
-               info->client_info.suspend_done = FALSE;
-               if (info->client_info.gc_disabled)
-                       continue;
-
-               if (suspend) {
-                       if (!sgen_suspend_thread (info))
-                               continue;
-               } else {
-                       do {
-                               ret = thread_resume (info->client_info.info.native_handle);
-                       } while (ret == KERN_ABORTED);
-                       if (ret != KERN_SUCCESS)
-                               continue;
-               }
-               count ++;
-       } FOREACH_THREAD_END
-       return count;
-}
-
-void
-sgen_os_init (void)
-{
-}
-
-int
-mono_gc_get_suspend_signal (void)
-{
-       return -1;
-}
-
-int
-mono_gc_get_restart_signal (void)
-{
-       return -1;
-}
-#endif
-#endif
-#endif
diff --git a/mono/metadata/sgen-os-posix.c b/mono/metadata/sgen-os-posix.c
deleted file mode 100644 (file)
index 1016841..0000000
+++ /dev/null
@@ -1,246 +0,0 @@
-/*
- * sgen-os-posix.c: Posix support.
- *
- * Author:
- *     Paolo Molaro (lupus@ximian.com)
- *     Mark Probst (mprobst@novell.com)
- *     Geoff Norton (gnorton@novell.com)
- *
- * Copyright 2010 Novell, Inc (http://www.novell.com)
- * Copyright (C) 2012 Xamarin Inc
- *
- * Licensed under the MIT license. See LICENSE file in the project root for full license information.
- */
-
-#include "config.h"
-
-#if defined(HAVE_SGEN_GC) && !defined(USE_COOP_GC)
-#if !defined(__MACH__) && !MONO_MACH_ARCH_SUPPORTED && defined(HAVE_PTHREAD_KILL)
-
-#include <errno.h>
-#include <glib.h>
-#include "sgen/sgen-gc.h"
-#include "metadata/gc-internals.h"
-#include "sgen/sgen-archdep.h"
-#include "metadata/object-internals.h"
-#include "utils/mono-signal-handler.h"
-
-#if defined(__APPLE__) || defined(__OpenBSD__) || defined(__FreeBSD__) || defined(__FreeBSD_kernel__)
-const static int suspend_signal_num = SIGXFSZ;
-#else
-const static int suspend_signal_num = SIGPWR;
-#endif
-const static int restart_signal_num = SIGXCPU;
-
-static SgenSemaphore suspend_ack_semaphore;
-static SgenSemaphore *suspend_ack_semaphore_ptr;
-
-static sigset_t suspend_signal_mask;
-static sigset_t suspend_ack_signal_mask;
-
-static void
-suspend_thread (SgenThreadInfo *info, void *context)
-{
-       int stop_count;
-       MonoContext ctx;
-       gpointer stack_start;
-
-       info->client_info.stopped_domain = mono_domain_get ();
-       info->client_info.stack_start = NULL;
-       info->client_info.signal = 0;
-       stop_count = sgen_global_stop_count;
-       /* duplicate signal */
-       if (0 && info->client_info.stop_count == stop_count)
-               return;
-
-       if (context) {
-               mono_sigctx_to_monoctx (context, &ctx);
-               info->client_info.stopped_ip = MONO_CONTEXT_GET_IP (&ctx);
-               stack_start = (((guint8 *) MONO_CONTEXT_GET_SP (&ctx)) - REDZONE_SIZE);
-       } else {
-               info->client_info.stopped_ip = NULL;
-               stack_start = NULL;
-       }
-
-       /* If stack_start is not within the limits, then don't set it
-          in info and we will be restarted. */
-       if (stack_start >= info->client_info.stack_start_limit && stack_start <= info->client_info.stack_end) {
-               info->client_info.stack_start = stack_start;
-
-               if (context) {
-                       memcpy (&info->client_info.ctx, &ctx, sizeof (MonoContext));
-               } else {
-                       memset (&info->client_info.ctx, 0, sizeof (MonoContext));
-               }
-       } else {
-               g_assert (!info->client_info.stack_start);
-       }
-
-       /* Notify the JIT */
-       if (mono_gc_get_gc_callbacks ()->thread_suspend_func)
-               mono_gc_get_gc_callbacks ()->thread_suspend_func (info->client_info.runtime_data, context, NULL);
-
-       SGEN_LOG (4, "Posting suspend_ack_semaphore for suspend from %p %p", info, (gpointer) (gsize) mono_native_thread_id_get ());
-
-       /*
-       Block the restart signal. 
-       We need to block the restart signal while posting to the suspend_ack semaphore or we race to sigsuspend,
-       which might miss the signal and get stuck.
-       */
-       pthread_sigmask (SIG_BLOCK, &suspend_ack_signal_mask, NULL);
-
-       /* notify the waiting thread */
-       SGEN_SEMAPHORE_POST (suspend_ack_semaphore_ptr);
-       info->client_info.stop_count = stop_count;
-
-       /* wait until we receive the restart signal */
-       do {
-               info->client_info.signal = 0;
-               sigsuspend (&suspend_signal_mask);
-       } while (info->client_info.signal != restart_signal_num);
-
-       /* Unblock the restart signal. */
-       pthread_sigmask (SIG_UNBLOCK, &suspend_ack_signal_mask, NULL);
-
-       SGEN_LOG (4, "Posting suspend_ack_semaphore for resume from %p %p\n", info, (gpointer) (gsize) mono_native_thread_id_get ());
-       /* notify the waiting thread */
-       SGEN_SEMAPHORE_POST (suspend_ack_semaphore_ptr);
-}
-
-/* LOCKING: assumes the GC lock is held (by the stopping thread) */
-MONO_SIG_HANDLER_FUNC (static, suspend_handler)
-{
-       /*
-        * The suspend signal handler potentially uses syscalls that
-        * can set errno, and it calls functions that use the hazard
-        * pointer machinery.  Since we're interrupting other code we
-        * must restore those to the values they had when we
-        * interrupted.
-        */
-       SgenThreadInfo *info;
-       int old_errno = errno;
-       int hp_save_index = mono_hazard_pointer_save_for_signal_handler ();
-       MONO_SIG_HANDLER_GET_CONTEXT;
-
-       info = mono_thread_info_current ();
-       suspend_thread (info, ctx);
-
-       mono_hazard_pointer_restore_for_signal_handler (hp_save_index);
-       errno = old_errno;
-}
-
-MONO_SIG_HANDLER_FUNC (static, restart_handler)
-{
-       SgenThreadInfo *info;
-       int old_errno = errno;
-
-       info = mono_thread_info_current ();
-       info->client_info.signal = restart_signal_num;
-       SGEN_LOG (4, "Restart handler in %p %p", info, (gpointer) (gsize) mono_native_thread_id_get ());
-       errno = old_errno;
-}
-
-gboolean
-sgen_resume_thread (SgenThreadInfo *info)
-{
-       return mono_threads_pthread_kill (info, restart_signal_num) == 0;
-}
-
-gboolean
-sgen_suspend_thread (SgenThreadInfo *info)
-{
-       return mono_threads_pthread_kill (info, suspend_signal_num) == 0;
-}
-
-void
-sgen_wait_for_suspend_ack (int count)
-{
-       int i, result;
-
-       for (i = 0; i < count; ++i) {
-               while ((result = SGEN_SEMAPHORE_WAIT (suspend_ack_semaphore_ptr)) != 0) {
-                       if (errno != EINTR) {
-                               g_error ("SGEN_SEMAPHORE_WAIT FAILED with %d errno %d (%s)", result, errno, strerror (errno));
-                       }
-               }
-       }
-}
-
-int
-sgen_thread_handshake (BOOL suspend)
-{
-       int count, result;
-       int signum = suspend ? suspend_signal_num : restart_signal_num;
-
-       MonoNativeThreadId me = mono_native_thread_id_get ();
-
-       count = 0;
-       mono_thread_info_current ()->client_info.suspend_done = TRUE;
-       FOREACH_THREAD (info) {
-               if (mono_native_thread_id_equals (mono_thread_info_get_tid (info), me)) {
-                       continue;
-               }
-               info->client_info.suspend_done = FALSE;
-               if (info->client_info.gc_disabled)
-                       continue;
-               /*if (signum == suspend_signal_num && info->stop_count == global_stop_count)
-                       continue;*/
-               result = mono_threads_pthread_kill (info, signum);
-               if (result == 0) {
-                       count++;
-               } else {
-                       info->client_info.skip = 1;
-               }
-       } FOREACH_THREAD_END
-
-       sgen_wait_for_suspend_ack (count);
-
-       SGEN_LOG (4, "%s handshake for %d threads\n", suspend ? "suspend" : "resume", count);
-
-       return count;
-}
-
-void
-sgen_os_init (void)
-{
-       struct sigaction sinfo;
-
-       if (mono_thread_info_unified_management_enabled ())
-               return;
-
-       suspend_ack_semaphore_ptr = &suspend_ack_semaphore;
-       SGEN_SEMAPHORE_INIT (&suspend_ack_semaphore, 0);
-
-       sigfillset (&sinfo.sa_mask);
-       sinfo.sa_flags = SA_RESTART | SA_SIGINFO;
-       sinfo.sa_sigaction = suspend_handler;
-       if (sigaction (suspend_signal_num, &sinfo, NULL) != 0) {
-               g_error ("failed sigaction");
-       }
-
-       sinfo.sa_handler = (void (*)(int))restart_handler;
-       if (sigaction (restart_signal_num, &sinfo, NULL) != 0) {
-               g_error ("failed sigaction");
-       }
-
-       sigfillset (&suspend_signal_mask);
-       sigdelset (&suspend_signal_mask, restart_signal_num);
-
-       sigemptyset (&suspend_ack_signal_mask);
-       sigaddset (&suspend_ack_signal_mask, restart_signal_num);
-       
-}
-
-int
-mono_gc_get_suspend_signal (void)
-{
-       return suspend_signal_num;
-}
-
-int
-mono_gc_get_restart_signal (void)
-{
-       return restart_signal_num;
-}
-#endif
-#endif
diff --git a/mono/metadata/sgen-os-win32.c b/mono/metadata/sgen-os-win32.c
deleted file mode 100644 (file)
index d78be35..0000000
+++ /dev/null
@@ -1,145 +0,0 @@
-#include "config.h"
-
-#if defined(HAVE_SGEN_GC) && !defined(USE_COOP_GC) && defined(HOST_WIN32)
-
-#include "io-layer/io-layer.h"
-
-#include "sgen/sgen-gc.h"
-#include "metadata/gc-internals.h"
-
-gboolean
-sgen_resume_thread (SgenThreadInfo *info)
-{
-       DWORD id = mono_thread_info_get_tid (info);
-       HANDLE handle = OpenThread (THREAD_ALL_ACCESS, FALSE, id);
-       DWORD result;
-
-       g_assert (handle);
-
-       result = ResumeThread (handle);
-       g_assert (result != (DWORD)-1);
-
-       CloseHandle (handle);
-
-       return result != (DWORD)-1 && result > 0;
-}
-
-gboolean
-sgen_suspend_thread (SgenThreadInfo *info)
-{
-       DWORD id = mono_thread_info_get_tid (info);
-       HANDLE handle = OpenThread (THREAD_ALL_ACCESS, FALSE, id);
-       CONTEXT context;
-       DWORD result;
-
-       g_assert (id != GetCurrentThreadId ());
-
-       g_assert (handle);
-
-       result = SuspendThread (handle);
-       if (result == (DWORD)-1) {
-               fprintf (stderr, "could not suspend thread %x (handle %p): %d\n", id, handle, GetLastError ()); fflush (stderr);
-               CloseHandle (handle);
-               return FALSE;
-       }
-
-       context.ContextFlags = CONTEXT_INTEGER | CONTEXT_CONTROL;
-
-       if (!GetThreadContext (handle, &context)) {
-               g_assert_not_reached ();
-               ResumeThread (handle);
-               CloseHandle (handle);
-               return FALSE;
-       }
-
-       g_assert (context.ContextFlags & CONTEXT_INTEGER);
-       g_assert (context.ContextFlags & CONTEXT_CONTROL);
-
-       CloseHandle (handle);
-
-#if !defined(MONO_CROSS_COMPILE)
-       memset (&info->client_info.ctx, 0, sizeof (MonoContext));
-#ifdef TARGET_AMD64
-    info->client_info.ctx.gregs[AMD64_RIP] = context.Rip;
-    info->client_info.ctx.gregs[AMD64_RAX] = context.Rax;
-    info->client_info.ctx.gregs[AMD64_RCX] = context.Rcx;
-    info->client_info.ctx.gregs[AMD64_RDX] = context.Rdx;
-    info->client_info.ctx.gregs[AMD64_RBX] = context.Rbx;
-    info->client_info.ctx.gregs[AMD64_RSP] = context.Rsp;
-    info->client_info.ctx.gregs[AMD64_RBP] = context.Rbp;
-    info->client_info.ctx.gregs[AMD64_RSI] = context.Rsi;
-    info->client_info.ctx.gregs[AMD64_RDI] = context.Rdi;
-    info->client_info.ctx.gregs[AMD64_R8] = context.R8;
-    info->client_info.ctx.gregs[AMD64_R9] = context.R9;
-    info->client_info.ctx.gregs[AMD64_R10] = context.R10;
-    info->client_info.ctx.gregs[AMD64_R11] = context.R11;
-    info->client_info.ctx.gregs[AMD64_R12] = context.R12;
-    info->client_info.ctx.gregs[AMD64_R13] = context.R13;
-    info->client_info.ctx.gregs[AMD64_R14] = context.R14;
-    info->client_info.ctx.gregs[AMD64_R15] = context.R15;
-    info->client_info.stopped_ip = info->client_info.ctx.gregs[AMD64_RIP];
-    info->client_info.stack_start = (char*)info->client_info.ctx.gregs[AMD64_RSP] - REDZONE_SIZE;
-#else
-       info->client_info.ctx.edi = context.Edi;
-       info->client_info.ctx.esi = context.Esi;
-       info->client_info.ctx.ebx = context.Ebx;
-       info->client_info.ctx.edx = context.Edx;
-       info->client_info.ctx.ecx = context.Ecx;
-       info->client_info.ctx.eax = context.Eax;
-       info->client_info.ctx.ebp = context.Ebp;
-       info->client_info.ctx.esp = context.Esp;
-       info->client_info.stopped_ip = (gpointer)context.Eip;
-       info->client_info.stack_start = (char*)context.Esp - REDZONE_SIZE;
-#endif
-#endif
-
-       /* Notify the JIT */
-       if (mono_gc_get_gc_callbacks ()->thread_suspend_func)
-               mono_gc_get_gc_callbacks ()->thread_suspend_func (info->client_info.runtime_data, NULL, NULL);
-
-       return TRUE;
-}
-
-void
-sgen_wait_for_suspend_ack (int count)
-{
-       /* Win32 suspend/resume is synchronous, so we don't need to wait for anything */
-}
-
-int
-sgen_thread_handshake (BOOL suspend)
-{
-       SgenThreadInfo *current = mono_thread_info_current ();
-       int count = 0;
-
-       current->client_info.suspend_done = TRUE;
-       FOREACH_THREAD (info) {
-               if (info == current)
-                       continue;
-               info->client_info.suspend_done = FALSE;
-               if (info->client_info.gc_disabled)
-                       continue;
-               if (suspend) {
-                       if (!sgen_suspend_thread (info))
-                               continue;
-               } else {
-                       if (!sgen_resume_thread (info))
-                               continue;
-               }
-               ++count;
-       } FOREACH_THREAD_END
-       return count;
-}
-
-void
-sgen_os_init (void)
-{
-}
-
-int
-mono_gc_get_suspend_signal (void)
-{
-       return -1;
-}
-
-#endif
index 60e5933450fba844a1888577df232f4255102127..9b9de7180ed66d596ee8c3034eca4ec2dad91c05 100644 (file)
@@ -25,6 +25,7 @@
 #include "metadata/sgen-bridge-internals.h"
 #include "metadata/gc-internals.h"
 #include "utils/mono-threads.h"
+#include "utils/mono-threads-debug.h"
 
 #define TV_DECLARE SGEN_TV_DECLARE
 #define TV_GETTIME SGEN_TV_GETTIME
@@ -76,106 +77,6 @@ update_current_thread_stack (void *start)
                mono_gc_get_gc_callbacks ()->thread_suspend_func (info->client_info.runtime_data, NULL, &info->client_info.ctx);
 }
 
-static gboolean
-is_ip_in_managed_allocator (MonoDomain *domain, gpointer ip)
-{
-       MonoJitInfo *ji;
-
-       if (!mono_thread_internal_current ())
-               /* Happens during thread attach */
-               return FALSE;
-
-       if (!ip || !domain)
-               return FALSE;
-       if (!sgen_has_critical_method ())
-               return FALSE;
-
-       /*
-        * mono_jit_info_table_find is not async safe since it calls into the AOT runtime to load information for
-        * missing methods (#13951). To work around this, we disable the AOT fallback. For this to work, the JIT needs
-        * to register the jit info for all GC critical methods after they are JITted/loaded.
-        */
-       ji = mono_jit_info_table_find_internal (domain, (char *)ip, FALSE, FALSE);
-       if (!ji)
-               return FALSE;
-
-       return sgen_is_critical_method (mono_jit_info_get_method (ji));
-}
-
-static int
-restart_threads_until_none_in_managed_allocator (void)
-{
-       int num_threads_died = 0;
-       int sleep_duration = -1;
-
-       for (;;) {
-               int restart_count = 0, restarted_count = 0;
-               /* restart all threads that stopped in the
-                  allocator */
-               FOREACH_THREAD (info) {
-                       gboolean result;
-                       if (info->client_info.skip || info->client_info.gc_disabled || info->client_info.suspend_done)
-                               continue;
-                       if (mono_thread_info_is_live (info) &&
-                                       (!info->client_info.stack_start || info->client_info.in_critical_region || info->client_info.info.inside_critical_region ||
-                                       is_ip_in_managed_allocator (info->client_info.stopped_domain, info->client_info.stopped_ip))) {
-                               binary_protocol_thread_restart ((gpointer)mono_thread_info_get_tid (info));
-                               SGEN_LOG (3, "thread %p resumed.", (void*) (size_t) info->client_info.info.native_handle);
-                               result = sgen_resume_thread (info);
-                               if (result) {
-                                       ++restart_count;
-                               } else {
-                                       info->client_info.skip = 1;
-                               }
-                       } else {
-                               /* we set the stopped_ip to
-                                  NULL for threads which
-                                  we're not restarting so
-                                  that we can easily identify
-                                  the others */
-                               info->client_info.stopped_ip = NULL;
-                               info->client_info.stopped_domain = NULL;
-                               info->client_info.suspend_done = TRUE;
-                       }
-               } FOREACH_THREAD_END
-               /* if no threads were restarted, we're done */
-               if (restart_count == 0)
-                       break;
-
-               /* wait for the threads to signal their restart */
-               sgen_wait_for_suspend_ack (restart_count);
-
-               if (sleep_duration < 0) {
-                       mono_thread_info_yield ();
-                       sleep_duration = 0;
-               } else {
-                       g_usleep (sleep_duration);
-                       sleep_duration += 10;
-               }
-
-               /* stop them again */
-               FOREACH_THREAD (info) {
-                       gboolean result;
-                       if (info->client_info.skip || info->client_info.stopped_ip == NULL)
-                               continue;
-                       result = sgen_suspend_thread (info);
-
-                       if (result) {
-                               ++restarted_count;
-                       } else {
-                               info->client_info.skip = 1;
-                       }
-               } FOREACH_THREAD_END
-               /* some threads might have died */
-               num_threads_died += restart_count - restarted_count;
-               /* wait for the threads to signal their suspension
-                  again */
-               sgen_wait_for_suspend_ack (restarted_count);
-       }
-
-       return num_threads_died;
-}
-
 static void
 acquire_gc_locks (void)
 {
@@ -220,15 +121,7 @@ sgen_client_stop_world (int generation)
        SGEN_LOG (3, "stopping world n %d from %p %p", sgen_global_stop_count, mono_thread_info_current (), (gpointer) (gsize) mono_native_thread_id_get ());
        TV_GETTIME (stop_world_time);
 
-       if (mono_thread_info_unified_management_enabled ()) {
-               sgen_unified_suspend_stop_world ();
-       } else {
-               int count, dead;
-               count = sgen_thread_handshake (TRUE);
-               dead = restart_threads_until_none_in_managed_allocator ();
-               if (count < dead)
-                       g_error ("More threads have died (%d) that been initialy suspended %d", dead, count);
-       }
+       sgen_unified_suspend_stop_world ();
 
        SGEN_LOG (3, "world stopped");
 
@@ -260,10 +153,7 @@ sgen_client_restart_world (int generation, gint64 *stw_time)
 
        TV_GETTIME (start_handshake);
 
-       if (mono_thread_info_unified_management_enabled ())
-               sgen_unified_suspend_restart_world ();
-       else
-               sgen_thread_handshake (FALSE);
+       sgen_unified_suspend_restart_world ();
 
        TV_GETTIME (end_sw);
        time_restart_world += TV_ELAPSED (start_handshake, end_sw);
@@ -362,7 +252,7 @@ sgen_unified_suspend_stop_world (void)
        int sleep_duration = -1;
 
        mono_threads_begin_global_suspend ();
-       THREADS_STW_DEBUG ("[GC-STW-BEGIN] *** BEGIN SUSPEND *** \n");
+       THREADS_STW_DEBUG ("[GC-STW-BEGIN][%p] *** BEGIN SUSPEND *** \n", mono_thread_info_get_tid (mono_thread_info_current ()));
 
        FOREACH_THREAD (info) {
                int reason;
@@ -370,9 +260,9 @@ sgen_unified_suspend_stop_world (void)
                info->client_info.suspend_done = FALSE;
                if (sgen_is_thread_in_current_stw (info, &reason)) {
                        info->client_info.skip = !mono_thread_info_begin_suspend (info);
-                       THREADS_STW_DEBUG ("[GC-STW-BEGIN-SUSPEND] SUSPEND thread %p skip %d\n", mono_thread_info_get_tid (info), info->client_info.skip);
+                       THREADS_STW_DEBUG ("[GC-STW-BEGIN-SUSPEND] SUSPEND thread %p skip %s\n", mono_thread_info_get_tid (info), info->client_info.skip ? "true" : "false");
                } else {
-                       THREADS_STW_DEBUG ("[GC-STW-BEGIN-SUSPEND] IGNORE thread %p skip %d reason %d\n", mono_thread_info_get_tid (info), info->client_info.skip, reason);
+                       THREADS_STW_DEBUG ("[GC-STW-BEGIN-SUSPEND] IGNORE thread %p skip %s reason %d\n", mono_thread_info_get_tid (info), info->client_info.skip ? "true" : "false", reason);
                }
        } FOREACH_THREAD_END
 
@@ -400,11 +290,11 @@ sgen_unified_suspend_stop_world (void)
                                if (!(suspend_count == 1))
                                        g_error ("[%p] suspend_count = %d, but should be 1", mono_thread_info_get_tid (info), suspend_count);
                                res = mono_thread_info_begin_resume (info);
-                               THREADS_STW_DEBUG ("[GC-STW-RESTART] RESTART thread %p skip %d\n", mono_thread_info_get_tid (info), res);
                                if (res)
                                        ++restart_counter;
                                else
                                        info->client_info.skip = TRUE;
+                               THREADS_STW_DEBUG ("[GC-STW-RESTART] RESTART thread %p skip %s\n", mono_thread_info_get_tid (info), info->client_info.skip ? "true" : "false");
                        } else {
                                THREADS_STW_DEBUG ("[GC-STW-RESTART] DONE thread %p deemed fully suspended\n", mono_thread_info_get_tid (info));
                                g_assert (!info->client_info.in_critical_region);
@@ -433,9 +323,9 @@ sgen_unified_suspend_stop_world (void)
 
                        if (mono_thread_info_is_running (info)) {
                                gboolean res = mono_thread_info_begin_suspend (info);
-                               THREADS_STW_DEBUG ("[GC-STW-RESTART] SUSPEND thread %p skip %d\n", mono_thread_info_get_tid (info), res);
                                if (!res)
                                        info->client_info.skip = TRUE;
+                               THREADS_STW_DEBUG ("[GC-STW-RESTART] SUSPEND thread %p skip %s\n", mono_thread_info_get_tid (info), info->client_info.skip ? "true" : "false");
                        }
                } FOREACH_THREAD_END
 
@@ -445,36 +335,29 @@ sgen_unified_suspend_stop_world (void)
        FOREACH_THREAD (info) {
                int reason = 0;
                if (sgen_is_thread_in_current_stw (info, &reason)) {
-                       MonoThreadUnwindState *state;
+                       gpointer stopped_ip;
 
-                       THREADS_STW_DEBUG ("[GC-STW-SUSPEND-END] thread %p is suspended\n", mono_thread_info_get_tid (info));
                        g_assert (info->client_info.suspend_done);
 
-                       state = mono_thread_info_get_suspend_state (info);
+                       info->client_info.ctx = mono_thread_info_get_suspend_state (info)->ctx;
 
-                       info->client_info.ctx = state->ctx;
+                       /* Once we remove the old suspend code, we should move sgen to directly access the state in MonoThread */
+                       info->client_info.stack_start = (gpointer) ((char*)MONO_CONTEXT_GET_SP (&info->client_info.ctx) - REDZONE_SIZE);
 
-                       if (!state->unwind_data [MONO_UNWIND_DATA_DOMAIN] || !state->unwind_data [MONO_UNWIND_DATA_LMF]) {
-                               /* thread is starting or detaching, nothing to scan here */
-                               info->client_info.stopped_domain = NULL;
-                               info->client_info.stopped_ip = NULL;
-                               info->client_info.stack_start = NULL;
-                       } else {
-                               /* Once we remove the old suspend code, we should move sgen to directly access the state in MonoThread */
-                               info->client_info.stopped_domain = (MonoDomain*) mono_thread_info_tls_get (info, TLS_KEY_DOMAIN);
-                               info->client_info.stopped_ip = (gpointer) (MONO_CONTEXT_GET_IP (&info->client_info.ctx));
-                               info->client_info.stack_start = (gpointer) ((char*)MONO_CONTEXT_GET_SP (&info->client_info.ctx) - REDZONE_SIZE);
-
-                               /* altstack signal handler, sgen can't handle them, mono-threads should have handled this. */
-                               if (!info->client_info.stack_start
-                                        || info->client_info.stack_start < info->client_info.stack_start_limit
-                                        || info->client_info.stack_start >= info->client_info.stack_end) {
-                                       g_error ("BAD STACK: stack_start = %p, stack_start_limit = %p, stack_end = %p",
-                                               info->client_info.stack_start, info->client_info.stack_start_limit, info->client_info.stack_end);
-                               }
+                       /* altstack signal handler, sgen can't handle them, mono-threads should have handled this. */
+                       if (!info->client_info.stack_start
+                                || info->client_info.stack_start < info->client_info.stack_start_limit
+                                || info->client_info.stack_start >= info->client_info.stack_end) {
+                               g_error ("BAD STACK: stack_start = %p, stack_start_limit = %p, stack_end = %p",
+                                       info->client_info.stack_start, info->client_info.stack_start_limit, info->client_info.stack_end);
                        }
 
-                       binary_protocol_thread_suspend ((gpointer) mono_thread_info_get_tid (info), info->client_info.stopped_ip);
+                       stopped_ip = (gpointer) (MONO_CONTEXT_GET_IP (&info->client_info.ctx));
+
+                       THREADS_STW_DEBUG ("[GC-STW-SUSPEND-END] thread %p is suspended, stopped_ip = %p, stack = %p -> %p\n",
+                               mono_thread_info_get_tid (info), stopped_ip, info->client_info.stack_start, info->client_info.stack_start ? info->client_info.stack_end : NULL);
+
+                       binary_protocol_thread_suspend ((gpointer) mono_thread_info_get_tid (info), stopped_ip);
                } else {
                        THREADS_STW_DEBUG ("[GC-STW-SUSPEND-END] thread %p is NOT suspended, reason %d\n", mono_thread_info_get_tid (info), reason);
                        g_assert (!info->client_info.suspend_done || info == mono_thread_info_current ());
index 75f52c6628f35dcb0f44d9340eb1c971996b373a..bc4b2d293dd4771fa01947fb4e37cca1ecb67e56 100644 (file)
@@ -4,6 +4,7 @@
 #include <mono/metadata/metadata.h>
 #include <mono/metadata/image.h>
 #include <mono/metadata/loader.h>
+#include <mono/metadata/class-internals.h>
 #include <glib.h> /* GSList dep */
 
 MONO_BEGIN_DECLS
@@ -48,7 +49,7 @@ typedef struct {
 
 typedef struct {
        MonoVerifyInfo info;
-       int8_t exception_type; /*should be one of MONO_EXCEPTION_* */
+       MonoExceptionType exception_type : 8; /*should be one of MONO_EXCEPTION_* */
 } MonoVerifyInfoExtended;
 
 
index 4cceee20fe55c1bdbcd78abb3263a3cd2407bb0c..57835f473e99bd8bc58fd389046140d2bad1e775 100644 (file)
@@ -326,6 +326,9 @@ get_unwind_info_offset (MonoAotCompile *acfg, guint8 *encoded, guint32 encoded_l
 static char*
 get_plt_entry_debug_sym (MonoAotCompile *acfg, MonoJumpInfo *ji, GHashTable *cache);
 
+static void
+add_gsharedvt_wrappers (MonoAotCompile *acfg, MonoMethodSignature *sig, gboolean gsharedvt_in, gboolean gsharedvt_out);
+
 static void
 aot_printf (MonoAotCompile *acfg, const gchar *format, ...)
 {
@@ -4133,6 +4136,13 @@ add_wrappers (MonoAotCompile *acfg)
                        (method->iflags & METHOD_IMPL_ATTRIBUTE_INTERNAL_CALL)) {
                        add_method (acfg, mono_marshal_get_native_wrapper (method, TRUE, TRUE));
                }
+
+               if (method->iflags & METHOD_IMPL_ATTRIBUTE_INTERNAL_CALL) {
+                       if (acfg->aot_opts.llvm_only) {
+                               /* The wrappers have a different signature (hasthis is not set) so need to add this too */
+                               add_gsharedvt_wrappers (acfg, mono_method_signature (method), FALSE, TRUE);
+                       }
+               }
        }
  
        /* native-to-managed wrappers */
@@ -10500,7 +10510,7 @@ mono_compile_assembly (MonoAssembly *ass, guint32 opts, const char *aot_options)
                mini_llvm_init ();
 
                if (acfg->aot_opts.asm_only && !acfg->aot_opts.llvm_outfile) {
-                       aot_printerrf (acfg, "Compiling with LLVM and the asm-only option requires the llvm-outputfile= option.");
+                       aot_printerrf (acfg, "Compiling with LLVM and the asm-only option requires the llvm-outfile= option.\n");
                        return 1;
                }
        }
index 514a7332a39c52785728a9a8e8a2fdc655d7083a..14c97cbae30775317768cd2e19df55635904dc95 100644 (file)
@@ -1274,6 +1274,7 @@ mini_usage (void)
 #ifdef HOST_WIN32
                "    --mixed-mode           Enable mixed-mode image support.\n"
 #endif
+               "    --handlers             Install custom handlers, use --help-handlers for details.\n"
          );
 }
 
@@ -1556,6 +1557,10 @@ switch_arch (char* argv[], const char* target_arch)
 }
 
 #endif
+
+#define MONO_HANDLERS_ARGUMENT "--handlers="
+#define MONO_HANDLERS_ARGUMENT_LEN G_N_ELEMENTS(MONO_HANDLERS_ARGUMENT)-1
+
 /**
  * mono_main:
  * @argc: number of arguments in the argv array
@@ -1908,6 +1913,15 @@ mono_main (int argc, char* argv[])
                } else if (strcmp (argv [i], "--nacl-null-checks-off") == 0){
                        nacl_null_checks_off = TRUE;
 #endif
+               } else if (strncmp (argv [i], MONO_HANDLERS_ARGUMENT, MONO_HANDLERS_ARGUMENT_LEN) == 0) {
+                       //Install specific custom handlers.
+                       if (!mono_runtime_install_custom_handlers (argv[i] + MONO_HANDLERS_ARGUMENT_LEN)) {
+                               fprintf (stderr, "error: " MONO_HANDLERS_ARGUMENT ", one or more unknown handlers: '%s'\n", argv [i]);
+                               return 1;
+                       }
+               } else if (strcmp (argv [i], "--help-handlers") == 0) {
+                       mono_runtime_install_custom_handlers_usage ();
+                       return 0;
                } else if (argv [i][0] == '-' && argv [i][1] == '-' && mini_parse_debug_option (argv [i] + 2)) {
                } else {
                        fprintf (stderr, "Unknown command line option: '%s'\n", argv [i]);
index d737bc7f7f0768ab51457bf6008fda554de519d0..89985dea268e77879fc27c9912f14447820ff083 100644 (file)
@@ -536,7 +536,7 @@ mono_x86_resume_unwind (mgreg_t *regs, MonoObject *exc,
 static guint8*
 get_throw_trampoline (const char *name, gboolean rethrow, gboolean llvm, gboolean corlib, gboolean llvm_abs, gboolean resume_unwind, MonoTrampInfo **info, gboolean aot)
 {
-       guint8 *start, *code;
+       guint8 *start, *code, *labels [16];
        int i, stack_size, stack_offset, arg_offsets [5], regs_offset;
        MonoJumpInfo *ji = NULL;
        GSList *unwind_ops = NULL;
@@ -605,6 +605,18 @@ get_throw_trampoline (const char *name, gboolean rethrow, gboolean llvm, gboolea
        x86_lea_membase (code, X86_EAX, X86_ESP, stack_offset);
        x86_mov_membase_reg (code, X86_ESP, regs_offset + (X86_ESP * 4), X86_EAX, 4);
 
+       /* Clear fp stack */
+       labels [0] = code;
+       x86_fnstsw (code);
+       x86_shift_reg_imm (code, X86_SHR, X86_EAX, 11);
+       x86_alu_reg_imm (code, X86_AND, X86_EAX, 7);
+       x86_alu_reg_imm (code, X86_CMP, X86_EAX, 0);
+       labels [1] = code;
+       x86_branch8 (code, X86_CC_EQ, 0, FALSE);
+       x86_fstp (code, 0);
+       x86_jump_code (code, labels [0]);
+       mono_x86_patch (labels [1], code);
+
        /* Set arg1 == regs */
        x86_lea_membase (code, X86_EAX, X86_ESP, regs_offset);
        x86_mov_membase_reg (code, X86_ESP, arg_offsets [0], X86_EAX, 4);
index ad00295b8d291f8c9d4a7d1f60cd8e34fa15b088..297516cb32c6290db4e4ded20a96f869000a95c3 100644 (file)
@@ -7076,11 +7076,11 @@ emit_init_local (MonoCompile *cfg, int local, MonoType *type, gboolean init)
 /*
  * inline_method:
  *
- *   Return the cost of inlining CMETHOD.
+ * Return the cost of inlining CMETHOD, or zero if it should not be inlined.
  */
 static int
 inline_method (MonoCompile *cfg, MonoMethod *cmethod, MonoMethodSignature *fsig, MonoInst **sp,
-                          guchar *ip, guint real_offset, gboolean inline_always)
+              guchar *ip, guint real_offset, gboolean inline_always)
 {
        MonoError error;
        MonoInst *ins, *rvar = NULL;
@@ -8151,7 +8151,22 @@ emit_setret (MonoCompile *cfg, MonoInst *val)
 /*
  * mono_method_to_ir:
  *
- *   Translate the .net IL into linear IR.
+ * Translate the .net IL into linear IR.
+ *
+ * @start_bblock: if not NULL, the starting basic block, used during inlining.
+ * @end_bblock: if not NULL, the ending basic block, used during inlining.
+ * @return_var: if not NULL, the place where the return value is stored, used during inlining.   
+ * @inline_args: if not NULL, contains the arguments to the inline call
+ * @inline_offset: if not zero, the real offset from the inline call, or zero otherwise.
+ * @is_virtual_call: whether this method is being called as a result of a call to callvirt
+ *
+ * This method is used to turn ECMA IL into Mono's internal Linear IR
+ * reprensetation.  It is used both for entire methods, as well as
+ * inlining existing methods.  In the former case, the @start_bblock,
+ * @end_bblock, @return_var, @inline_args are all set to NULL, and the
+ * inline_offset is set to zero.
+ * 
+ * Returns: the inline cost, or -1 if there was an error processing this method.
  */
 int
 mono_method_to_ir (MonoCompile *cfg, MonoMethod *method, MonoBasicBlock *start_bblock, MonoBasicBlock *end_bblock, 
index 903739445c1a86806640ce725f856958421865f6..5342deb8b3a3027b899169417ae12da197786480 100644 (file)
@@ -2724,7 +2724,7 @@ mono_thread_state_init_from_sigctx (MonoThreadUnwindState *ctx, void *sigctx)
        MonoThreadInfo *thread = mono_thread_info_current_unchecked ();
        if (!thread) {
                ctx->valid = FALSE;
-               G_BREAKPOINT ();
+               g_error ("Invoked mono_thread_state_init_from_sigctx from non-Mono thread");
                return FALSE;
        }
 
index 736493198ed3b9556beb77bd842805959f7e862e..da5b3afc6c259ae2bfe8eda0229cc37c75f91b01 100644 (file)
@@ -3450,8 +3450,10 @@ mini_get_shared_method_full (MonoMethod *method, gboolean all_vt, gboolean is_gs
        if (method->wrapper_type == MONO_WRAPPER_DELEGATE_INVOKE) {
                WrapperInfo *info = mono_marshal_get_wrapper_info (method);
 
-               if (info->subtype == WRAPPER_SUBTYPE_NONE)
-                       return mono_marshal_get_delegate_invoke (mini_get_shared_method_full (info->d.delegate_invoke.method, all_vt, is_gsharedvt), NULL);
+               if (info->subtype == WRAPPER_SUBTYPE_NONE) {
+                       MonoMethod *m = mono_marshal_get_delegate_invoke (mini_get_shared_method_full (info->d.delegate_invoke.method, all_vt, is_gsharedvt), NULL);
+                       return m;
+               }
        }
 
        if (method->is_generic || (method->klass->generic_container && !method->is_inflated)) {
index 117260ff2c69be08a4c753aab164357cb23af4d1..3ccd8d705656f7b1b81c4719b117b4610c96d2df 100644 (file)
@@ -8389,7 +8389,7 @@ mono_llvm_create_aot_module (MonoAssembly *assembly, const char *global_prefix,
        module->llvm_only = llvm_only;
        /* The first few entries are reserved */
        module->max_got_offset = 16;
-       module->context = LLVMContextCreate ();
+       module->context = LLVMGetGlobalContext ();
 
        if (llvm_only)
                /* clang ignores our debug info because it has an invalid version */
index bdd3149c25bf25581ed0449fa8630a8eec6f02b0..14c13a4c683d03803203ba0b6dcc753605fc7f73 100644 (file)
@@ -59,7 +59,6 @@
 #include <mono/utils/dtrace.h>
 #include <mono/utils/mono-signal-handler.h>
 #include <mono/utils/mono-threads.h>
-#include <mono/utils/mono-threads-posix-signals.h>
 
 #include "mini.h"
 #include <string.h>
@@ -813,7 +812,7 @@ mono_runtime_setup_stat_profiler (void)
         */
 #if defined (USE_POSIX_BACKEND) && defined (SIGRTMIN) && !defined (PLATFORM_ANDROID)
        /* Just take the first real-time signal we can get. */
-       profiler_signal = mono_threads_posix_signal_search_alternative (-1);
+       profiler_signal = mono_threads_suspend_search_alternative_signal ();
 #else
        profiler_signal = SIGPROF;
 #endif
index 617682fcec32c60f83dba9f5456da1e2241351d2..92eb960a82278bc8c39c64cbb37d2cbeb5c5fb1f 100644 (file)
@@ -4256,3 +4256,23 @@ mono_personality (void)
        /* Not used */
        g_assert_not_reached ();
 }
+
+// Custom handlers currently only implemented by Windows.
+#ifndef HOST_WIN32
+gboolean
+mono_runtime_install_custom_handlers (const char *handlers)
+{
+       return FALSE;
+}
+
+void
+mono_runtime_install_custom_handlers_usage (void)
+{
+       fprintf (stdout,
+                "Custom Handlers:\n"
+                "   --handlers=HANDLERS            Enable handler support, HANDLERS is a comma\n"
+                "                                  separated list of available handlers to install.\n"
+                "\n"
+                "No handlers supported on current platform.\n");
+}
+#endif /* HOST_WIN32 */
index 2aa3a7b75d1bc21d177500be8388a7448a6991fd..728583f3bf1b6c504ffbf9b82614cad8dce5d701 100644 (file)
@@ -13,6 +13,8 @@
 #include <config.h>
 #include <signal.h>
 #include <math.h>
+#include <conio.h>
+#include <assert.h>
 
 #include <mono/metadata/assembly.h>
 #include <mono/metadata/loader.h>
 #include <mmsystem.h>
 #endif
 
+#define MONO_HANDLER_DELIMITER ','
+#define MONO_HANDLER_DELIMITER_LEN G_N_ELEMENTS(MONO_HANDLER_DELIMITER)-1
+
+#define MONO_HANDLER_ATEXIT_WAIT_KEYPRESS "atexit-waitkeypress"
+#define MONO_HANDLER_ATEXIT_WAIT_KEYPRESS_LEN G_N_ELEMENTS(MONO_HANDLER_ATEXIT_WAIT_KEYPRESS)-1
+
+// Typedefs used to setup handler table.
+typedef void (*handler)(void);
+
+typedef struct {
+       const char * cmd;
+       const int cmd_len;
+       handler handler;
+} HandlerItem;
+
+#if G_HAVE_API_SUPPORT(HAVE_CLASSIC_WINAPI_SUPPORT)
+/**
+* atexit_wait_keypress:
+*
+* This function is installed as an atexit function making sure that the console is not terminated before the end user has a chance to read the result.
+* This can be handy in debug scenarios (running from within the debugger) since an exit of the process will close the console window
+* without giving the end user a chance to look at the output before closed.
+*/
+static void
+atexit_wait_keypress (void)
+{
+
+       fflush (stdin);
+
+       printf ("Press any key to continue . . . ");
+       fflush (stdout);
+
+       _getch ();
+
+       return;
+}
+
+/**
+* install_atexit_wait_keypress:
+*
+* This function installs the wait keypress exit handler.
+*/
+static void
+install_atexit_wait_keypress (void)
+{
+       atexit (atexit_wait_keypress);
+       return;
+}
+
+#else
+
+/**
+* install_atexit_wait_keypress:
+*
+* Not supported on WINAPI family.
+*/
+static void
+install_atexit_wait_keypress (void)
+{
+       return;
+}
+
+#endif /* G_HAVE_API_SUPPORT(HAVE_CLASSIC_WINAPI_SUPPORT) */
+
+// Table describing handlers that can be installed at process startup. Adding a new handler can be done by adding a new item to the table together with an install handler function.
+const HandlerItem g_handler_items[] = { { MONO_HANDLER_ATEXIT_WAIT_KEYPRESS, MONO_HANDLER_ATEXIT_WAIT_KEYPRESS_LEN, install_atexit_wait_keypress },
+                                       { NULL, 0, NULL } };
+
+/**
+ * get_handler_arg_len:
+ * @handlers: Get length of next handler.
+ *
+ * This function calculates the length of next handler included in argument.
+ *
+ * Returns: The length of next handler, if available.
+ */
+static size_t
+get_next_handler_arg_len (const char *handlers)
+{
+       assert (handlers != NULL);
+
+       size_t current_len = 0;
+       const char *handler = strchr (handlers, MONO_HANDLER_DELIMITER);
+       if (handler != NULL) {
+               // Get length of next handler arg.
+               current_len = (handler - handlers);
+       } else {
+               // Consume rest as length of next handler arg.
+               current_len = strlen (handlers);
+       }
+
+       return current_len;
+}
+
+/**
+ * install_custom_handler:
+ * @handlers: Handlers included in --handler argument, example "atexit-waitkeypress,someothercmd,yetanothercmd".
+ * @handler_arg_len: Output, length of consumed handler.
+ *
+ * This function installs the next handler included in @handlers parameter.
+ *
+ * Returns: TRUE on successful install, FALSE on failure or unrecognized handler.
+ */
+static gboolean
+install_custom_handler (const char *handlers, size_t *handler_arg_len)
+{
+       gboolean result = FALSE;
+
+       assert (handlers != NULL);
+       assert (handler_arg_len);
+
+       *handler_arg_len = get_next_handler_arg_len (handlers);
+       for (int current_item = 0; current_item < G_N_ELEMENTS (g_handler_items); ++current_item) {
+               const HandlerItem * handler_item = &g_handler_items [current_item];
+
+               if (handler_item->cmd == NULL)
+                       continue;
+
+               if (*handler_arg_len == handler_item->cmd_len && strncmp (handlers, handler_item->cmd, *handler_arg_len) == 0) {
+                       assert (handler_item->handler != NULL);
+                       handler_item->handler ();
+                       result = TRUE;
+                       break;
+               }
+       }
+       return result;
+}
+
 void
 mono_runtime_install_handlers (void)
 {
@@ -69,6 +199,44 @@ mono_runtime_install_handlers (void)
 #endif
 }
 
+gboolean
+mono_runtime_install_custom_handlers (const char *handlers)
+{
+       gboolean result = FALSE;
+
+       assert (handlers != NULL);
+       while (*handlers != '\0') {
+               size_t handler_arg_len = 0;
+
+               result = install_custom_handler (handlers, &handler_arg_len);
+               handlers += handler_arg_len;
+
+               if (*handlers == MONO_HANDLER_DELIMITER)
+                       handlers++;
+               if (!result)
+                       break;
+       }
+
+       return result;
+}
+
+void
+mono_runtime_install_custom_handlers_usage (void)
+{
+       fprintf (stdout,
+                "Custom Handlers:\n"
+                "   --handlers=HANDLERS            Enable handler support, HANDLERS is a comma\n"
+                "                                  separated list of available handlers to install.\n"
+                "\n"
+#if G_HAVE_API_SUPPORT(HAVE_CLASSIC_WINAPI_SUPPORT)
+                "HANDLERS is composed of:\n"
+                "    atexit-waitkeypress           Install an atexit handler waiting for a keypress\n"
+                "                                  before exiting process.\n");
+#else
+                "No handlers supported on current platform.\n");
+#endif /* G_HAVE_API_SUPPORT(HAVE_CLASSIC_WINAPI_SUPPORT) */
+}
+
 void
 mono_runtime_cleanup_handlers (void)
 {
index dd24cd540b12b9ff16146e1192d68942ef79c60e..03ef9f89f199d3c3e606e3cf92af06d78fe8c600 100644 (file)
@@ -1743,7 +1743,7 @@ typedef struct {
        guint8          *thunks;
        /* Offset between the start of code and the thunks area */
        int              thunks_offset;
-       guint32          exception_type;        /* MONO_EXCEPTION_* */
+       MonoExceptionType exception_type;       /* MONO_EXCEPTION_* */
        guint32          exception_data;
        char*            exception_message;
        gpointer         exception_ptr;
@@ -3152,6 +3152,8 @@ gboolean mono_jit_map_is_enabled (void);
  * Per-OS implementation functions.
  */
 void mono_runtime_install_handlers (void);
+gboolean mono_runtime_install_custom_handlers (const char *handlers);
+void mono_runtime_install_custom_handlers_usage (void);
 void mono_runtime_cleanup_handlers (void);
 void mono_runtime_setup_stat_profiler (void);
 void mono_runtime_shutdown_stat_profiler (void);
index b026849239506c1ab87c22de654a055f66193fe1..511e581b66e8de2ea699639b8c4e1102b9835645 100644 (file)
@@ -470,8 +470,7 @@ BASE_TEST_CS_SRC_UNIVERSAL=         \
        bug-29585.cs    \
        priority.cs     \
        abort-cctor.cs  \
-       thread-native-exit.cs \
-       reference-loader.cs
+       thread-native-exit.cs
 
 if INSTALL_MOBILE_STATIC
 BASE_TEST_CS_SRC= \
@@ -693,6 +692,7 @@ DISABLED_TESTS=                     \
        bug-459094.exe \
        delegate-invoke.exe \
        bug-Xamarin-5278.exe \
+       reference-loader.cs \
        $(PLATFORM_DISABLED_TESTS) \
        $(EXTRA_DISABLED_TESTS) \
        $(COOP_DISABLED_TESTS) \
@@ -789,7 +789,8 @@ TEST_IL_SRC_UNIVERSAL=                      \
        delegate-with-null-target.il    \
        bug-318677.il   \
        gsharing-valuetype-layout.il    \
-       invalid_generic_instantiation.il
+       invalid_generic_instantiation.il \
+       bug-45841-fpstack-exceptions.il
 
 if INSTALL_MOBILE_STATIC
 TEST_IL_SRC= \
diff --git a/mono/tests/bug-45841-fpstack-exceptions.il b/mono/tests/bug-45841-fpstack-exceptions.il
new file mode 100644 (file)
index 0000000..d657476
--- /dev/null
@@ -0,0 +1,165 @@
+
+// Metadata version: v4.0.30319
+.assembly extern mscorlib
+{
+  .publickeytoken = (B7 7A 5C 56 19 34 E0 89 )                         // .z\V.4..
+  .ver 4:0:0:0
+}
+.assembly extern System.Data
+{
+  .publickeytoken = (B7 7A 5C 56 19 34 E0 89 )                         // .z\V.4..
+  .ver 4:0:0:0
+}
+.assembly x
+{
+  .custom instance void [mscorlib]System.Runtime.CompilerServices.CompilationRelaxationsAttribute::.ctor(int32) = ( 01 00 08 00 00 00 00 00 ) 
+  .custom instance void [mscorlib]System.Runtime.CompilerServices.RuntimeCompatibilityAttribute::.ctor() = ( 01 00 01 00 54 02 16 57 72 61 70 4E 6F 6E 45 78   // ....T..WrapNonEx
+                                                                                                             63 65 70 74 69 6F 6E 54 68 72 6F 77 73 01 )       // ceptionThrows.
+  .custom instance void [mscorlib]System.Diagnostics.DebuggableAttribute::.ctor(valuetype [mscorlib]System.Diagnostics.DebuggableAttribute/DebuggingModes) = ( 01 00 02 00 00 00 00 00 ) 
+  .hash algorithm 0x00008004
+  .ver 0:0:0:0
+}
+.module x.exe
+// MVID: {0EDDDD7B-2C90-4D6D-9C28-383B7DA8A1EB}
+.imagebase 0x00400000
+.file alignment 0x00000200
+.stackreserve 0x00100000
+.subsystem 0x0003       // WINDOWS_CUI
+.corflags 0x00000001    //  ILONLY
+
+
+// =============== CLASS MEMBERS DECLARATION ===================
+
+.class public auto ansi beforefieldinit SqlSingleTest
+       extends [mscorlib]System.Object
+{
+  .method public hidebysig static int32 Main() cil managed
+  {
+    .entrypoint
+    // Code size       164 (0xa4)
+    .maxstack  2
+    .locals init (valuetype [System.Data]System.Data.SqlTypes.SqlDecimal V_0)
+    .try
+    {
+               ldc.r8 5
+       newobj     instance void [mscorlib]System.OverflowException::.ctor(string)
+       throw
+                         pop
+      IL_001c:  leave.s    IL_0021
+
+    }  // end .try
+    catch [mscorlib]System.Exception 
+    {
+      IL_001e:  pop
+      IL_001f:  leave.s    IL_0021
+
+    }  // end handler
+    IL_0021:  nop
+    .try
+    {
+               ldc.r8 5
+       newobj     instance void [mscorlib]System.OverflowException::.ctor(string)
+       throw
+                         pop
+      IL_002e:  leave.s    IL_0033
+
+    }  // end .try
+    catch [mscorlib]System.Exception 
+    {
+      IL_0030:  pop
+      IL_0031:  leave.s    IL_0033
+
+    }  // end handler
+    IL_0033:  nop
+    .try
+    {
+               ldc.r8 5
+       newobj     instance void [mscorlib]System.OverflowException::.ctor(string)
+       throw
+      IL_0044:  leave.s    IL_0049
+
+    }  // end .try
+    catch [mscorlib]System.Exception 
+    {
+      IL_0046:  pop
+      IL_0047:  leave.s    IL_0049
+
+    }  // end handler
+    IL_0049:  nop
+    .try
+    {
+               ldc.r8 5
+       newobj     instance void [mscorlib]System.OverflowException::.ctor(string)
+       throw
+               pop
+      IL_005a:  leave.s    IL_005f
+
+    }  // end .try
+    catch [mscorlib]System.Exception 
+    {
+      IL_005c:  pop
+      IL_005d:  leave.s    IL_005f
+
+    }  // end handler
+    IL_005f:  nop
+    .try
+    {
+               ldc.r8 5
+       newobj     instance void [mscorlib]System.OverflowException::.ctor(string)
+       throw
+               pop
+      IL_006c:  leave.s    IL_0071
+
+    }  // end .try
+    catch [mscorlib]System.Exception 
+    {
+      IL_006e:  pop
+      IL_006f:  leave.s    IL_0071
+
+    }  // end handler
+    IL_0071:  nop
+    .try
+    {
+               ldc.r8 5
+       newobj     instance void [mscorlib]System.OverflowException::.ctor(string)
+       throw
+               pop
+      IL_0082:  leave.s    IL_0087
+
+    }  // end .try
+    catch [mscorlib]System.Exception 
+    {
+      IL_0084:  pop
+      IL_0085:  leave.s    IL_0087
+
+    }  // end handler
+       IL_0087:        
+    ldloca.s   V_0
+    IL_0089:  ldc.r8     5
+    IL_0092:  call       instance void [System.Data]System.Data.SqlTypes.SqlDecimal::.ctor(float64)
+    IL_0097:  ldloca.s   V_0
+    IL_0099:  call       instance valuetype [mscorlib]System.Decimal [System.Data]System.Data.SqlTypes.SqlDecimal::get_Value()
+    call       float64 [mscorlib]System.Decimal::ToDouble([mscorlib]System.Decimal)
+       ldc.r8 5
+       ceq
+       ldc.i4 0
+       ceq
+    ret
+  } // end of method SqlSingleTest::Main
+
+  .method public hidebysig specialname rtspecialname 
+          instance void  .ctor() cil managed
+  {
+    // Code size       7 (0x7)
+    .maxstack  8
+    IL_0000:  ldarg.0
+    IL_0001:  call       instance void [mscorlib]System.Object::.ctor()
+    IL_0006:  ret
+  } // end of method SqlSingleTest::.ctor
+
+} // end of class SqlSingleTest
+
+
+// =============================================================
+
+// *********** DISASSEMBLY COMPLETE ***********************
index 340b28f2678511b1bba7f8a9aadc9fac4502e3c5..499cf9e8d0075fb7e82282a5fd2fa29de18eb3d3 100644 (file)
@@ -38,6 +38,8 @@ public class main {
        for (int i = 0; i < st.FrameCount; ++i) {
            StackFrame sf = st.GetFrame (i);
            MethodBase m = sf.GetMethod ();
+               if (m == null)
+                       continue;
            Type t = m.DeclaringType;
            if (m.IsGenericMethod) {
                Type[] margs = m.GetGenericArguments ();
index 8d5cfb619f0657d5ab751afc0f509ba163b296f9..075ef08bc48c809174db8e1e6d87f594713fa550 100644 (file)
@@ -746,6 +746,21 @@ public class Tests {
                return mono_test_marshal_array_delegate1 (null, 0, new ArrayDelegate1 (array_delegate2));
        }
 
+       public delegate int ArrayDelegateBlittable (int i, string j,
+                                                                               [In, MarshalAs(UnmanagedType.LPArray,
+                                                                                                          ArraySubType=UnmanagedType.LPStr, SizeParamIndex=0)] int[] arr);
+
+       [DllImport ("libtest", EntryPoint="mono_test_marshal_array_delegate")]
+       public static extern int mono_test_marshal_array_delegate1 (string[] arr, int len, ArrayDelegateBlittable d);
+
+       public static int array_delegate_null_blittable (int i, string j, int[] arr) {
+               return (arr == null) ? 0 : 1;
+       }
+
+       public static int test_0_marshal_array_delegate_null_blittable () {
+               return mono_test_marshal_array_delegate1 (null, 0, new ArrayDelegateBlittable (array_delegate_null_blittable));
+       }
+
        public delegate int ArrayDelegate3 (int i, 
                                                                                string j, 
                                                                                [In, MarshalAs(UnmanagedType.LPArray, 
index 5bc5bbd600326c90c774a43f7280e805ff0e1c04..add4c6a85fe6da74faa03cc6ddd9b7d720f4fbd1 100644 (file)
@@ -11,7 +11,20 @@ mono-dtrace.h: $(top_srcdir)/data/mono.d
 
 endif
 
+if HOST_WIN32
+win32_sources = \
+       os-event-win32.c
+
+platform_sources = $(win32_sources)
+else
+unix_sources = \
+       os-event-unix.c
+
+platform_sources = $(unix_sources)
+endif
+
 monoutils_sources = \
+       $(platform_sources)     \
        mono-md5.c              \
        mono-sha1.c             \
        mono-logger.c           \
@@ -113,7 +126,6 @@ monoutils_sources = \
        mono-threads-state-machine.c    \
        mono-threads-posix.c    \
        mono-threads-posix-signals.c    \
-       mono-threads-posix-signals.h    \
        mono-threads-mach.c     \
        mono-threads-mach-helper.c      \
        mono-threads-windows.c  \
@@ -123,12 +135,10 @@ monoutils_sources = \
        mono-threads-openbsd.c  \
        mono-threads-android.c  \
        mono-threads.h  \
+       mono-threads-debug.h    \
        mono-threads-api.h      \
        mono-threads-coop.c     \
        mono-threads-coop.h     \
-       mono-threads-mach-abort-syscall.c       \
-       mono-threads-posix-abort-syscall.c      \
-       mono-threads-windows-abort-syscall.c    \
        mono-tls.h      \
        mono-tls.c      \
        linux_magic.h   \
@@ -164,7 +174,8 @@ monoutils_sources = \
        checked-build.c \
        checked-build.h \
        w32handle.c \
-       w32handle.h
+       w32handle.h \
+       os-event.h
 
 arch_sources = 
 
index 3416fe682071f24cc15d7f0898345600b0bf0dd9..22b232ad4d523edca38df6d2ae230e34990251a3 100644 (file)
@@ -27,6 +27,7 @@
 #include <mono/utils/mono-threads-coop.h>
 #include <mono/utils/mono-threads-api.h>
 #include <mono/utils/checked-build.h>
+#include <mono/utils/mono-threads-debug.h>
 
 #ifdef TARGET_OSX
 #include <mono/utils/mach-support.h>
diff --git a/mono/utils/mono-threads-debug.h b/mono/utils/mono-threads-debug.h
new file mode 100644 (file)
index 0000000..750d53d
--- /dev/null
@@ -0,0 +1,42 @@
+
+#ifndef __MONO_UTILS_MONO_THREADS_DEBUG_H__
+#define __MONO_UTILS_MONO_THREADS_DEBUG_H__
+
+/* Logging - enable them below if you need specific logging for the category you need */
+#define MOSTLY_ASYNC_SAFE_PRINTF(...) do { \
+       char __buff[1024];      __buff [0] = '\0'; \
+       g_snprintf (__buff, sizeof (__buff), __VA_ARGS__);      \
+       write (1, __buff, strlen (__buff));     \
+} while (0)
+
+#if 1
+#define THREADS_DEBUG(...)
+#else
+#define THREADS_DEBUG MOSTLY_ASYNC_SAFE_PRINTF
+#endif
+
+#if 1
+#define THREADS_STW_DEBUG(...)
+#else
+#define THREADS_STW_DEBUG MOSTLY_ASYNC_SAFE_PRINTF
+#endif
+
+#if 1
+#define THREADS_SUSPEND_DEBUG(...)
+#else
+#define THREADS_SUSPEND_DEBUG MOSTLY_ASYNC_SAFE_PRINTF
+#endif
+
+#if 1
+#define THREADS_STATE_MACHINE_DEBUG(...)
+#else
+#define THREADS_STATE_MACHINE_DEBUG MOSTLY_ASYNC_SAFE_PRINTF
+#endif
+
+#if 1
+#define THREADS_INTERRUPT_DEBUG(...)
+#else
+#define THREADS_INTERRUPT_DEBUG MOSTLY_ASYNC_SAFE_PRINTF
+#endif
+
+#endif /* __MONO_UTILS_MONO_THREADS_DEBUG_H__ */
diff --git a/mono/utils/mono-threads-mach-abort-syscall.c b/mono/utils/mono-threads-mach-abort-syscall.c
deleted file mode 100644 (file)
index eb43625..0000000
+++ /dev/null
@@ -1,89 +0,0 @@
-/*
- * mono-threads-mach-abort-syscall.c: Low-level syscall aborting
- *
- * Author:
- *     Ludovic Henry (ludovic@xamarin.com)
- *
- * (C) 2015 Xamarin, Inc
- */
-
-#include "config.h"
-#include <glib.h>
-
-#if defined (__MACH__)
-#define _DARWIN_C_SOURCE 1
-#endif
-
-#include <mono/utils/mono-threads.h>
-
-#if defined(USE_MACH_BACKEND)
-
-#if defined(HOST_WATCHOS) || defined(HOST_TVOS)
-
-void
-mono_threads_abort_syscall_init (void)
-{
-}
-
-void
-mono_threads_suspend_abort_syscall (MonoThreadInfo *info)
-{
-
-}
-
-gboolean
-mono_threads_suspend_needs_abort_syscall (void)
-{
-       return FALSE;
-}
-
-#else
-
-void
-mono_threads_abort_syscall_init (void)
-{
-}
-
-void
-mono_threads_suspend_abort_syscall (MonoThreadInfo *info)
-{
-       kern_return_t ret;
-
-       do {
-               ret = thread_suspend (info->native_handle);
-       } while (ret == KERN_ABORTED);
-
-       if (ret != KERN_SUCCESS)
-               return;
-
-       do {
-               ret = thread_abort_safely (info->native_handle);
-       } while (ret == KERN_ABORTED);
-
-       /*
-        * We are doing thread_abort when thread_abort_safely returns KERN_SUCCESS because
-        * for some reason accept is not interrupted by thread_abort_safely.
-        * The risk of aborting non-atomic operations while calling thread_abort should not
-        * exist because by the time thread_abort_safely returns KERN_SUCCESS the target
-        * thread should have return from the kernel and should be waiting for thread_resume
-        * to resume the user code.
-        */
-       if (ret == KERN_SUCCESS)
-               ret = thread_abort (info->native_handle);
-
-       do {
-               ret = thread_resume (info->native_handle);
-       } while (ret == KERN_ABORTED);
-
-       g_assert (ret == KERN_SUCCESS);
-}
-
-gboolean
-mono_threads_suspend_needs_abort_syscall (void)
-{
-       return TRUE;
-}
-
-#endif
-
-#endif
index 948804243ccc61d2f9a43420d7c4e806e300056f..b696064decdc986ea5305ef39a4aa4ee5a45242e 100644 (file)
@@ -23,6 +23,7 @@
 #include <mono/utils/mono-compiler.h>
 #include <mono/utils/mono-threads.h>
 #include <mono/utils/hazard-pointer.h>
+#include <mono/utils/mono-threads-debug.h>
 
 void
 mono_threads_suspend_init (void)
@@ -50,6 +51,18 @@ mono_threads_suspend_begin_async_resume (MonoThreadInfo *info)
        g_assert_not_reached ();
 }
 
+void
+mono_threads_suspend_abort_syscall (MonoThreadInfo *info)
+{
+       g_assert_not_reached ();
+}
+
+gboolean
+mono_threads_suspend_needs_abort_syscall (void)
+{
+       return FALSE;
+}
+
 #else /* defined(HOST_WATCHOS) || defined(HOST_TVOS) */
 
 gboolean
@@ -81,14 +94,14 @@ mono_threads_suspend_begin_async_suspend (MonoThreadInfo *info, gboolean interru
        }
        info->suspend_can_continue = mono_threads_get_runtime_callbacks ()->
                thread_state_init_from_handle (&info->thread_saved_state [ASYNC_SUSPEND_STATE_INDEX], info);
-       THREADS_SUSPEND_DEBUG ("thread state %p -> %d\n", (gpointer)(gsize)info->native_handle, res);
+       THREADS_SUSPEND_DEBUG ("thread state %p -> %d\n", (gpointer)(gsize)info->native_handle, ret);
        if (info->suspend_can_continue) {
                if (interrupt_kernel)
                        thread_abort (info->native_handle);
        } else {
                THREADS_SUSPEND_DEBUG ("FAILSAFE RESUME/2 %p -> %d\n", (gpointer)(gsize)info->native_handle, 0);
        }
-       return info->suspend_can_continue;
+       return TRUE;
 }
 
 gboolean
@@ -145,6 +158,46 @@ mono_threads_suspend_begin_async_resume (MonoThreadInfo *info)
        return ret == KERN_SUCCESS;
 }
 
+void
+mono_threads_suspend_abort_syscall (MonoThreadInfo *info)
+{
+       kern_return_t ret;
+
+       do {
+               ret = thread_suspend (info->native_handle);
+       } while (ret == KERN_ABORTED);
+
+       if (ret != KERN_SUCCESS)
+               return;
+
+       do {
+               ret = thread_abort_safely (info->native_handle);
+       } while (ret == KERN_ABORTED);
+
+       /*
+        * We are doing thread_abort when thread_abort_safely returns KERN_SUCCESS because
+        * for some reason accept is not interrupted by thread_abort_safely.
+        * The risk of aborting non-atomic operations while calling thread_abort should not
+        * exist because by the time thread_abort_safely returns KERN_SUCCESS the target
+        * thread should have return from the kernel and should be waiting for thread_resume
+        * to resume the user code.
+        */
+       if (ret == KERN_SUCCESS)
+               ret = thread_abort (info->native_handle);
+
+       do {
+               ret = thread_resume (info->native_handle);
+       } while (ret == KERN_ABORTED);
+
+       g_assert (ret == KERN_SUCCESS);
+}
+
+gboolean
+mono_threads_suspend_needs_abort_syscall (void)
+{
+       return TRUE;
+}
+
 #endif /* defined(HOST_WATCHOS) || defined(HOST_TVOS) */
 
 void
@@ -166,6 +219,35 @@ mono_threads_suspend_free (MonoThreadInfo *info)
        mach_port_deallocate (current_task (), info->native_handle);
 }
 
+void
+mono_threads_suspend_init_signals (void)
+{
+}
+
+gint
+mono_threads_suspend_search_alternative_signal (void)
+{
+       g_assert_not_reached ();
+}
+
+gint
+mono_threads_suspend_get_suspend_signal (void)
+{
+       return -1;
+}
+
+gint
+mono_threads_suspend_get_restart_signal (void)
+{
+       return -1;
+}
+
+gint
+mono_threads_suspend_get_abort_signal (void)
+{
+       return -1;
+}
+
 #endif /* USE_MACH_BACKEND */
 
 #ifdef __MACH__
diff --git a/mono/utils/mono-threads-posix-abort-syscall.c b/mono/utils/mono-threads-posix-abort-syscall.c
deleted file mode 100644 (file)
index 232161c..0000000
+++ /dev/null
@@ -1,44 +0,0 @@
-/*
- * mono-threads-posix-abort-syscall.c: Low-level syscall aborting
- *
- * Author:
- *     Ludovic Henry (ludovic@xamarin.com)
- *
- * (C) 2015 Xamarin, Inc
- */
-
-#include "config.h"
-#include <glib.h>
-
-#if defined (__MACH__)
-#define _DARWIN_C_SOURCE 1
-#endif
-
-#include "mono-threads.h"
-#include "mono-threads-posix-signals.h"
-
-#if defined(USE_POSIX_BACKEND)
-
-void
-mono_threads_abort_syscall_init (void)
-{
-       mono_threads_posix_init_signals (MONO_THREADS_POSIX_INIT_SIGNALS_ABORT);
-}
-
-void
-mono_threads_suspend_abort_syscall (MonoThreadInfo *info)
-{
-       /* We signal a thread to break it from the current syscall.
-        * This signal should not be interpreted as a suspend request. */
-       info->syscall_break_signal = TRUE;
-       if (!mono_threads_pthread_kill (info, mono_threads_posix_get_abort_signal ()))
-               mono_threads_add_to_pending_operation_set (info);
-}
-
-gboolean
-mono_threads_suspend_needs_abort_syscall (void)
-{
-       return TRUE;
-}
-
-#endif
index c1b67330fb566d54589fc7bf849770295007bff0..0c8e6b462b187f14f9a02dba0918722e0e2c54a5 100644 (file)
@@ -17,7 +17,7 @@
 #include <errno.h>
 #include <signal.h>
 
-#include "mono-threads-posix-signals.h"
+#include "mono-threads-debug.h"
 
 #if defined(__APPLE__) || defined(__OpenBSD__) || defined(__FreeBSD__) || defined(__FreeBSD_kernel__)
 #define DEFAULT_SUSPEND_SIGNAL SIGXFSZ
 #endif
 #define DEFAULT_RESTART_SIGNAL SIGXCPU
 
-static int suspend_signal_num;
-static int restart_signal_num;
 static int abort_signal_num;
 
 static sigset_t suspend_signal_mask;
 static sigset_t suspend_ack_signal_mask;
 
-//Can't avoid the circular dep on this. Will be gone pretty soon
-extern int mono_gc_get_suspend_signal (void);
-
-int
-mono_threads_posix_signal_search_alternative (int min_signal)
+gint
+mono_threads_suspend_search_alternative_signal (void)
 {
 #if !defined (SIGRTMIN)
        g_error ("signal search only works with RTMIN");
 #else
        int i;
        /* we try to avoid SIGRTMIN and any one that might have been set already, see bug #75387 */
-       for (i = MAX (min_signal, SIGRTMIN) + 1; i < SIGRTMAX; ++i) {
+       for (i = SIGRTMIN + 1; i < SIGRTMAX; ++i) {
                struct sigaction sinfo;
                sigaction (i, NULL, &sinfo);
                if (sinfo.sa_handler == SIG_DFL && (void*)sinfo.sa_sigaction == (void*)SIG_DFL) {
@@ -58,7 +53,9 @@ mono_threads_posix_signal_search_alternative (int min_signal)
 static void
 signal_add_handler (int signo, gpointer handler, int flags)
 {
-#if !defined(__native_client__)
+#if defined(__native_client__)
+       g_assert_not_reached ();
+#else
        /*FIXME, move the code from mini to utils and do the right thing!*/
        struct sigaction sa;
        struct sigaction previous_sa;
@@ -74,62 +71,21 @@ signal_add_handler (int signo, gpointer handler, int flags)
 #endif
 }
 
-static int
-suspend_signal_get (void)
-{
-#if defined(PLATFORM_ANDROID)
-       return SIGUNUSED;
-#elif !defined (SIGRTMIN)
-#ifdef SIGUSR1
-       return SIGUSR1;
-#else
-       return -1;
-#endif /* SIGUSR1 */
-#else
-       static int suspend_signum = -1;
-       if (suspend_signum == -1)
-               suspend_signum = mono_threads_posix_signal_search_alternative (-1);
-       return suspend_signum;
-#endif /* SIGRTMIN */
-}
-
-static int
-restart_signal_get (void)
-{
-#if defined(PLATFORM_ANDROID)
-       return SIGTTOU;
-#elif !defined (SIGRTMIN)
-#ifdef SIGUSR2
-       return SIGUSR2;
-#else
-       return -1;
-#endif /* SIGUSR1 */
-#else
-       static int resume_signum = -1;
-       if (resume_signum == -1)
-               resume_signum = mono_threads_posix_signal_search_alternative (suspend_signal_get () + 1);
-       return resume_signum;
-#endif /* SIGRTMIN */
-}
-
-
 static int
 abort_signal_get (void)
 {
 #if defined(PLATFORM_ANDROID)
        return SIGTTIN;
-#elif !defined (SIGRTMIN)
-#ifdef SIGTTIN
-       return SIGTTIN;
-#else
-       return -1;
-#endif /* SIGRTMIN */
-#else
+#elif defined (SIGRTMIN)
        static int abort_signum = -1;
        if (abort_signum == -1)
-               abort_signum = mono_threads_posix_signal_search_alternative (restart_signal_get () + 1);
+               abort_signum = mono_threads_suspend_search_alternative_signal ();
        return abort_signum;
-#endif /* SIGRTMIN */
+#elif defined (SIGTTIN)
+       return SIGTTIN;
+#else
+       return -1;
+#endif
 }
 
 static void
@@ -142,7 +98,7 @@ restart_signal_handler (int _dummy, siginfo_t *_info, void *context)
        int old_errno = errno;
 
        info = mono_thread_info_current ();
-       info->signal = restart_signal_num;
+       info->signal = DEFAULT_RESTART_SIGNAL;
        errno = old_errno;
 #endif
 }
@@ -206,7 +162,7 @@ suspend_signal_handler (int _dummy, siginfo_t *info, void *context)
        do {
                current->signal = 0;
                sigsuspend (&suspend_signal_mask);
-       } while (current->signal != restart_signal_num);
+       } while (current->signal != DEFAULT_RESTART_SIGNAL);
 
        /* Unblock the restart signal. */
        pthread_sigmask (SIG_UNBLOCK, &suspend_ack_signal_mask, NULL);
@@ -232,81 +188,52 @@ done:
 #endif
 }
 
-static void
-abort_signal_handler (int _dummy, siginfo_t *info, void *context)
-{
-#if defined(__native_client__)
-       g_assert_not_reached ();
-#else
-       suspend_signal_handler (_dummy, info, context);
-#endif
-}
-
 void
-mono_threads_posix_init_signals (MonoThreadPosixInitSignals signals)
+mono_threads_suspend_init_signals (void)
 {
        sigset_t signal_set;
 
-       g_assert ((signals == MONO_THREADS_POSIX_INIT_SIGNALS_SUSPEND_RESTART) ^ (signals == MONO_THREADS_POSIX_INIT_SIGNALS_ABORT));
-
        sigemptyset (&signal_set);
 
-       switch (signals) {
-       case MONO_THREADS_POSIX_INIT_SIGNALS_SUSPEND_RESTART: {
-               if (mono_thread_info_unified_management_enabled ()) {
-                       suspend_signal_num = DEFAULT_SUSPEND_SIGNAL;
-                       restart_signal_num = DEFAULT_RESTART_SIGNAL;
-               } else {
-                       suspend_signal_num = suspend_signal_get ();
-                       restart_signal_num = restart_signal_get ();
-               }
+       sigfillset (&suspend_signal_mask);
+       sigdelset (&suspend_signal_mask, DEFAULT_RESTART_SIGNAL);
 
-               sigfillset (&suspend_signal_mask);
-               sigdelset (&suspend_signal_mask, restart_signal_num);
-               if (!mono_thread_info_unified_management_enabled ())
-                       sigdelset (&suspend_signal_mask, mono_gc_get_suspend_signal ());
+       sigemptyset (&suspend_ack_signal_mask);
+       sigaddset (&suspend_ack_signal_mask, DEFAULT_RESTART_SIGNAL);
 
-               sigemptyset (&suspend_ack_signal_mask);
-               sigaddset (&suspend_ack_signal_mask, restart_signal_num);
+       signal_add_handler (DEFAULT_SUSPEND_SIGNAL, suspend_signal_handler, SA_RESTART);
+       signal_add_handler (DEFAULT_RESTART_SIGNAL, restart_signal_handler, SA_RESTART);
 
-               signal_add_handler (suspend_signal_num, suspend_signal_handler, SA_RESTART);
-               signal_add_handler (restart_signal_num, restart_signal_handler, SA_RESTART);
+       sigaddset (&signal_set, DEFAULT_SUSPEND_SIGNAL);
+       sigaddset (&signal_set, DEFAULT_RESTART_SIGNAL);
 
-               sigaddset (&signal_set, suspend_signal_num);
-               sigaddset (&signal_set, restart_signal_num);
+       abort_signal_num = abort_signal_get ();
 
-               break;
-       }
-       case MONO_THREADS_POSIX_INIT_SIGNALS_ABORT: {
-               abort_signal_num = abort_signal_get ();
-
-               signal_add_handler (abort_signal_num, abort_signal_handler, 0);
-
-               sigaddset (&signal_set, abort_signal_num);
+       /* the difference between abort and suspend here is made by not
+        * passing SA_RESTART, meaning we won't restart the syscall when
+        * receiving a signal */
+       signal_add_handler (abort_signal_num, suspend_signal_handler, 0);
 
-               break;
-       }
-       default: g_assert_not_reached ();
-       }
+       sigaddset (&signal_set, abort_signal_num);
 
        /* ensure all the new signals are unblocked */
        sigprocmask (SIG_UNBLOCK, &signal_set, NULL);
 }
 
 gint
-mono_threads_posix_get_suspend_signal (void)
+mono_threads_suspend_get_suspend_signal (void)
 {
-       return suspend_signal_num;
+       return DEFAULT_SUSPEND_SIGNAL;
 }
 
 gint
-mono_threads_posix_get_restart_signal (void)
+mono_threads_suspend_get_restart_signal (void)
 {
-       return restart_signal_num;
+       return DEFAULT_RESTART_SIGNAL;
 }
 
 gint
-mono_threads_posix_get_abort_signal (void)
+mono_threads_suspend_get_abort_signal (void)
 {
        return abort_signal_num;
 }
diff --git a/mono/utils/mono-threads-posix-signals.h b/mono/utils/mono-threads-posix-signals.h
deleted file mode 100644 (file)
index 59a38c1..0000000
+++ /dev/null
@@ -1,34 +0,0 @@
-
-#ifndef __MONO_THREADS_POSIX_SIGNALS_H__
-#define __MONO_THREADS_POSIX_SIGNALS_H__
-
-#include <config.h>
-#include <glib.h>
-
-#include "mono-threads.h"
-
-#if defined(USE_POSIX_BACKEND) || defined(USE_POSIX_SYSCALL_ABORT)
-
-typedef enum {
-       MONO_THREADS_POSIX_INIT_SIGNALS_SUSPEND_RESTART,
-       MONO_THREADS_POSIX_INIT_SIGNALS_ABORT,
-} MonoThreadPosixInitSignals;
-
-int
-mono_threads_posix_signal_search_alternative (int min_signal);
-
-void
-mono_threads_posix_init_signals (MonoThreadPosixInitSignals signals);
-
-gint
-mono_threads_posix_get_suspend_signal (void);
-
-gint
-mono_threads_posix_get_restart_signal (void);
-
-gint
-mono_threads_posix_get_abort_signal (void);
-
-#endif /* defined(USE_POSIX_BACKEND) || defined(USE_POSIX_SYSCALL_ABORT) */
-
-#endif /* __MONO_THREADS_POSIX_SIGNALS_H__ */
index 29486bac076f757f7882a401b576b661da675d82..be440711fb3bfcbdf3be365bd25876045dfe8bf5 100644 (file)
 #endif
 
 #include <mono/utils/mono-threads.h>
-#include <mono/utils/mono-threads-posix-signals.h>
 #include <mono/utils/mono-coop-semaphore.h>
 #include <mono/metadata/gc-internals.h>
 #include <mono/utils/w32handle.h>
+#include <mono/utils/mono-threads-debug.h>
 
 #include <errno.h>
 
@@ -368,7 +368,7 @@ mono_threads_platform_init (void)
 gboolean
 mono_threads_suspend_begin_async_suspend (MonoThreadInfo *info, gboolean interrupt_kernel)
 {
-       int sig = interrupt_kernel ? mono_threads_posix_get_abort_signal () :  mono_threads_posix_get_suspend_signal ();
+       int sig = interrupt_kernel ? mono_threads_suspend_get_abort_signal () :  mono_threads_suspend_get_suspend_signal ();
 
        if (!mono_threads_pthread_kill (info, sig)) {
                mono_threads_add_to_pending_operation_set (info);
@@ -393,7 +393,24 @@ gboolean
 mono_threads_suspend_begin_async_resume (MonoThreadInfo *info)
 {
        mono_threads_add_to_pending_operation_set (info);
-       return mono_threads_pthread_kill (info, mono_threads_posix_get_restart_signal ()) == 0;
+       return mono_threads_pthread_kill (info, mono_threads_suspend_get_restart_signal ()) == 0;
+}
+
+void
+mono_threads_suspend_abort_syscall (MonoThreadInfo *info)
+{
+       /* We signal a thread to break it from the current syscall.
+        * This signal should not be interpreted as a suspend request. */
+       info->syscall_break_signal = TRUE;
+       if (mono_threads_pthread_kill (info, mono_threads_suspend_get_abort_signal ()) == 0) {
+               mono_threads_add_to_pending_operation_set (info);
+       }
+}
+
+gboolean
+mono_threads_suspend_needs_abort_syscall (void)
+{
+       return TRUE;
 }
 
 void
@@ -412,7 +429,6 @@ mono_threads_suspend_free (MonoThreadInfo *info)
 void
 mono_threads_suspend_init (void)
 {
-       mono_threads_posix_init_signals (MONO_THREADS_POSIX_INIT_SIGNALS_SUSPEND_RESTART);
 }
 
 #endif /* defined(USE_POSIX_BACKEND) */
index 9792d5dbe217f09528628012ed96ed83b8e6ee7b..7696363229752a26592359024679133255b87cc9 100644 (file)
@@ -6,6 +6,7 @@
 #include <mono/utils/mono-memory-model.h>
 #include <mono/utils/atomic.h>
 #include <mono/utils/checked-build.h>
+#include <mono/utils/mono-threads-debug.h>
 
 #include <errno.h>
 
diff --git a/mono/utils/mono-threads-windows-abort-syscall.c b/mono/utils/mono-threads-windows-abort-syscall.c
deleted file mode 100644 (file)
index 02d25b7..0000000
+++ /dev/null
@@ -1,51 +0,0 @@
-/*
- * mono-threads-windows-abort-syscall.c: Low-level syscall aborting
- *
- * Author:
- *     Ludovic Henry (ludovic@xamarin.com)
- *
- * (C) 2015 Xamarin, Inc
- */
-
-#include "config.h"
-#include <glib.h>
-
-#include <mono/utils/mono-threads.h>
-
-#if defined(USE_WINDOWS_BACKEND)
-
-#include <limits.h>
-
-void
-mono_threads_abort_syscall_init (void)
-{
-}
-
-static void CALLBACK
-abort_apc (ULONG_PTR param)
-{
-       THREADS_INTERRUPT_DEBUG ("%06d - abort_apc () called", GetCurrentThreadId ());
-}
-
-void
-mono_threads_suspend_abort_syscall (MonoThreadInfo *info)
-{
-       DWORD id = mono_thread_info_get_tid (info);
-       HANDLE handle;
-
-       handle = OpenThread (THREAD_ALL_ACCESS, FALSE, id);
-       g_assert (handle);
-
-       THREADS_INTERRUPT_DEBUG ("%06d - Aborting syscall in thread %06d", GetCurrentThreadId (), id);
-       QueueUserAPC ((PAPCFUNC)abort_apc, handle, (ULONG_PTR)NULL);
-
-       CloseHandle (handle);
-}
-
-gboolean
-mono_threads_suspend_needs_abort_syscall (void)
-{
-       return TRUE;
-}
-
-#endif
index 791b898005ad36573273f75ac53d5b2fcdf032eb..9a8a93b96948afc523515992b7737553166263b3 100644 (file)
@@ -12,6 +12,7 @@
 #if defined(USE_WINDOWS_BACKEND)
 
 #include <mono/utils/mono-compiler.h>
+#include <mono/utils/mono-threads-debug.h>
 #include <limits.h>
 
 
@@ -63,7 +64,7 @@ mono_threads_suspend_begin_async_suspend (MonoThreadInfo *info, gboolean interru
        }
 
        CloseHandle (handle);
-       return info->suspend_can_continue;
+       return TRUE;
 }
 
 gboolean
@@ -72,6 +73,33 @@ mono_threads_suspend_check_suspend_result (MonoThreadInfo *info)
        return info->suspend_can_continue;
 }
 
+static void CALLBACK
+abort_apc (ULONG_PTR param)
+{
+       THREADS_INTERRUPT_DEBUG ("%06d - abort_apc () called", GetCurrentThreadId ());
+}
+
+void
+mono_threads_suspend_abort_syscall (MonoThreadInfo *info)
+{
+       DWORD id = mono_thread_info_get_tid (info);
+       HANDLE handle;
+
+       handle = OpenThread (THREAD_ALL_ACCESS, FALSE, id);
+       g_assert (handle);
+
+       THREADS_INTERRUPT_DEBUG ("%06d - Aborting syscall in thread %06d", GetCurrentThreadId (), id);
+       QueueUserAPC ((PAPCFUNC)abort_apc, handle, (ULONG_PTR)NULL);
+
+       CloseHandle (handle);
+}
+
+gboolean
+mono_threads_suspend_needs_abort_syscall (void)
+{
+       return TRUE;
+}
+
 gboolean
 mono_threads_suspend_begin_async_resume (MonoThreadInfo *info)
 {
@@ -128,6 +156,35 @@ mono_threads_suspend_free (MonoThreadInfo *info)
 {
 }
 
+void
+mono_threads_suspend_init_signals (void)
+{
+}
+
+gint
+mono_threads_suspend_search_alternative_signal (void)
+{
+       g_assert_not_reached ();
+}
+
+gint
+mono_threads_suspend_get_suspend_signal (void)
+{
+       return -1;
+}
+
+gint
+mono_threads_suspend_get_restart_signal (void)
+{
+       return -1;
+}
+
+gint
+mono_threads_suspend_get_abort_signal (void)
+{
+       return -1;
+}
+
 #endif
 
 #if defined (HOST_WIN32)
index 6ead6cfc23d1ba088f9654673d7ee14b45018d64..49031c860e505d51a23f97b3fe86ee4f3cb1f160 100644 (file)
@@ -29,6 +29,7 @@
 #include <mono/utils/mono-coop-mutex.h>
 #include <mono/utils/mono-coop-semaphore.h>
 #include <mono/utils/mono-threads-coop.h>
+#include <mono/utils/mono-threads-debug.h>
 
 #include <errno.h>
 
@@ -71,7 +72,6 @@ static gboolean mono_threads_inited = FALSE;
 
 static MonoSemType suspend_semaphore;
 static size_t pending_suspends;
-static gboolean unified_suspend_enabled;
 
 #define mono_thread_info_run_state(info) (((MonoThreadInfo*)info)->thread_state & THREAD_STATE_MASK)
 
@@ -674,8 +674,6 @@ mono_threads_init (MonoThreadInfoCallbacks *callbacks, size_t info_size)
 #endif
        g_assert (res);
 
-       unified_suspend_enabled = g_getenv ("MONO_ENABLE_UNIFIED_SUSPEND") != NULL || mono_threads_is_coop_enabled ();
-       
        if ((sleepLimit = g_getenv ("MONO_SLEEP_ABORT_LIMIT")) != NULL) {
                errno = 0;
                long threshold = strtol(sleepLimit, NULL, 10);
@@ -693,8 +691,8 @@ mono_threads_init (MonoThreadInfoCallbacks *callbacks, size_t info_size)
        mono_thread_smr_init ();
        mono_threads_platform_init ();
        mono_threads_suspend_init ();
+       mono_threads_suspend_init_signals ();
        mono_threads_coop_init ();
-       mono_threads_abort_syscall_init ();
 
 #if defined(__MACH__)
        mono_mach_init (thread_info_key);
@@ -1098,12 +1096,6 @@ mono_thread_info_abort_socket_syscall_for_close (MonoNativeThreadId tid)
        mono_thread_info_suspend_unlock ();
 }
 
-gboolean
-mono_thread_info_unified_management_enabled (void)
-{
-       return unified_suspend_enabled;
-}
-
 /*
  * mono_thread_info_set_is_async_context:
  *
index aebfaca9952904d246f54e863254c8054d92f97f..90c44c8b74df2cb4081b1cdfd9f7039cc62b6642 100644 (file)
@@ -90,44 +90,6 @@ and reduce the number of casts drastically.
 
 /* Mono Threads internal configuration knows*/
 
-/* Logging - enable them below if you need specific logging for the category you need */
-#define MOSTLY_ASYNC_SAFE_PRINTF(...) do { \
-       char __buff[1024];      __buff [0] = '\0'; \
-       g_snprintf (__buff, sizeof (__buff), __VA_ARGS__);      \
-       write (1, __buff, strlen (__buff));     \
-} while (0)
-
-
-#if 1
-#define THREADS_DEBUG(...)
-#else
-#define THREADS_DEBUG MOSTLY_ASYNC_SAFE_PRINTF
-#endif
-
-#if 1
-#define THREADS_STW_DEBUG(...)
-#else
-#define THREADS_STW_DEBUG MOSTLY_ASYNC_SAFE_PRINTF
-#endif
-
-#if 1
-#define THREADS_SUSPEND_DEBUG(...)
-#else
-#define THREADS_SUSPEND_DEBUG MOSTLY_ASYNC_SAFE_PRINTF
-#endif
-
-#if 1
-#define THREADS_STATE_MACHINE_DEBUG(...)
-#else
-#define THREADS_STATE_MACHINE_DEBUG MOSTLY_ASYNC_SAFE_PRINTF
-#endif
-
-#if 1
-#define THREADS_INTERRUPT_DEBUG(...)
-#else
-#define THREADS_INTERRUPT_DEBUG MOSTLY_ASYNC_SAFE_PRINTF
-#endif
-
 /* If this is defined, use the signals backed on Mach. Debug only as signals can't be made usable on OSX. */
 // #define USE_SIGNALS_ON_MACH
 
@@ -370,9 +332,6 @@ mono_thread_info_end_self_suspend (void);
 
 //END of new API
 
-gboolean
-mono_thread_info_unified_management_enabled (void);
-
 void
 mono_thread_info_setup_async_call (THREAD_INFO_TYPE *info, void (*target_func)(void*), void *user_data);
 
@@ -475,12 +434,12 @@ This is called very early in the runtime, it cannot access any runtime facilitie
 */
 void mono_threads_suspend_init (void); //ok
 
+void mono_threads_suspend_init_signals (void);
+
 void mono_threads_platform_init (void);
 
 void mono_threads_coop_init (void);
 
-void mono_threads_abort_syscall_init (void);
-
 /*
 This begins async suspend. This function must do the following:
 
@@ -513,6 +472,10 @@ void mono_threads_suspend_register (THREAD_INFO_TYPE *info); //ok
 void mono_threads_suspend_free (THREAD_INFO_TYPE *info);
 void mono_threads_suspend_abort_syscall (THREAD_INFO_TYPE *info);
 gboolean mono_threads_suspend_needs_abort_syscall (void);
+gint mono_threads_suspend_search_alternative_signal (void);
+gint mono_threads_suspend_get_suspend_signal (void);
+gint mono_threads_suspend_get_restart_signal (void);
+gint mono_threads_suspend_get_abort_signal (void);
 
 void mono_threads_platform_register (THREAD_INFO_TYPE *info);
 void mono_threads_platform_unregister (THREAD_INFO_TYPE *info);
diff --git a/mono/utils/os-event-unix.c b/mono/utils/os-event-unix.c
new file mode 100644 (file)
index 0000000..12ef05c
--- /dev/null
@@ -0,0 +1,312 @@
+/*
+ * os-event-unix.c: MonoOSEvent on Unix
+ *
+ * Author:
+ *     Ludovic Henry (luhenry@microsoft.com)
+ *
+ * Licensed under the MIT license. See LICENSE file in the project root for full license information.
+ */
+
+#include "os-event.h"
+
+#include "atomic.h"
+#include "mono-lazy-init.h"
+#include "mono-threads.h"
+#include "mono-time.h"
+
+static mono_lazy_init_t status = MONO_LAZY_INIT_STATUS_NOT_INITIALIZED;
+
+static mono_mutex_t signal_mutex;
+static mono_cond_t signal_cond;
+
+static void
+initialize (void)
+{
+       mono_os_mutex_init (&signal_mutex);
+       mono_os_cond_init (&signal_cond);
+}
+
+void
+mono_os_event_init (MonoOSEvent *event, gboolean manual, gboolean initial)
+{
+       g_assert (event);
+
+       mono_lazy_initialize (&status, initialize);
+
+       mono_os_mutex_init (&event->mutex);
+       mono_os_cond_init (&event->cond);
+       event->signalled = initial;
+       event->manual = manual;
+       event->set_count = (initial && !manual) ? 1 : 0;
+}
+
+void
+mono_os_event_destroy (MonoOSEvent *event)
+{
+       g_assert (mono_lazy_is_initialized (&status));
+
+       g_assert (event);
+
+       mono_os_mutex_destroy (&event->mutex);
+       mono_os_cond_destroy (&event->cond);
+}
+
+static void
+mono_os_event_signal (MonoOSEvent *event, gboolean broadcast)
+{
+       g_assert (event);
+
+       mono_os_mutex_lock (&signal_mutex);
+
+       event->signalled = TRUE;
+
+       if (broadcast)
+               mono_os_cond_broadcast (&event->cond);
+       else
+               mono_os_cond_signal (&event->cond);
+
+       mono_os_cond_broadcast (&signal_cond);
+
+       mono_os_mutex_unlock (&signal_mutex);
+}
+
+void
+mono_os_event_set (MonoOSEvent *event)
+{
+       g_assert (mono_lazy_is_initialized (&status));
+
+       g_assert (event);
+
+       mono_os_mutex_lock (&event->mutex);
+
+       if (event->manual) {
+               mono_os_event_signal (event, FALSE);
+       } else {
+               event->set_count = 1;
+               mono_os_event_signal (event, TRUE);
+       }
+
+       mono_os_mutex_unlock (&event->mutex);
+}
+
+void
+mono_os_event_reset (MonoOSEvent *event)
+{
+       g_assert (mono_lazy_is_initialized (&status));
+
+       g_assert (event);
+
+       mono_os_mutex_lock (&event->mutex);
+
+       if (event->signalled)
+               event->signalled = FALSE;
+
+       event->set_count = 0;
+
+       mono_os_mutex_unlock (&event->mutex);
+}
+
+static gboolean
+mono_os_event_own (MonoOSEvent *event)
+{
+       g_assert (event);
+
+       if (!event->signalled)
+               return FALSE;
+
+       if (!event->manual) {
+               g_assert (event->set_count > 0);
+               event->set_count -= 1;
+
+               if (event->set_count == 0)
+                       mono_os_event_signal (event, FALSE);
+       }
+
+       return TRUE;
+}
+
+MonoOSEventWaitRet
+mono_os_event_wait_one (MonoOSEvent *event, guint32 timeout)
+{
+       MonoOSEventWaitRet ret;
+       gint64 start;
+
+       g_assert (mono_lazy_is_initialized (&status));
+
+       g_assert (event);
+
+       mono_os_mutex_lock (&event->mutex);
+
+       if (timeout != MONO_INFINITE_WAIT)
+               start = mono_msec_ticks ();
+
+       for (;;) {
+               if (mono_os_event_own (event)) {
+                       ret = MONO_OS_EVENT_WAIT_RET_SUCCESS_0;
+                       goto done;
+               }
+
+               if (timeout == MONO_INFINITE_WAIT) {
+                       mono_os_cond_wait (&event->cond, &event->mutex);
+               } else {
+                       gint64 elapsed;
+                       gint res;
+
+                       elapsed = mono_msec_ticks () - start;
+                       if (elapsed >= timeout) {
+                               ret = MONO_OS_EVENT_WAIT_RET_TIMEOUT;
+                               goto done;
+                       }
+
+                       res = mono_os_cond_timedwait (&event->cond, &event->mutex, timeout - elapsed);
+                       if (res != 0) {
+                               ret = MONO_OS_EVENT_WAIT_RET_TIMEOUT;
+                               goto done;
+                       }
+               }
+       }
+
+done:
+       mono_os_mutex_unlock (&event->mutex);
+
+       return ret;
+}
+
+static void
+mono_os_event_lock_events (MonoOSEvent **events, gsize nevents)
+{
+       gint i, j;
+
+retry:
+       for (i = 0; i < nevents; ++i) {
+               gint res;
+
+               res = mono_os_mutex_trylock (&events [i]->mutex);
+               if (res != 0) {
+                       for (j = i - 1; j >= 0; j--)
+                               mono_os_mutex_unlock (&events [j]->mutex);
+
+                       mono_thread_info_yield ();
+
+                       goto retry;
+               }
+       }
+}
+
+static void
+mono_os_event_unlock_events (MonoOSEvent **events, gsize nevents)
+{
+       gint i;
+
+       for (i = 0; i < nevents; ++i)
+               mono_os_mutex_unlock (&events [i]->mutex);
+}
+
+MonoOSEventWaitRet
+mono_os_event_wait_multiple (MonoOSEvent **events, gsize nevents, gboolean waitall, guint32 timeout)
+{
+       MonoOSEventWaitRet ret;
+       gint64 start;
+       gint i;
+
+       g_assert (mono_lazy_is_initialized (&status));
+
+       g_assert (events);
+       g_assert (nevents > 0);
+       g_assert (nevents <= MONO_OS_EVENT_WAIT_MAXIMUM_OBJECTS);
+
+       if (nevents == 1)
+               return mono_os_event_wait_one (events [0], timeout);
+
+       for (i = 0; i < nevents; ++i) {
+               g_assert (events [i]);
+       }
+
+       if (timeout != MONO_INFINITE_WAIT)
+               start = mono_msec_ticks ();
+
+       for (;;) {
+               gint count, lowest;
+               gboolean signalled;
+
+               mono_os_event_lock_events (events, nevents);
+
+               count = 0;
+               lowest = -1;
+
+               for (i = 0; i < nevents; ++i) {
+                       if (events [i]->signalled) {
+                               count += 1;
+                               if (lowest == -1)
+                                       lowest = i;
+                       }
+               }
+
+               signalled = (waitall && count == nevents) || (!waitall && count > 0);
+
+               if (signalled) {
+                       for (i = 0; i < nevents; ++i)
+                               mono_os_event_own (events [i]);
+               }
+
+               mono_os_event_unlock_events (events, nevents);
+
+               if (signalled) {
+                       ret = MONO_OS_EVENT_WAIT_RET_SUCCESS_0 + lowest;
+                       goto done;
+               }
+
+               mono_os_mutex_lock (&signal_mutex);
+
+               if (waitall) {
+                       signalled = TRUE;
+                       for (i = 0; i < nevents; ++i) {
+                               if (!events [i]->signalled) {
+                                       signalled = FALSE;
+                                       break;
+                               }
+                       }
+               } else {
+                       signalled = FALSE;
+                       for (i = 0; i < nevents; ++i) {
+                               if (events [i]->signalled) {
+                                       signalled = TRUE;
+                                       break;
+                               }
+                       }
+               }
+
+               if (signalled) {
+                       mono_os_mutex_unlock (&signal_mutex);
+                       continue;
+               }
+
+               if (timeout == MONO_INFINITE_WAIT) {
+                       mono_os_cond_wait (&signal_cond, &signal_mutex);
+               } else {
+                       gint64 elapsed;
+                       gint res;
+
+                       elapsed = mono_msec_ticks () - start;
+                       if (elapsed >= timeout) {
+                               mono_os_mutex_unlock (&signal_mutex);
+
+                               ret = MONO_OS_EVENT_WAIT_RET_TIMEOUT;
+                               goto done;
+                       }
+
+                       res = mono_os_cond_timedwait (&signal_cond, &signal_mutex, timeout - elapsed);
+                       if (res != 0) {
+                               mono_os_mutex_unlock (&signal_mutex);
+
+                               ret = MONO_OS_EVENT_WAIT_RET_TIMEOUT;
+                               goto done;
+                       }
+               }
+
+               mono_os_mutex_unlock (&signal_mutex);
+       }
+
+done:
+       return ret;
+}
diff --git a/mono/utils/os-event-win32.c b/mono/utils/os-event-win32.c
new file mode 100644 (file)
index 0000000..422283a
--- /dev/null
@@ -0,0 +1,118 @@
+/*
+ * os-event-win32.c: MonoOSEvent on Win32
+ *
+ * Author:
+ *     Ludovic Henry (luhenry@microsoft.com)
+ *
+ * Licensed under the MIT license. See LICENSE file in the project root for full license information.
+ */
+
+#include "os-event.h"
+
+#include <windows.h>
+#include <winbase.h>
+
+#include "atomic.h"
+
+void
+mono_os_event_init (MonoOSEvent *event, gboolean manual, gboolean initial)
+{
+       g_assert (event);
+
+       event->handle = CreateEvent (NULL, manual, initial, NULL);
+       if (G_UNLIKELY (!event->handle))
+               g_error ("%s: CreateEvent failed with error %d", __func__, GetLastError ());
+}
+
+void
+mono_os_event_destroy (MonoOSEvent *event)
+{
+       BOOL res;
+
+       g_assert (event);
+       g_assert (event->handle);
+
+       res = CloseHandle (event->handle);
+       if (G_UNLIKELY (res == 0))
+               g_error ("%s: CloseHandle failed with error %d", __func__, GetLastError ());
+}
+
+void
+mono_os_event_set (MonoOSEvent *event)
+{
+       BOOL res;
+
+       g_assert (event);
+       g_assert (event->handle);
+
+       res = SetEvent (event->handle);
+       if (G_UNLIKELY (res == 0))
+               g_error ("%s: SetEvent failed with error %d", __func__, GetLastError ());
+}
+
+void
+mono_os_event_reset (MonoOSEvent *event)
+{
+       BOOL res;
+
+       g_assert (event);
+       g_assert (event->handle);
+
+       res = ResetEvent (event->handle);
+       if (G_UNLIKELY (res == 0))
+               g_error ("%s: ResetEvent failed with error %d", __func__, GetLastError ());
+}
+
+MonoOSEventWaitRet
+mono_os_event_wait_one (MonoOSEvent *event, guint32 timeout)
+{
+       DWORD res;
+
+       g_assert (event);
+       g_assert (event->handle);
+
+       res = WaitForSingleObjectEx (event->handle, timeout, TRUE);
+       if (res == WAIT_OBJECT_0)
+               return MONO_OS_EVENT_WAIT_RET_SUCCESS_0;
+       else if (res == WAIT_IO_COMPLETION)
+               return MONO_OS_EVENT_WAIT_RET_ALERTED;
+       else if (res == WAIT_TIMEOUT)
+               return MONO_OS_EVENT_WAIT_RET_TIMEOUT;
+       else if (res == WAIT_FAILED)
+               g_error ("%s: WaitForSingleObjectEx failed with error %d", __func__, GetLastError ());
+       else
+               g_error ("%s: unknown res value %d", __func__, res);
+}
+
+MonoOSEventWaitRet
+mono_os_event_wait_multiple (MonoOSEvent **events, gsize nevents, gboolean waitall, guint32 timeout)
+{
+       DWORD res;
+       gpointer handles [MONO_OS_EVENT_WAIT_MAXIMUM_OBJECTS];
+       gint i;
+
+       g_assert (events);
+       g_assert (nevents > 0);
+       g_assert (nevents <= MONO_OS_EVENT_WAIT_MAXIMUM_OBJECTS);
+
+       if (nevents == 1)
+               return mono_os_event_wait_one (events [0], timeout);
+
+       for (i = 0; i < nevents; ++i) {
+               g_assert (events [i]);
+               g_assert (events [i]->handle);
+               handles [i] = events [i]->handle;
+       }
+
+       res = WaitForMultipleObjectsEx (nevents, handles, waitall, timeout, TRUE);
+       if (res >= WAIT_OBJECT_0 && res < WAIT_OBJECT_0 + MONO_OS_EVENT_WAIT_MAXIMUM_OBJECTS)
+               return MONO_OS_EVENT_WAIT_RET_SUCCESS_0 + (res - WAIT_OBJECT_0);
+       else if (res == WAIT_IO_COMPLETION)
+               return MONO_OS_EVENT_WAIT_RET_ALERTED;
+       else if (res == WAIT_TIMEOUT)
+               return MONO_OS_EVENT_WAIT_RET_TIMEOUT;
+       else if (res == WAIT_FAILED)
+               g_error ("%s: WaitForSingleObjectEx failed with error %d", __func__, GetLastError ());
+       else
+               g_error ("%s: unknown res value %d", __func__, res);
+}
diff --git a/mono/utils/os-event.h b/mono/utils/os-event.h
new file mode 100644 (file)
index 0000000..81260b9
--- /dev/null
@@ -0,0 +1,56 @@
+
+#ifndef _MONO_UTILS_OS_EVENT_H_
+#define _MONO_UTILS_OS_EVENT_H_
+
+#include <config.h>
+#include <glib.h>
+
+#include "mono-os-mutex.h"
+
+#ifndef MONO_INFINITE_WAIT
+#define MONO_INFINITE_WAIT ((guint32) 0xFFFFFFFF)
+#endif
+
+#define MONO_OS_EVENT_WAIT_MAXIMUM_OBJECTS 64
+
+typedef enum {
+       MONO_OS_EVENT_WAIT_RET_SUCCESS_0 =  0,
+       MONO_OS_EVENT_WAIT_RET_ALERTED   = -1,
+       MONO_OS_EVENT_WAIT_RET_TIMEOUT   = -2,
+} MonoOSEventWaitRet;
+
+typedef struct _MonoOSEvent MonoOSEvent;
+
+typedef void (*MonoOSEventFreeCb) (MonoOSEvent*);
+
+struct _MonoOSEvent {
+#ifdef HOST_WIN32
+       gpointer handle;
+#else
+       mono_mutex_t mutex;
+       mono_cond_t cond;
+       gboolean manual;
+       gboolean signalled;
+       guint32 set_count;
+#endif
+};
+
+void
+mono_os_event_init (MonoOSEvent *event, gboolean manual, gboolean initial);
+
+void
+mono_os_event_destroy (MonoOSEvent *event);
+
+void
+mono_os_event_set (MonoOSEvent *event);
+
+void
+mono_os_event_reset (MonoOSEvent *event);
+
+MonoOSEventWaitRet
+mono_os_event_wait_one (MonoOSEvent *event, guint32 timeout);
+
+MonoOSEventWaitRet
+mono_os_event_wait_multiple (MonoOSEvent **events, gsize nevents, gboolean waitall, guint32 timeout);
+
+#endif /* _MONO_UTILS_OS_EVENT_H_ */
index 06836b9b0f83279c80f69bfadb86467affbc24e2..c51ed6b6c19ba6920e63ea67f3e54d7402f0810c 100644 (file)
     <ClCompile Include="..\mono\metadata\mono-security.c" />\r
     <ClCompile Include="..\mono\metadata\seq-points-data.c" />\r
     <ClCompile Include="..\mono\metadata\sgen-mono.c" />\r
-    <ClCompile Include="..\mono\metadata\sgen-os-coop.c" />\r
     <ClCompile Include="..\mono\metadata\threadpool-ms-io.c" />\r
     <ClCompile Include="..\mono\metadata\threadpool-ms.c" />\r
     <ClCompile Include="..\mono\metadata\sgen-bridge.c" />\r
     <ClCompile Include="..\mono\metadata\sgen-new-bridge.c" />\r
     <ClCompile Include="..\mono\metadata\sgen-old-bridge.c" />\r
-    <ClCompile Include="..\mono\metadata\sgen-os-mach.c">\r
-      <ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">true</ExcludedFromBuild>\r
-      <ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">true</ExcludedFromBuild>\r
-      <ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">true</ExcludedFromBuild>\r
-      <ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Release|x64'">true</ExcludedFromBuild>\r
-    </ClCompile>\r
-    <ClCompile Include="..\mono\metadata\sgen-os-posix.c">\r
-      <ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">true</ExcludedFromBuild>\r
-      <ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">true</ExcludedFromBuild>\r
-      <ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">true</ExcludedFromBuild>\r
-      <ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Release|x64'">true</ExcludedFromBuild>\r
-    </ClCompile>\r
-    <ClCompile Include="..\mono\metadata\sgen-os-win32.c" />\r
     <ClCompile Include="..\mono\metadata\sgen-tarjan-bridge.c" />\r
     <ClCompile Include="..\mono\metadata\sgen-toggleref.c" />\r
     <ClCompile Include="..\mono\metadata\sgen-stw.c" />\r
index 10ea5f5b356ae49a74d1e9fa5acba34a46039444..e0257f56ee4d57bf89cfaaba9dcfb5db4e57cc6c 100644 (file)
     <ClCompile Include="..\mono\metadata\boehm-gc.c">\r
       <Filter>Source Files\boehm</Filter>\r
     </ClCompile>\r
-    <ClCompile Include="..\mono\metadata\sgen-os-mach.c">\r
-      <Filter>Source Files\sgen</Filter>\r
-    </ClCompile>\r
-    <ClCompile Include="..\mono\metadata\sgen-os-posix.c">\r
-      <Filter>Source Files\sgen</Filter>\r
-    </ClCompile>\r
-    <ClCompile Include="..\mono\metadata\sgen-os-win32.c">\r
-      <Filter>Source Files\sgen</Filter>\r
-    </ClCompile>\r
     <ClCompile Include="..\mono\metadata\appdomain.c">\r
       <Filter>Source Files\gc</Filter>\r
     </ClCompile>\r
     <ClCompile Include="..\mono\metadata\sre-save.c">\r
       <Filter>Source Files</Filter>\r
     </ClCompile>\r
-    <ClCompile Include="..\mono\metadata\sgen-os-coop.c">\r
-      <Filter>Source Files\sgen</Filter>\r
-    </ClCompile>\r
     <ClCompile Include="..\mono\metadata\socket-io-windows.c">\r
          <Filter>Source Files</Filter>\r
     </ClCompile>\r
index 5f2d80f47a6dee4d3cf0566fa981ec9ba4216a07..ae6dadbcc61146d58e65abbb5f1a488b72250a34 100644 (file)
     <ClCompile Include="..\mono\utils\mono-threads-windows.c" />\r
     <ClCompile Include="..\mono\utils\mono-threads.c" />\r
     <ClCompile Include="..\mono\utils\mono-threads-coop.c" />\r
-    <ClCompile Include="..\mono\utils\mono-threads-posix-abort-syscall.c">\r
-      <ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">true</ExcludedFromBuild>\r
-      <ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">true</ExcludedFromBuild>\r
-      <ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">true</ExcludedFromBuild>\r
-      <ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Release|x64'">true</ExcludedFromBuild>\r
-    </ClCompile>\r
-    <ClCompile Include="..\mono\utils\mono-threads-mach-abort-syscall.c">\r
-      <ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">true</ExcludedFromBuild>\r
-      <ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">true</ExcludedFromBuild>\r
-      <ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">true</ExcludedFromBuild>\r
-      <ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Release|x64'">true</ExcludedFromBuild>\r
-    </ClCompile>\r
-    <ClCompile Include="..\mono\utils\mono-threads-windows-abort-syscall.c" />\r
     <ClCompile Include="..\mono\utils\mono-time.c" />\r
     <ClCompile Include="..\mono\utils\mono-tls.c" />\r
     <ClCompile Include="..\mono\utils\mono-uri.c" />\r
     <ClCompile Include="..\mono\utils\mono-value-hash.c" />\r
     <ClCompile Include="..\mono\utils\monobitset.c" />\r
+    <ClCompile Include="..\mono\utils\os-event-win32.c" />\r
     <ClCompile Include="..\mono\utils\strenc.c" />\r
     <ClCompile Include="..\mono\utils\atomic.c" />\r
     <ClCompile Include="..\mono\utils\mono-hwcap.c" />\r
     <ClInclude Include="..\mono\utils\mono-threads.h" />\r
     <ClInclude Include="..\mono\utils\mono-threads-api.h" />\r
     <ClInclude Include="..\mono\utils\mono-threads-coop.h" />\r
-    <ClInclude Include="..\mono\utils\mono-threads-posix-signals.h" />\r
     <ClInclude Include="..\mono\utils\mono-time.h" />\r
     <ClInclude Include="..\mono\utils\mono-tls.h" />\r
     <ClInclude Include="..\mono\utils\mono-uri.h" />\r
     <ClInclude Include="..\mono\utils\mono-value-hash.h" />\r
     <ClInclude Include="..\mono\utils\monobitset.h" />\r
+    <ClInclude Include="..\mono\utils\os-event.h" />\r
     <ClInclude Include="..\mono\utils\strenc.h" />\r
     <ClInclude Include="..\mono\utils\valgrind.h" />\r
     <ClInclude Include="..\mono\utils\atomic.h" />\r
index f74ea0cb33c66b7a97f36ed73dd04fc2f5716d84..8ee4fbe7c970d69acf6a6fec35b887ca710aaec5 100644 (file)
     <ClCompile Include="..\mono\utils\mono-mmap-windows.c">\r
       <Filter>Source Files</Filter>\r
     </ClCompile>\r
+    <ClCompile Include="..\mono\utils\os-event-win32.c">\r
+      <Filter>Source Files</Filter>\r
+    </ClCompile>\r
   </ItemGroup>\r
   <ItemGroup>\r
     <ClInclude Include="..\mono\utils\atomic.h">\r
     <ClInclude Include="..\mono\utils\mono-proclib-windows.h">\r
       <Filter>Header Files</Filter>\r
     </ClInclude>\r
+    <ClInclude Include="..\mono\utils\os-event.h">\r
+      <Filter>Header Files</Filter>\r
+    </ClInclude>\r
   </ItemGroup>\r
   <ItemGroup>\r
     <Filter Include="Header Files">\r
index 984496144c490ac942f2ffa3bdaa5391a9b575a7..e5849b15aece7dd8642a3d9da1dba1d689833d61 100644 (file)
@@ -35,7 +35,7 @@
     </project>
     <project dir="class/System" library="System-basic">
       <boot>true</boot>
-      <flags>/codepage:65001 -d:NET_4_0 -d:NET_4_5 -d:MONO -d:BOOTSTRAP_BASIC -nowarn:1699 -lib:./../../class/lib/basic -optimize /noconfig -nowarn:618 -d:CONFIGURATION_2_0 -d:FEATURE_PAL,SYSTEM_NAMESPACE,MONO,PLATFORM_UNIX -d:MONO_FEATURE_PROCESS_START -d:MONO_FEATURE_THREAD_ABORT -d:MONO_FEATURE_THREAD_SUSPEND_RESUME -d:MONO_FEATURE_MULTIPLE_APPDOMAINS -unsafe -resource:resources/Asterisk.wav -resource:resources/Beep.wav -resource:resources/Exclamation.wav -resource:resources/Hand.wav -resource:resources/Question.wav -d:SECURITY_DEP -d:XML_DEP -d:MONO_SECURITY_ALIAS -d:CONFIGURATION_DEP -r:./../../class/lib/basic/System.Xml.dll -r:./../../class/lib/basic/System.Configuration.dll -r:MonoSecurity=./../../class/lib/basic/Mono.Security.dll</flags>
+      <flags>/codepage:65001 -d:NET_4_0 -d:NET_4_5 -d:MONO -d:BOOTSTRAP_BASIC -nowarn:1699 -lib:./../../class/lib/basic -optimize /noconfig -d:CONFIGURATION_2_0 -d:FEATURE_PAL,SYSTEM_NAMESPACE,MONO,PLATFORM_UNIX -d:MONO_FEATURE_PROCESS_START -d:MONO_FEATURE_THREAD_ABORT -d:MONO_FEATURE_THREAD_SUSPEND_RESUME -d:MONO_FEATURE_MULTIPLE_APPDOMAINS -unsafe -resource:resources/Asterisk.wav -resource:resources/Beep.wav -resource:resources/Exclamation.wav -resource:resources/Hand.wav -resource:resources/Question.wav -d:MONO_FEATURE_BTLS -d:SECURITY_DEP -d:XML_DEP -d:MONO_SECURITY_ALIAS -d:CONFIGURATION_DEP -r:./../../class/lib/basic/System.Xml.dll -r:./../../class/lib/basic/System.Configuration.dll -r:MonoSecurity=./../../class/lib/basic/Mono.Security.dll</flags>
       <output>System.dll</output>
       <built_sources></built_sources>
       <library_output>./../../class/lib/basic/System.dll</library_output>
@@ -90,7 +90,7 @@
     </project>
     <project dir="class/System" library="System-build">
       <boot>false</boot>
-      <flags>/codepage:65001 -d:NET_4_0 -d:NET_4_5 -d:MONO -nowarn:1699 -nostdlib -r:./../../class/lib/build/mscorlib.dll -optimize /noconfig -nowarn:618 -d:CONFIGURATION_2_0 -d:FEATURE_PAL,SYSTEM_NAMESPACE,MONO,PLATFORM_UNIX -d:MONO_FEATURE_PROCESS_START -d:MONO_FEATURE_THREAD_ABORT -d:MONO_FEATURE_THREAD_SUSPEND_RESUME -d:MONO_FEATURE_MULTIPLE_APPDOMAINS -unsafe -resource:resources/Asterisk.wav -resource:resources/Beep.wav -resource:resources/Exclamation.wav -resource:resources/Hand.wav -resource:resources/Question.wav -d:SECURITY_DEP -d:XML_DEP -d:MONO_SECURITY_ALIAS -d:CONFIGURATION_DEP -r:./../../class/lib/build/System.Xml.dll -r:./../../class/lib/build/System.Configuration.dll -r:MonoSecurity=./../../class/lib/build/Mono.Security.dll</flags>
+      <flags>/codepage:65001 -d:NET_4_0 -d:NET_4_5 -d:MONO -nowarn:1699 -nostdlib -r:./../../class/lib/build/mscorlib.dll -optimize /noconfig -d:CONFIGURATION_2_0 -d:FEATURE_PAL,SYSTEM_NAMESPACE,MONO,PLATFORM_UNIX -d:MONO_FEATURE_PROCESS_START -d:MONO_FEATURE_THREAD_ABORT -d:MONO_FEATURE_THREAD_SUSPEND_RESUME -d:MONO_FEATURE_MULTIPLE_APPDOMAINS -unsafe -resource:resources/Asterisk.wav -resource:resources/Beep.wav -resource:resources/Exclamation.wav -resource:resources/Hand.wav -resource:resources/Question.wav -d:MONO_FEATURE_BTLS -d:SECURITY_DEP -d:XML_DEP -d:MONO_SECURITY_ALIAS -d:CONFIGURATION_DEP -r:./../../class/lib/build/System.Xml.dll -r:./../../class/lib/build/System.Configuration.dll -r:MonoSecurity=./../../class/lib/build/Mono.Security.dll</flags>
       <output>System.dll</output>
       <built_sources></built_sources>
       <library_output>./../../class/lib/build/System.dll</library_output>
     </project>
     <project dir="class/System" library="System-bare-build">
       <boot>false</boot>
-      <flags>/codepage:65001 -d:NET_4_0 -d:NET_4_5 -d:MONO -nowarn:1699 -nostdlib -r:./../../class/lib/build/mscorlib.dll -optimize /noconfig -nowarn:618 -d:CONFIGURATION_2_0 -d:FEATURE_PAL,SYSTEM_NAMESPACE,MONO,PLATFORM_UNIX -d:MONO_FEATURE_PROCESS_START -d:MONO_FEATURE_THREAD_ABORT -d:MONO_FEATURE_THREAD_SUSPEND_RESUME -d:MONO_FEATURE_MULTIPLE_APPDOMAINS -unsafe -resource:resources/Asterisk.wav -resource:resources/Beep.wav -resource:resources/Exclamation.wav -resource:resources/Hand.wav -resource:resources/Question.wav</flags>
+      <flags>/codepage:65001 -d:NET_4_0 -d:NET_4_5 -d:MONO -nowarn:1699 -nostdlib -r:./../../class/lib/build/mscorlib.dll -optimize /noconfig -d:CONFIGURATION_2_0 -d:FEATURE_PAL,SYSTEM_NAMESPACE,MONO,PLATFORM_UNIX -d:MONO_FEATURE_PROCESS_START -d:MONO_FEATURE_THREAD_ABORT -d:MONO_FEATURE_THREAD_SUSPEND_RESUME -d:MONO_FEATURE_MULTIPLE_APPDOMAINS -unsafe -resource:resources/Asterisk.wav -resource:resources/Beep.wav -resource:resources/Exclamation.wav -resource:resources/Hand.wav -resource:resources/Question.wav -d:MONO_FEATURE_BTLS</flags>
       <output>System.dll</output>
       <built_sources></built_sources>
       <library_output>./../../class/lib/build/bare/System.dll</library_output>
     </project>
     <project dir="class/System" library="System-secxml-build">
       <boot>false</boot>
-      <flags>/codepage:65001 -d:NET_4_0 -d:NET_4_5 -d:MONO -nowarn:1699 -nostdlib -r:./../../class/lib/build/mscorlib.dll -optimize /noconfig -nowarn:618 -d:CONFIGURATION_2_0 -d:FEATURE_PAL,SYSTEM_NAMESPACE,MONO,PLATFORM_UNIX -d:MONO_FEATURE_PROCESS_START -d:MONO_FEATURE_THREAD_ABORT -d:MONO_FEATURE_THREAD_SUSPEND_RESUME -d:MONO_FEATURE_MULTIPLE_APPDOMAINS -unsafe -resource:resources/Asterisk.wav -resource:resources/Beep.wav -resource:resources/Exclamation.wav -resource:resources/Hand.wav -resource:resources/Question.wav -d:SECURITY_DEP -d:XML_DEP -d:MONO_SECURITY_ALIAS -r:./../../class/lib/build/bare/System.Xml.dll -r:MonoSecurity=./../../class/lib/build/Mono.Security.dll</flags>
+      <flags>/codepage:65001 -d:NET_4_0 -d:NET_4_5 -d:MONO -nowarn:1699 -nostdlib -r:./../../class/lib/build/mscorlib.dll -optimize /noconfig -d:CONFIGURATION_2_0 -d:FEATURE_PAL,SYSTEM_NAMESPACE,MONO,PLATFORM_UNIX -d:MONO_FEATURE_PROCESS_START -d:MONO_FEATURE_THREAD_ABORT -d:MONO_FEATURE_THREAD_SUSPEND_RESUME -d:MONO_FEATURE_MULTIPLE_APPDOMAINS -unsafe -resource:resources/Asterisk.wav -resource:resources/Beep.wav -resource:resources/Exclamation.wav -resource:resources/Hand.wav -resource:resources/Question.wav -d:MONO_FEATURE_BTLS -d:SECURITY_DEP -d:XML_DEP -d:MONO_SECURITY_ALIAS -r:./../../class/lib/build/bare/System.Xml.dll -r:MonoSecurity=./../../class/lib/build/Mono.Security.dll</flags>
       <output>System.dll</output>
       <built_sources></built_sources>
       <library_output>./../../class/lib/build/secxml/System.dll</library_output>
     </project>
     <project dir="class/System" library="System-net_4_x">
       <boot>false</boot>
-      <flags>/codepage:65001 -d:NET_4_0 -d:NET_4_5 -d:NET_4_6 -d:MONO -nowarn:1699 -nostdlib -r:./../../class/lib/net_4_x/mscorlib.dll -debug -optimize /noconfig -nowarn:618 -d:CONFIGURATION_2_0 -d:FEATURE_PAL,SYSTEM_NAMESPACE,MONO,PLATFORM_UNIX -d:MONO_FEATURE_PROCESS_START -d:MONO_FEATURE_THREAD_ABORT -d:MONO_FEATURE_THREAD_SUSPEND_RESUME -d:MONO_FEATURE_MULTIPLE_APPDOMAINS -unsafe -resource:resources/Asterisk.wav -resource:resources/Beep.wav -resource:resources/Exclamation.wav -resource:resources/Hand.wav -resource:resources/Question.wav -d:SECURITY_DEP -d:XML_DEP -d:MONO_SECURITY_ALIAS -d:CONFIGURATION_DEP -r:./../../class/lib/net_4_x/System.Xml.dll -r:./../../class/lib/net_4_x/System.Configuration.dll -r:MonoSecurity=./../../class/lib/net_4_x/Mono.Security.dll</flags>
+      <flags>/codepage:65001 -d:NET_4_0 -d:NET_4_5 -d:NET_4_6 -d:MONO -nowarn:1699 -nostdlib -r:./../../class/lib/net_4_x/mscorlib.dll -debug -optimize /noconfig -d:CONFIGURATION_2_0 -d:FEATURE_PAL,SYSTEM_NAMESPACE,MONO,PLATFORM_UNIX -d:MONO_FEATURE_PROCESS_START -d:MONO_FEATURE_THREAD_ABORT -d:MONO_FEATURE_THREAD_SUSPEND_RESUME -d:MONO_FEATURE_MULTIPLE_APPDOMAINS -unsafe -resource:resources/Asterisk.wav -resource:resources/Beep.wav -resource:resources/Exclamation.wav -resource:resources/Hand.wav -resource:resources/Question.wav -d:MONO_FEATURE_BTLS -d:SECURITY_DEP -d:XML_DEP -d:MONO_SECURITY_ALIAS -d:CONFIGURATION_DEP -r:./../../class/lib/net_4_x/System.Xml.dll -r:./../../class/lib/net_4_x/System.Configuration.dll -r:MonoSecurity=./../../class/lib/net_4_x/Mono.Security.dll</flags>
       <output>System.dll</output>
       <built_sources></built_sources>
       <library_output>./../../class/lib/net_4_x/System.dll</library_output>
     </project>
     <project dir="class/System" library="System-bare-net_4_x">
       <boot>false</boot>
-      <flags>/codepage:65001 -d:NET_4_0 -d:NET_4_5 -d:NET_4_6 -d:MONO -nowarn:1699 -nostdlib -r:./../../class/lib/net_4_x/mscorlib.dll -debug -optimize /noconfig -nowarn:618 -d:CONFIGURATION_2_0 -d:FEATURE_PAL,SYSTEM_NAMESPACE,MONO,PLATFORM_UNIX -d:MONO_FEATURE_PROCESS_START -d:MONO_FEATURE_THREAD_ABORT -d:MONO_FEATURE_THREAD_SUSPEND_RESUME -d:MONO_FEATURE_MULTIPLE_APPDOMAINS -unsafe -resource:resources/Asterisk.wav -resource:resources/Beep.wav -resource:resources/Exclamation.wav -resource:resources/Hand.wav -resource:resources/Question.wav</flags>
+      <flags>/codepage:65001 -d:NET_4_0 -d:NET_4_5 -d:NET_4_6 -d:MONO -nowarn:1699 -nostdlib -r:./../../class/lib/net_4_x/mscorlib.dll -debug -optimize /noconfig -d:CONFIGURATION_2_0 -d:FEATURE_PAL,SYSTEM_NAMESPACE,MONO,PLATFORM_UNIX -d:MONO_FEATURE_PROCESS_START -d:MONO_FEATURE_THREAD_ABORT -d:MONO_FEATURE_THREAD_SUSPEND_RESUME -d:MONO_FEATURE_MULTIPLE_APPDOMAINS -unsafe -resource:resources/Asterisk.wav -resource:resources/Beep.wav -resource:resources/Exclamation.wav -resource:resources/Hand.wav -resource:resources/Question.wav -d:MONO_FEATURE_BTLS</flags>
       <output>System.dll</output>
       <built_sources></built_sources>
       <library_output>./../../class/lib/net_4_x/bare/System.dll</library_output>
     </project>
     <project dir="class/System" library="System-secxml-net_4_x">
       <boot>false</boot>
-      <flags>/codepage:65001 -d:NET_4_0 -d:NET_4_5 -d:NET_4_6 -d:MONO -nowarn:1699 -nostdlib -r:./../../class/lib/net_4_x/mscorlib.dll -debug -optimize /noconfig -nowarn:618 -d:CONFIGURATION_2_0 -d:FEATURE_PAL,SYSTEM_NAMESPACE,MONO,PLATFORM_UNIX -d:MONO_FEATURE_PROCESS_START -d:MONO_FEATURE_THREAD_ABORT -d:MONO_FEATURE_THREAD_SUSPEND_RESUME -d:MONO_FEATURE_MULTIPLE_APPDOMAINS -unsafe -resource:resources/Asterisk.wav -resource:resources/Beep.wav -resource:resources/Exclamation.wav -resource:resources/Hand.wav -resource:resources/Question.wav -d:SECURITY_DEP -d:XML_DEP -d:MONO_SECURITY_ALIAS -r:./../../class/lib/net_4_x/bare/System.Xml.dll -r:MonoSecurity=./../../class/lib/net_4_x/Mono.Security.dll</flags>
+      <flags>/codepage:65001 -d:NET_4_0 -d:NET_4_5 -d:NET_4_6 -d:MONO -nowarn:1699 -nostdlib -r:./../../class/lib/net_4_x/mscorlib.dll -debug -optimize /noconfig -d:CONFIGURATION_2_0 -d:FEATURE_PAL,SYSTEM_NAMESPACE,MONO,PLATFORM_UNIX -d:MONO_FEATURE_PROCESS_START -d:MONO_FEATURE_THREAD_ABORT -d:MONO_FEATURE_THREAD_SUSPEND_RESUME -d:MONO_FEATURE_MULTIPLE_APPDOMAINS -unsafe -resource:resources/Asterisk.wav -resource:resources/Beep.wav -resource:resources/Exclamation.wav -resource:resources/Hand.wav -resource:resources/Question.wav -d:MONO_FEATURE_BTLS -d:SECURITY_DEP -d:XML_DEP -d:MONO_SECURITY_ALIAS -r:./../../class/lib/net_4_x/bare/System.Xml.dll -r:MonoSecurity=./../../class/lib/net_4_x/Mono.Security.dll</flags>
       <output>System.dll</output>
       <built_sources></built_sources>
       <library_output>./../../class/lib/net_4_x/secxml/System.dll</library_output>
     </project>
     <project dir="tools/mkbundle" library="mkbundle-net_4_x">
       <boot></boot>
-      <flags>/codepage:65001 -resource:template.c -resource:template_z.c -resource:template_main.c -d:STATIC,NO_SYMBOL_WRITER,NO_AUTHENTICODE -d:NET_4_0 -d:NET_4_5 -d:NET_4_6 -d:MONO -nowarn:1699 -nostdlib -r:./../../class/lib/net_4_x/mscorlib.dll -debug -optimize /noconfig -r:System.Xml -r:System -r:System.Core</flags>
+      <flags>/codepage:65001 -resource:template.c -resource:template_z.c -resource:template_main.c -d:STATIC,NO_SYMBOL_WRITER,NO_AUTHENTICODE -d:NET_4_0 -d:NET_4_5 -d:NET_4_6 -d:MONO -nowarn:1699 -nostdlib -r:./../../class/lib/net_4_x/mscorlib.dll -debug -optimize /noconfig -r:System.Xml -r:System -r:System.Core -r:System.IO.Compression.FileSystem</flags>
       <output>mkbundle.exe</output>
       <built_sources></built_sources>
       <library_output>./../../class/lib/net_4_x/mkbundle.exe</library_output>
     </project>
     <project dir="class/System" library="System-monodroid">
       <boot>false</boot>
-      <flags>/codepage:65001 -d:NET_1_1 -d:NET_2_0 -d:NET_2_1 -d:NET_3_5 -d:NET_4_0 -d:NET_4_5 -d:MONO -d:MOBILE,MOBILE_LEGACY -d:MOBILE_DYNAMIC -d:MONODROID -d:ANDROID -d:NETSTANDARD -nowarn:1699 -nostdlib -r:./../../class/lib/monodroid/mscorlib.dll -debug -optimize /noconfig -nowarn:618 -d:CONFIGURATION_2_0 -d:FEATURE_PAL,SYSTEM_NAMESPACE,MONO,PLATFORM_UNIX -d:MONO_FEATURE_PROCESS_START -d:MONO_FEATURE_THREAD_ABORT -d:MONO_FEATURE_THREAD_SUSPEND_RESUME -d:MONO_FEATURE_MULTIPLE_APPDOMAINS -unsafe -d:INSIDE_SYSTEM -d:SECURITY_DEP -d:SECURITY_DEP -d:XML_DEP -r:./../../class/lib/monodroid/System.Xml.dll -r:MonoSecurity=./../../class/lib/monodroid/Mono.Security.dll</flags>
+      <flags>/codepage:65001 -d:NET_1_1 -d:NET_2_0 -d:NET_2_1 -d:NET_3_5 -d:NET_4_0 -d:NET_4_5 -d:MONO -d:MOBILE,MOBILE_LEGACY -d:MOBILE_DYNAMIC -d:MONODROID -d:ANDROID -d:NETSTANDARD -nowarn:1699 -nostdlib -r:./../../class/lib/monodroid/mscorlib.dll -debug -optimize /noconfig -d:CONFIGURATION_2_0 -d:FEATURE_PAL,SYSTEM_NAMESPACE,MONO,PLATFORM_UNIX -d:MONO_FEATURE_PROCESS_START -d:MONO_FEATURE_THREAD_ABORT -d:MONO_FEATURE_THREAD_SUSPEND_RESUME -d:MONO_FEATURE_MULTIPLE_APPDOMAINS -unsafe -d:MONO_FEATURE_BTLS -d:INSIDE_SYSTEM -d:SECURITY_DEP -nowarn:618,1635 -d:SECURITY_DEP -d:XML_DEP -r:./../../class/lib/monodroid/System.Xml.dll -r:MonoSecurity=./../../class/lib/monodroid/Mono.Security.dll</flags>
       <output>System.dll</output>
       <built_sources></built_sources>
       <library_output>./../../class/lib/monodroid/System.dll</library_output>
     </project>
     <project dir="class/System" library="System-bare-monodroid">
       <boot>false</boot>
-      <flags>/codepage:65001 -d:NET_1_1 -d:NET_2_0 -d:NET_2_1 -d:NET_3_5 -d:NET_4_0 -d:NET_4_5 -d:MONO -d:MOBILE,MOBILE_LEGACY -d:MOBILE_DYNAMIC -d:MONODROID -d:ANDROID -d:NETSTANDARD -nowarn:1699 -nostdlib -r:./../../class/lib/monodroid/mscorlib.dll -debug -optimize /noconfig -nowarn:618 -d:CONFIGURATION_2_0 -d:FEATURE_PAL,SYSTEM_NAMESPACE,MONO,PLATFORM_UNIX -d:MONO_FEATURE_PROCESS_START -d:MONO_FEATURE_THREAD_ABORT -d:MONO_FEATURE_THREAD_SUSPEND_RESUME -d:MONO_FEATURE_MULTIPLE_APPDOMAINS -unsafe -d:INSIDE_SYSTEM -d:SECURITY_DEP</flags>
+      <flags>/codepage:65001 -d:NET_1_1 -d:NET_2_0 -d:NET_2_1 -d:NET_3_5 -d:NET_4_0 -d:NET_4_5 -d:MONO -d:MOBILE,MOBILE_LEGACY -d:MOBILE_DYNAMIC -d:MONODROID -d:ANDROID -d:NETSTANDARD -nowarn:1699 -nostdlib -r:./../../class/lib/monodroid/mscorlib.dll -debug -optimize /noconfig -d:CONFIGURATION_2_0 -d:FEATURE_PAL,SYSTEM_NAMESPACE,MONO,PLATFORM_UNIX -d:MONO_FEATURE_PROCESS_START -d:MONO_FEATURE_THREAD_ABORT -d:MONO_FEATURE_THREAD_SUSPEND_RESUME -d:MONO_FEATURE_MULTIPLE_APPDOMAINS -unsafe -d:MONO_FEATURE_BTLS -d:INSIDE_SYSTEM -d:SECURITY_DEP -nowarn:618,1635</flags>
       <output>System.dll</output>
       <built_sources></built_sources>
       <library_output>./../../class/lib/monodroid/bare/System.dll</library_output>
     </project>
     <project dir="class/System" library="System-secxml-monodroid">
       <boot>false</boot>
-      <flags>/codepage:65001 -d:NET_1_1 -d:NET_2_0 -d:NET_2_1 -d:NET_3_5 -d:NET_4_0 -d:NET_4_5 -d:MONO -d:MOBILE,MOBILE_LEGACY -d:MOBILE_DYNAMIC -d:MONODROID -d:ANDROID -d:NETSTANDARD -nowarn:1699 -nostdlib -r:./../../class/lib/monodroid/mscorlib.dll -debug -optimize /noconfig -nowarn:618 -d:CONFIGURATION_2_0 -d:FEATURE_PAL,SYSTEM_NAMESPACE,MONO,PLATFORM_UNIX -d:MONO_FEATURE_PROCESS_START -d:MONO_FEATURE_THREAD_ABORT -d:MONO_FEATURE_THREAD_SUSPEND_RESUME -d:MONO_FEATURE_MULTIPLE_APPDOMAINS -unsafe -d:INSIDE_SYSTEM -d:SECURITY_DEP -d:SECURITY_DEP -d:XML_DEP -r:./../../class/lib/monodroid/bare/System.Xml.dll -r:MonoSecurity=./../../class/lib/monodroid/Mono.Security.dll</flags>
+      <flags>/codepage:65001 -d:NET_1_1 -d:NET_2_0 -d:NET_2_1 -d:NET_3_5 -d:NET_4_0 -d:NET_4_5 -d:MONO -d:MOBILE,MOBILE_LEGACY -d:MOBILE_DYNAMIC -d:MONODROID -d:ANDROID -d:NETSTANDARD -nowarn:1699 -nostdlib -r:./../../class/lib/monodroid/mscorlib.dll -debug -optimize /noconfig -d:CONFIGURATION_2_0 -d:FEATURE_PAL,SYSTEM_NAMESPACE,MONO,PLATFORM_UNIX -d:MONO_FEATURE_PROCESS_START -d:MONO_FEATURE_THREAD_ABORT -d:MONO_FEATURE_THREAD_SUSPEND_RESUME -d:MONO_FEATURE_MULTIPLE_APPDOMAINS -unsafe -d:MONO_FEATURE_BTLS -d:INSIDE_SYSTEM -d:SECURITY_DEP -nowarn:618,1635 -d:SECURITY_DEP -d:XML_DEP -r:./../../class/lib/monodroid/bare/System.Xml.dll -r:MonoSecurity=./../../class/lib/monodroid/Mono.Security.dll</flags>
       <output>System.dll</output>
       <built_sources></built_sources>
       <library_output>./../../class/lib/monodroid/secxml/System.dll</library_output>
     </project>
     <project dir="class/System" library="System-monotouch">
       <boot>false</boot>
-      <flags>/codepage:65001 -d:NET_1_1 -d:NET_2_0 -d:NET_2_1 -d:NET_3_5 -d:NET_4_0 -d:NET_4_5 -d:MOBILE,MOBILE_LEGACY -d:MONO -d:MONOTOUCH -d:DISABLE_REMOTING -d:DISABLE_COM -d:FEATURE_INTERCEPTABLE_THREADPOOL_CALLBACK -d:NETSTANDARD -nowarn:1699 -nostdlib -r:./../../class/lib/monotouch/mscorlib.dll -debug -d:FULL_AOT_RUNTIME -optimize /noconfig -nowarn:618 -d:CONFIGURATION_2_0 -d:FEATURE_PAL,SYSTEM_NAMESPACE,MONO,PLATFORM_UNIX -d:MONO_FEATURE_PROCESS_START -d:MONO_FEATURE_THREAD_ABORT -d:MONO_FEATURE_THREAD_SUSPEND_RESUME -d:MONO_FEATURE_MULTIPLE_APPDOMAINS -unsafe -d:INSIDE_SYSTEM -d:SECURITY_DEP -d:SECURITY_DEP -d:XML_DEP -r:./../../class/lib/monotouch/System.Xml.dll -r:MonoSecurity=./../../class/lib/monotouch/Mono.Security.dll</flags>
+      <flags>/codepage:65001 -d:NET_1_1 -d:NET_2_0 -d:NET_2_1 -d:NET_3_5 -d:NET_4_0 -d:NET_4_5 -d:MOBILE,MOBILE_LEGACY -d:MONO -d:MONOTOUCH -d:DISABLE_REMOTING -d:DISABLE_COM -d:FEATURE_INTERCEPTABLE_THREADPOOL_CALLBACK -d:NETSTANDARD -nowarn:1699 -nostdlib -r:./../../class/lib/monotouch/mscorlib.dll -debug -d:FULL_AOT_RUNTIME -optimize /noconfig -d:CONFIGURATION_2_0 -d:FEATURE_PAL,SYSTEM_NAMESPACE,MONO,PLATFORM_UNIX -d:MONO_FEATURE_PROCESS_START -d:MONO_FEATURE_THREAD_ABORT -d:MONO_FEATURE_THREAD_SUSPEND_RESUME -d:MONO_FEATURE_MULTIPLE_APPDOMAINS -unsafe -d:INSIDE_SYSTEM -d:SECURITY_DEP -nowarn:618,1635 -d:SECURITY_DEP -d:XML_DEP -r:./../../class/lib/monotouch/System.Xml.dll -r:MonoSecurity=./../../class/lib/monotouch/Mono.Security.dll</flags>
       <output>System.dll</output>
       <built_sources></built_sources>
       <library_output>./../../class/lib/monotouch/System.dll</library_output>
     </project>
     <project dir="class/System" library="System-bare-monotouch">
       <boot>false</boot>
-      <flags>/codepage:65001 -d:NET_1_1 -d:NET_2_0 -d:NET_2_1 -d:NET_3_5 -d:NET_4_0 -d:NET_4_5 -d:MOBILE,MOBILE_LEGACY -d:MONO -d:MONOTOUCH -d:DISABLE_REMOTING -d:DISABLE_COM -d:FEATURE_INTERCEPTABLE_THREADPOOL_CALLBACK -d:NETSTANDARD -nowarn:1699 -nostdlib -r:./../../class/lib/monotouch/mscorlib.dll -debug -d:FULL_AOT_RUNTIME -optimize /noconfig -nowarn:618 -d:CONFIGURATION_2_0 -d:FEATURE_PAL,SYSTEM_NAMESPACE,MONO,PLATFORM_UNIX -d:MONO_FEATURE_PROCESS_START -d:MONO_FEATURE_THREAD_ABORT -d:MONO_FEATURE_THREAD_SUSPEND_RESUME -d:MONO_FEATURE_MULTIPLE_APPDOMAINS -unsafe -d:INSIDE_SYSTEM -d:SECURITY_DEP</flags>
+      <flags>/codepage:65001 -d:NET_1_1 -d:NET_2_0 -d:NET_2_1 -d:NET_3_5 -d:NET_4_0 -d:NET_4_5 -d:MOBILE,MOBILE_LEGACY -d:MONO -d:MONOTOUCH -d:DISABLE_REMOTING -d:DISABLE_COM -d:FEATURE_INTERCEPTABLE_THREADPOOL_CALLBACK -d:NETSTANDARD -nowarn:1699 -nostdlib -r:./../../class/lib/monotouch/mscorlib.dll -debug -d:FULL_AOT_RUNTIME -optimize /noconfig -d:CONFIGURATION_2_0 -d:FEATURE_PAL,SYSTEM_NAMESPACE,MONO,PLATFORM_UNIX -d:MONO_FEATURE_PROCESS_START -d:MONO_FEATURE_THREAD_ABORT -d:MONO_FEATURE_THREAD_SUSPEND_RESUME -d:MONO_FEATURE_MULTIPLE_APPDOMAINS -unsafe -d:INSIDE_SYSTEM -d:SECURITY_DEP -nowarn:618,1635</flags>
       <output>System.dll</output>
       <built_sources></built_sources>
       <library_output>./../../class/lib/monotouch/bare/System.dll</library_output>
     </project>
     <project dir="class/System" library="System-secxml-monotouch">
       <boot>false</boot>
-      <flags>/codepage:65001 -d:NET_1_1 -d:NET_2_0 -d:NET_2_1 -d:NET_3_5 -d:NET_4_0 -d:NET_4_5 -d:MOBILE,MOBILE_LEGACY -d:MONO -d:MONOTOUCH -d:DISABLE_REMOTING -d:DISABLE_COM -d:FEATURE_INTERCEPTABLE_THREADPOOL_CALLBACK -d:NETSTANDARD -nowarn:1699 -nostdlib -r:./../../class/lib/monotouch/mscorlib.dll -debug -d:FULL_AOT_RUNTIME -optimize /noconfig -nowarn:618 -d:CONFIGURATION_2_0 -d:FEATURE_PAL,SYSTEM_NAMESPACE,MONO,PLATFORM_UNIX -d:MONO_FEATURE_PROCESS_START -d:MONO_FEATURE_THREAD_ABORT -d:MONO_FEATURE_THREAD_SUSPEND_RESUME -d:MONO_FEATURE_MULTIPLE_APPDOMAINS -unsafe -d:INSIDE_SYSTEM -d:SECURITY_DEP -d:SECURITY_DEP -d:XML_DEP -r:./../../class/lib/monotouch/bare/System.Xml.dll -r:MonoSecurity=./../../class/lib/monotouch/Mono.Security.dll</flags>
+      <flags>/codepage:65001 -d:NET_1_1 -d:NET_2_0 -d:NET_2_1 -d:NET_3_5 -d:NET_4_0 -d:NET_4_5 -d:MOBILE,MOBILE_LEGACY -d:MONO -d:MONOTOUCH -d:DISABLE_REMOTING -d:DISABLE_COM -d:FEATURE_INTERCEPTABLE_THREADPOOL_CALLBACK -d:NETSTANDARD -nowarn:1699 -nostdlib -r:./../../class/lib/monotouch/mscorlib.dll -debug -d:FULL_AOT_RUNTIME -optimize /noconfig -d:CONFIGURATION_2_0 -d:FEATURE_PAL,SYSTEM_NAMESPACE,MONO,PLATFORM_UNIX -d:MONO_FEATURE_PROCESS_START -d:MONO_FEATURE_THREAD_ABORT -d:MONO_FEATURE_THREAD_SUSPEND_RESUME -d:MONO_FEATURE_MULTIPLE_APPDOMAINS -unsafe -d:INSIDE_SYSTEM -d:SECURITY_DEP -nowarn:618,1635 -d:SECURITY_DEP -d:XML_DEP -r:./../../class/lib/monotouch/bare/System.Xml.dll -r:MonoSecurity=./../../class/lib/monotouch/Mono.Security.dll</flags>
       <output>System.dll</output>
       <built_sources></built_sources>
       <library_output>./../../class/lib/monotouch/secxml/System.dll</library_output>
     </project>
     <project dir="class/System" library="System-monotouch_runtime">
       <boot>false</boot>
-      <flags>/codepage:65001 -d:NET_1_1 -d:NET_2_0 -d:NET_2_1 -d:NET_3_5 -d:NET_4_0 -d:NET_4_5 -d:MOBILE,MOBILE_LEGACY -d:MONO -d:MONOTOUCH -d:DISABLE_REMOTING -d:DISABLE_COM -d:FEATURE_INTERCEPTABLE_THREADPOOL_CALLBACK -d:NETSTANDARD -nowarn:1699 -nostdlib -r:./../../class/lib/monotouch_runtime/mscorlib.dll -debug -optimize /noconfig -nowarn:618 -d:CONFIGURATION_2_0 -d:FEATURE_PAL,SYSTEM_NAMESPACE,MONO,PLATFORM_UNIX -d:MONO_FEATURE_PROCESS_START -d:MONO_FEATURE_THREAD_ABORT -d:MONO_FEATURE_THREAD_SUSPEND_RESUME -d:MONO_FEATURE_MULTIPLE_APPDOMAINS -unsafe -d:INSIDE_SYSTEM -d:SECURITY_DEP -d:SECURITY_DEP -d:XML_DEP -r:./../../class/lib/monotouch_runtime/System.Xml.dll -r:MonoSecurity=./../../class/lib/monotouch_runtime/Mono.Security.dll</flags>
+      <flags>/codepage:65001 -d:NET_1_1 -d:NET_2_0 -d:NET_2_1 -d:NET_3_5 -d:NET_4_0 -d:NET_4_5 -d:MOBILE,MOBILE_LEGACY -d:MONO -d:MONOTOUCH -d:DISABLE_REMOTING -d:DISABLE_COM -d:FEATURE_INTERCEPTABLE_THREADPOOL_CALLBACK -d:NETSTANDARD -nowarn:1699 -nostdlib -r:./../../class/lib/monotouch_runtime/mscorlib.dll -debug -optimize /noconfig -d:CONFIGURATION_2_0 -d:FEATURE_PAL,SYSTEM_NAMESPACE,MONO,PLATFORM_UNIX -d:MONO_FEATURE_PROCESS_START -d:MONO_FEATURE_THREAD_ABORT -d:MONO_FEATURE_THREAD_SUSPEND_RESUME -d:MONO_FEATURE_MULTIPLE_APPDOMAINS -unsafe -d:INSIDE_SYSTEM -d:SECURITY_DEP -nowarn:618,1635 -d:SECURITY_DEP -d:XML_DEP -r:./../../class/lib/monotouch_runtime/System.Xml.dll -r:MonoSecurity=./../../class/lib/monotouch_runtime/Mono.Security.dll</flags>
       <output>System.dll</output>
       <built_sources></built_sources>
       <library_output>./../../class/lib/monotouch_runtime/System.dll</library_output>
     </project>
     <project dir="class/System" library="System-bare-monotouch_runtime">
       <boot>false</boot>
-      <flags>/codepage:65001 -d:NET_1_1 -d:NET_2_0 -d:NET_2_1 -d:NET_3_5 -d:NET_4_0 -d:NET_4_5 -d:MOBILE,MOBILE_LEGACY -d:MONO -d:MONOTOUCH -d:DISABLE_REMOTING -d:DISABLE_COM -d:FEATURE_INTERCEPTABLE_THREADPOOL_CALLBACK -d:NETSTANDARD -nowarn:1699 -nostdlib -r:./../../class/lib/monotouch_runtime/mscorlib.dll -debug -optimize /noconfig -nowarn:618 -d:CONFIGURATION_2_0 -d:FEATURE_PAL,SYSTEM_NAMESPACE,MONO,PLATFORM_UNIX -d:MONO_FEATURE_PROCESS_START -d:MONO_FEATURE_THREAD_ABORT -d:MONO_FEATURE_THREAD_SUSPEND_RESUME -d:MONO_FEATURE_MULTIPLE_APPDOMAINS -unsafe -d:INSIDE_SYSTEM -d:SECURITY_DEP</flags>
+      <flags>/codepage:65001 -d:NET_1_1 -d:NET_2_0 -d:NET_2_1 -d:NET_3_5 -d:NET_4_0 -d:NET_4_5 -d:MOBILE,MOBILE_LEGACY -d:MONO -d:MONOTOUCH -d:DISABLE_REMOTING -d:DISABLE_COM -d:FEATURE_INTERCEPTABLE_THREADPOOL_CALLBACK -d:NETSTANDARD -nowarn:1699 -nostdlib -r:./../../class/lib/monotouch_runtime/mscorlib.dll -debug -optimize /noconfig -d:CONFIGURATION_2_0 -d:FEATURE_PAL,SYSTEM_NAMESPACE,MONO,PLATFORM_UNIX -d:MONO_FEATURE_PROCESS_START -d:MONO_FEATURE_THREAD_ABORT -d:MONO_FEATURE_THREAD_SUSPEND_RESUME -d:MONO_FEATURE_MULTIPLE_APPDOMAINS -unsafe -d:INSIDE_SYSTEM -d:SECURITY_DEP -nowarn:618,1635</flags>
       <output>System.dll</output>
       <built_sources></built_sources>
       <library_output>./../../class/lib/monotouch_runtime/bare/System.dll</library_output>
     </project>
     <project dir="class/System" library="System-secxml-monotouch_runtime">
       <boot>false</boot>
-      <flags>/codepage:65001 -d:NET_1_1 -d:NET_2_0 -d:NET_2_1 -d:NET_3_5 -d:NET_4_0 -d:NET_4_5 -d:MOBILE,MOBILE_LEGACY -d:MONO -d:MONOTOUCH -d:DISABLE_REMOTING -d:DISABLE_COM -d:FEATURE_INTERCEPTABLE_THREADPOOL_CALLBACK -d:NETSTANDARD -nowarn:1699 -nostdlib -r:./../../class/lib/monotouch_runtime/mscorlib.dll -debug -optimize /noconfig -nowarn:618 -d:CONFIGURATION_2_0 -d:FEATURE_PAL,SYSTEM_NAMESPACE,MONO,PLATFORM_UNIX -d:MONO_FEATURE_PROCESS_START -d:MONO_FEATURE_THREAD_ABORT -d:MONO_FEATURE_THREAD_SUSPEND_RESUME -d:MONO_FEATURE_MULTIPLE_APPDOMAINS -unsafe -d:INSIDE_SYSTEM -d:SECURITY_DEP -d:SECURITY_DEP -d:XML_DEP -r:./../../class/lib/monotouch_runtime/bare/System.Xml.dll -r:MonoSecurity=./../../class/lib/monotouch_runtime/Mono.Security.dll</flags>
+      <flags>/codepage:65001 -d:NET_1_1 -d:NET_2_0 -d:NET_2_1 -d:NET_3_5 -d:NET_4_0 -d:NET_4_5 -d:MOBILE,MOBILE_LEGACY -d:MONO -d:MONOTOUCH -d:DISABLE_REMOTING -d:DISABLE_COM -d:FEATURE_INTERCEPTABLE_THREADPOOL_CALLBACK -d:NETSTANDARD -nowarn:1699 -nostdlib -r:./../../class/lib/monotouch_runtime/mscorlib.dll -debug -optimize /noconfig -d:CONFIGURATION_2_0 -d:FEATURE_PAL,SYSTEM_NAMESPACE,MONO,PLATFORM_UNIX -d:MONO_FEATURE_PROCESS_START -d:MONO_FEATURE_THREAD_ABORT -d:MONO_FEATURE_THREAD_SUSPEND_RESUME -d:MONO_FEATURE_MULTIPLE_APPDOMAINS -unsafe -d:INSIDE_SYSTEM -d:SECURITY_DEP -nowarn:618,1635 -d:SECURITY_DEP -d:XML_DEP -r:./../../class/lib/monotouch_runtime/bare/System.Xml.dll -r:MonoSecurity=./../../class/lib/monotouch_runtime/Mono.Security.dll</flags>
       <output>System.dll</output>
       <built_sources></built_sources>
       <library_output>./../../class/lib/monotouch_runtime/secxml/System.dll</library_output>
     </project>
     <project dir="class/System" library="System-monotouch_watch">
       <boot>false</boot>
-      <flags>/codepage:65001 -d:NET_1_1 -d:NET_2_0 -d:NET_2_1 -d:NET_3_5 -d:NET_4_0 -d:NET_4_5 -d:MOBILE,MOBILE_LEGACY -d:MONO -d:MONOTOUCH -d:DISABLE_REMOTING -d:DISABLE_COM -d:FEATURE_INTERCEPTABLE_THREADPOOL_CALLBACK -d:NETSTANDARD -nowarn:1699 -nostdlib -r:./../../class/lib/monotouch_watch/mscorlib.dll -debug -d:FULL_AOT_RUNTIME -d:FEATURE_NO_BSD_SOCKETS -d:MONOTOUCH_WATCH -optimize /noconfig -nowarn:618 -d:CONFIGURATION_2_0 -d:FEATURE_PAL,SYSTEM_NAMESPACE,MONO,PLATFORM_UNIX -unsafe -d:INSIDE_SYSTEM -d:SECURITY_DEP -d:SECURITY_DEP -d:XML_DEP -r:./../../class/lib/monotouch_watch/System.Xml.dll</flags>
+      <flags>/codepage:65001 -d:NET_1_1 -d:NET_2_0 -d:NET_2_1 -d:NET_3_5 -d:NET_4_0 -d:NET_4_5 -d:MOBILE,MOBILE_LEGACY -d:MONO -d:MONOTOUCH -d:DISABLE_REMOTING -d:DISABLE_COM -d:FEATURE_INTERCEPTABLE_THREADPOOL_CALLBACK -d:NETSTANDARD -nowarn:1699 -nostdlib -r:./../../class/lib/monotouch_watch/mscorlib.dll -debug -d:FULL_AOT_RUNTIME -d:FEATURE_NO_BSD_SOCKETS -d:MONOTOUCH_WATCH -optimize /noconfig -d:CONFIGURATION_2_0 -d:FEATURE_PAL,SYSTEM_NAMESPACE,MONO,PLATFORM_UNIX -unsafe -d:INSIDE_SYSTEM -d:SECURITY_DEP -nowarn:618,1635 -d:SECURITY_DEP -d:XML_DEP -r:./../../class/lib/monotouch_watch/System.Xml.dll</flags>
       <output>System.dll</output>
       <built_sources></built_sources>
       <library_output>./../../class/lib/monotouch_watch/System.dll</library_output>
     </project>
     <project dir="class/System" library="System-bare-monotouch_watch">
       <boot>false</boot>
-      <flags>/codepage:65001 -d:NET_1_1 -d:NET_2_0 -d:NET_2_1 -d:NET_3_5 -d:NET_4_0 -d:NET_4_5 -d:MOBILE,MOBILE_LEGACY -d:MONO -d:MONOTOUCH -d:DISABLE_REMOTING -d:DISABLE_COM -d:FEATURE_INTERCEPTABLE_THREADPOOL_CALLBACK -d:NETSTANDARD -nowarn:1699 -nostdlib -r:./../../class/lib/monotouch_watch/mscorlib.dll -debug -d:FULL_AOT_RUNTIME -d:FEATURE_NO_BSD_SOCKETS -d:MONOTOUCH_WATCH -optimize /noconfig -nowarn:618 -d:CONFIGURATION_2_0 -d:FEATURE_PAL,SYSTEM_NAMESPACE,MONO,PLATFORM_UNIX -unsafe -d:INSIDE_SYSTEM -d:SECURITY_DEP</flags>
+      <flags>/codepage:65001 -d:NET_1_1 -d:NET_2_0 -d:NET_2_1 -d:NET_3_5 -d:NET_4_0 -d:NET_4_5 -d:MOBILE,MOBILE_LEGACY -d:MONO -d:MONOTOUCH -d:DISABLE_REMOTING -d:DISABLE_COM -d:FEATURE_INTERCEPTABLE_THREADPOOL_CALLBACK -d:NETSTANDARD -nowarn:1699 -nostdlib -r:./../../class/lib/monotouch_watch/mscorlib.dll -debug -d:FULL_AOT_RUNTIME -d:FEATURE_NO_BSD_SOCKETS -d:MONOTOUCH_WATCH -optimize /noconfig -d:CONFIGURATION_2_0 -d:FEATURE_PAL,SYSTEM_NAMESPACE,MONO,PLATFORM_UNIX -unsafe -d:INSIDE_SYSTEM -d:SECURITY_DEP -nowarn:618,1635</flags>
       <output>System.dll</output>
       <built_sources></built_sources>
       <library_output>./../../class/lib/monotouch_watch/bare/System.dll</library_output>
     </project>
     <project dir="class/System" library="System-secxml-monotouch_watch">
       <boot>false</boot>
-      <flags>/codepage:65001 -d:NET_1_1 -d:NET_2_0 -d:NET_2_1 -d:NET_3_5 -d:NET_4_0 -d:NET_4_5 -d:MOBILE,MOBILE_LEGACY -d:MONO -d:MONOTOUCH -d:DISABLE_REMOTING -d:DISABLE_COM -d:FEATURE_INTERCEPTABLE_THREADPOOL_CALLBACK -d:NETSTANDARD -nowarn:1699 -nostdlib -r:./../../class/lib/monotouch_watch/mscorlib.dll -debug -d:FULL_AOT_RUNTIME -d:FEATURE_NO_BSD_SOCKETS -d:MONOTOUCH_WATCH -optimize /noconfig -nowarn:618 -d:CONFIGURATION_2_0 -d:FEATURE_PAL,SYSTEM_NAMESPACE,MONO,PLATFORM_UNIX -unsafe -d:INSIDE_SYSTEM -d:SECURITY_DEP -d:SECURITY_DEP -d:XML_DEP -r:./../../class/lib/monotouch_watch/bare/System.Xml.dll</flags>
+      <flags>/codepage:65001 -d:NET_1_1 -d:NET_2_0 -d:NET_2_1 -d:NET_3_5 -d:NET_4_0 -d:NET_4_5 -d:MOBILE,MOBILE_LEGACY -d:MONO -d:MONOTOUCH -d:DISABLE_REMOTING -d:DISABLE_COM -d:FEATURE_INTERCEPTABLE_THREADPOOL_CALLBACK -d:NETSTANDARD -nowarn:1699 -nostdlib -r:./../../class/lib/monotouch_watch/mscorlib.dll -debug -d:FULL_AOT_RUNTIME -d:FEATURE_NO_BSD_SOCKETS -d:MONOTOUCH_WATCH -optimize /noconfig -d:CONFIGURATION_2_0 -d:FEATURE_PAL,SYSTEM_NAMESPACE,MONO,PLATFORM_UNIX -unsafe -d:INSIDE_SYSTEM -d:SECURITY_DEP -nowarn:618,1635 -d:SECURITY_DEP -d:XML_DEP -r:./../../class/lib/monotouch_watch/bare/System.Xml.dll</flags>
       <output>System.dll</output>
       <built_sources></built_sources>
       <library_output>./../../class/lib/monotouch_watch/secxml/System.dll</library_output>
     </project>
     <project dir="class/System" library="System-monotouch_watch_runtime">
       <boot>false</boot>
-      <flags>/codepage:65001 -d:NET_1_1 -d:NET_2_0 -d:NET_2_1 -d:NET_3_5 -d:NET_4_0 -d:NET_4_5 -d:MOBILE,MOBILE_LEGACY -d:MONO -d:MONOTOUCH -d:DISABLE_REMOTING -d:DISABLE_COM -d:FEATURE_INTERCEPTABLE_THREADPOOL_CALLBACK -d:NETSTANDARD -nowarn:1699 -nostdlib -r:./../../class/lib/monotouch_watch_runtime/mscorlib.dll -debug -d:FEATURE_NO_BSD_SOCKETS -d:MONOTOUCH_WATCH -optimize /noconfig -nowarn:618 -d:CONFIGURATION_2_0 -d:FEATURE_PAL,SYSTEM_NAMESPACE,MONO,PLATFORM_UNIX -d:MONO_FEATURE_PROCESS_START -d:MONO_FEATURE_MULTIPLE_APPDOMAINS -unsafe -d:INSIDE_SYSTEM -d:SECURITY_DEP -d:SECURITY_DEP -d:XML_DEP -r:./../../class/lib/monotouch_watch_runtime/System.Xml.dll</flags>
+      <flags>/codepage:65001 -d:NET_1_1 -d:NET_2_0 -d:NET_2_1 -d:NET_3_5 -d:NET_4_0 -d:NET_4_5 -d:MOBILE,MOBILE_LEGACY -d:MONO -d:MONOTOUCH -d:DISABLE_REMOTING -d:DISABLE_COM -d:FEATURE_INTERCEPTABLE_THREADPOOL_CALLBACK -d:NETSTANDARD -nowarn:1699 -nostdlib -r:./../../class/lib/monotouch_watch_runtime/mscorlib.dll -debug -d:FEATURE_NO_BSD_SOCKETS -d:MONOTOUCH_WATCH -optimize /noconfig -d:CONFIGURATION_2_0 -d:FEATURE_PAL,SYSTEM_NAMESPACE,MONO,PLATFORM_UNIX -d:MONO_FEATURE_PROCESS_START -d:MONO_FEATURE_MULTIPLE_APPDOMAINS -unsafe -d:INSIDE_SYSTEM -d:SECURITY_DEP -nowarn:618,1635 -d:SECURITY_DEP -d:XML_DEP -r:./../../class/lib/monotouch_watch_runtime/System.Xml.dll</flags>
       <output>System.dll</output>
       <built_sources></built_sources>
       <library_output>./../../class/lib/monotouch_watch_runtime/System.dll</library_output>
     </project>
     <project dir="class/System" library="System-bare-monotouch_watch_runtime">
       <boot>false</boot>
-      <flags>/codepage:65001 -d:NET_1_1 -d:NET_2_0 -d:NET_2_1 -d:NET_3_5 -d:NET_4_0 -d:NET_4_5 -d:MOBILE,MOBILE_LEGACY -d:MONO -d:MONOTOUCH -d:DISABLE_REMOTING -d:DISABLE_COM -d:FEATURE_INTERCEPTABLE_THREADPOOL_CALLBACK -d:NETSTANDARD -nowarn:1699 -nostdlib -r:./../../class/lib/monotouch_watch_runtime/mscorlib.dll -debug -d:FEATURE_NO_BSD_SOCKETS -d:MONOTOUCH_WATCH -optimize /noconfig -nowarn:618 -d:CONFIGURATION_2_0 -d:FEATURE_PAL,SYSTEM_NAMESPACE,MONO,PLATFORM_UNIX -d:MONO_FEATURE_PROCESS_START -d:MONO_FEATURE_MULTIPLE_APPDOMAINS -unsafe -d:INSIDE_SYSTEM -d:SECURITY_DEP</flags>
+      <flags>/codepage:65001 -d:NET_1_1 -d:NET_2_0 -d:NET_2_1 -d:NET_3_5 -d:NET_4_0 -d:NET_4_5 -d:MOBILE,MOBILE_LEGACY -d:MONO -d:MONOTOUCH -d:DISABLE_REMOTING -d:DISABLE_COM -d:FEATURE_INTERCEPTABLE_THREADPOOL_CALLBACK -d:NETSTANDARD -nowarn:1699 -nostdlib -r:./../../class/lib/monotouch_watch_runtime/mscorlib.dll -debug -d:FEATURE_NO_BSD_SOCKETS -d:MONOTOUCH_WATCH -optimize /noconfig -d:CONFIGURATION_2_0 -d:FEATURE_PAL,SYSTEM_NAMESPACE,MONO,PLATFORM_UNIX -d:MONO_FEATURE_PROCESS_START -d:MONO_FEATURE_MULTIPLE_APPDOMAINS -unsafe -d:INSIDE_SYSTEM -d:SECURITY_DEP -nowarn:618,1635</flags>
       <output>System.dll</output>
       <built_sources></built_sources>
       <library_output>./../../class/lib/monotouch_watch_runtime/bare/System.dll</library_output>
     </project>
     <project dir="class/System" library="System-secxml-monotouch_watch_runtime">
       <boot>false</boot>
-      <flags>/codepage:65001 -d:NET_1_1 -d:NET_2_0 -d:NET_2_1 -d:NET_3_5 -d:NET_4_0 -d:NET_4_5 -d:MOBILE,MOBILE_LEGACY -d:MONO -d:MONOTOUCH -d:DISABLE_REMOTING -d:DISABLE_COM -d:FEATURE_INTERCEPTABLE_THREADPOOL_CALLBACK -d:NETSTANDARD -nowarn:1699 -nostdlib -r:./../../class/lib/monotouch_watch_runtime/mscorlib.dll -debug -d:FEATURE_NO_BSD_SOCKETS -d:MONOTOUCH_WATCH -optimize /noconfig -nowarn:618 -d:CONFIGURATION_2_0 -d:FEATURE_PAL,SYSTEM_NAMESPACE,MONO,PLATFORM_UNIX -d:MONO_FEATURE_PROCESS_START -d:MONO_FEATURE_MULTIPLE_APPDOMAINS -unsafe -d:INSIDE_SYSTEM -d:SECURITY_DEP -d:SECURITY_DEP -d:XML_DEP -r:./../../class/lib/monotouch_watch_runtime/bare/System.Xml.dll</flags>
+      <flags>/codepage:65001 -d:NET_1_1 -d:NET_2_0 -d:NET_2_1 -d:NET_3_5 -d:NET_4_0 -d:NET_4_5 -d:MOBILE,MOBILE_LEGACY -d:MONO -d:MONOTOUCH -d:DISABLE_REMOTING -d:DISABLE_COM -d:FEATURE_INTERCEPTABLE_THREADPOOL_CALLBACK -d:NETSTANDARD -nowarn:1699 -nostdlib -r:./../../class/lib/monotouch_watch_runtime/mscorlib.dll -debug -d:FEATURE_NO_BSD_SOCKETS -d:MONOTOUCH_WATCH -optimize /noconfig -d:CONFIGURATION_2_0 -d:FEATURE_PAL,SYSTEM_NAMESPACE,MONO,PLATFORM_UNIX -d:MONO_FEATURE_PROCESS_START -d:MONO_FEATURE_MULTIPLE_APPDOMAINS -unsafe -d:INSIDE_SYSTEM -d:SECURITY_DEP -nowarn:618,1635 -d:SECURITY_DEP -d:XML_DEP -r:./../../class/lib/monotouch_watch_runtime/bare/System.Xml.dll</flags>
       <output>System.dll</output>
       <built_sources></built_sources>
       <library_output>./../../class/lib/monotouch_watch_runtime/secxml/System.dll</library_output>
     </project>
     <project dir="class/System" library="System-monotouch_tv">
       <boot>false</boot>
-      <flags>/codepage:65001 -d:NET_1_1 -d:NET_2_0 -d:NET_2_1 -d:NET_3_5 -d:NET_4_0 -d:NET_4_5 -d:MOBILE,MOBILE_LEGACY -d:MONO -d:MONOTOUCH -d:DISABLE_REMOTING -d:DISABLE_COM -d:FEATURE_INTERCEPTABLE_THREADPOOL_CALLBACK -d:NETSTANDARD -nowarn:1699 -nostdlib -r:./../../class/lib/monotouch_tv/mscorlib.dll -debug -d:FULL_AOT_RUNTIME -d:MONOTOUCH_TV -optimize /noconfig -nowarn:618 -d:CONFIGURATION_2_0 -d:FEATURE_PAL,SYSTEM_NAMESPACE,MONO,PLATFORM_UNIX -unsafe -d:INSIDE_SYSTEM -d:SECURITY_DEP -d:SECURITY_DEP -d:XML_DEP -r:./../../class/lib/monotouch_tv/System.Xml.dll -r:MonoSecurity=./../../class/lib/monotouch_tv/Mono.Security.dll</flags>
+      <flags>/codepage:65001 -d:NET_1_1 -d:NET_2_0 -d:NET_2_1 -d:NET_3_5 -d:NET_4_0 -d:NET_4_5 -d:MOBILE,MOBILE_LEGACY -d:MONO -d:MONOTOUCH -d:DISABLE_REMOTING -d:DISABLE_COM -d:FEATURE_INTERCEPTABLE_THREADPOOL_CALLBACK -d:NETSTANDARD -nowarn:1699 -nostdlib -r:./../../class/lib/monotouch_tv/mscorlib.dll -debug -d:FULL_AOT_RUNTIME -d:MONOTOUCH_TV -optimize /noconfig -d:CONFIGURATION_2_0 -d:FEATURE_PAL,SYSTEM_NAMESPACE,MONO,PLATFORM_UNIX -unsafe -d:INSIDE_SYSTEM -d:SECURITY_DEP -nowarn:618,1635 -d:SECURITY_DEP -d:XML_DEP -r:./../../class/lib/monotouch_tv/System.Xml.dll -r:MonoSecurity=./../../class/lib/monotouch_tv/Mono.Security.dll</flags>
       <output>System.dll</output>
       <built_sources></built_sources>
       <library_output>./../../class/lib/monotouch_tv/System.dll</library_output>
     </project>
     <project dir="class/System" library="System-bare-monotouch_tv">
       <boot>false</boot>
-      <flags>/codepage:65001 -d:NET_1_1 -d:NET_2_0 -d:NET_2_1 -d:NET_3_5 -d:NET_4_0 -d:NET_4_5 -d:MOBILE,MOBILE_LEGACY -d:MONO -d:MONOTOUCH -d:DISABLE_REMOTING -d:DISABLE_COM -d:FEATURE_INTERCEPTABLE_THREADPOOL_CALLBACK -d:NETSTANDARD -nowarn:1699 -nostdlib -r:./../../class/lib/monotouch_tv/mscorlib.dll -debug -d:FULL_AOT_RUNTIME -d:MONOTOUCH_TV -optimize /noconfig -nowarn:618 -d:CONFIGURATION_2_0 -d:FEATURE_PAL,SYSTEM_NAMESPACE,MONO,PLATFORM_UNIX -unsafe -d:INSIDE_SYSTEM -d:SECURITY_DEP</flags>
+      <flags>/codepage:65001 -d:NET_1_1 -d:NET_2_0 -d:NET_2_1 -d:NET_3_5 -d:NET_4_0 -d:NET_4_5 -d:MOBILE,MOBILE_LEGACY -d:MONO -d:MONOTOUCH -d:DISABLE_REMOTING -d:DISABLE_COM -d:FEATURE_INTERCEPTABLE_THREADPOOL_CALLBACK -d:NETSTANDARD -nowarn:1699 -nostdlib -r:./../../class/lib/monotouch_tv/mscorlib.dll -debug -d:FULL_AOT_RUNTIME -d:MONOTOUCH_TV -optimize /noconfig -d:CONFIGURATION_2_0 -d:FEATURE_PAL,SYSTEM_NAMESPACE,MONO,PLATFORM_UNIX -unsafe -d:INSIDE_SYSTEM -d:SECURITY_DEP -nowarn:618,1635</flags>
       <output>System.dll</output>
       <built_sources></built_sources>
       <library_output>./../../class/lib/monotouch_tv/bare/System.dll</library_output>
     </project>
     <project dir="class/System" library="System-secxml-monotouch_tv">
       <boot>false</boot>
-      <flags>/codepage:65001 -d:NET_1_1 -d:NET_2_0 -d:NET_2_1 -d:NET_3_5 -d:NET_4_0 -d:NET_4_5 -d:MOBILE,MOBILE_LEGACY -d:MONO -d:MONOTOUCH -d:DISABLE_REMOTING -d:DISABLE_COM -d:FEATURE_INTERCEPTABLE_THREADPOOL_CALLBACK -d:NETSTANDARD -nowarn:1699 -nostdlib -r:./../../class/lib/monotouch_tv/mscorlib.dll -debug -d:FULL_AOT_RUNTIME -d:MONOTOUCH_TV -optimize /noconfig -nowarn:618 -d:CONFIGURATION_2_0 -d:FEATURE_PAL,SYSTEM_NAMESPACE,MONO,PLATFORM_UNIX -unsafe -d:INSIDE_SYSTEM -d:SECURITY_DEP -d:SECURITY_DEP -d:XML_DEP -r:./../../class/lib/monotouch_tv/bare/System.Xml.dll -r:MonoSecurity=./../../class/lib/monotouch_tv/Mono.Security.dll</flags>
+      <flags>/codepage:65001 -d:NET_1_1 -d:NET_2_0 -d:NET_2_1 -d:NET_3_5 -d:NET_4_0 -d:NET_4_5 -d:MOBILE,MOBILE_LEGACY -d:MONO -d:MONOTOUCH -d:DISABLE_REMOTING -d:DISABLE_COM -d:FEATURE_INTERCEPTABLE_THREADPOOL_CALLBACK -d:NETSTANDARD -nowarn:1699 -nostdlib -r:./../../class/lib/monotouch_tv/mscorlib.dll -debug -d:FULL_AOT_RUNTIME -d:MONOTOUCH_TV -optimize /noconfig -d:CONFIGURATION_2_0 -d:FEATURE_PAL,SYSTEM_NAMESPACE,MONO,PLATFORM_UNIX -unsafe -d:INSIDE_SYSTEM -d:SECURITY_DEP -nowarn:618,1635 -d:SECURITY_DEP -d:XML_DEP -r:./../../class/lib/monotouch_tv/bare/System.Xml.dll -r:MonoSecurity=./../../class/lib/monotouch_tv/Mono.Security.dll</flags>
       <output>System.dll</output>
       <built_sources></built_sources>
       <library_output>./../../class/lib/monotouch_tv/secxml/System.dll</library_output>
     </project>
     <project dir="class/System" library="System-monotouch_tv_runtime">
       <boot>false</boot>
-      <flags>/codepage:65001 -d:NET_1_1 -d:NET_2_0 -d:NET_2_1 -d:NET_3_5 -d:NET_4_0 -d:NET_4_5 -d:MOBILE,MOBILE_LEGACY -d:MONO -d:MONOTOUCH -d:DISABLE_REMOTING -d:DISABLE_COM -d:FEATURE_INTERCEPTABLE_THREADPOOL_CALLBACK -d:NETSTANDARD -nowarn:1699 -nostdlib -r:./../../class/lib/monotouch_tv_runtime/mscorlib.dll -debug -d:MONOTOUCH_TV -optimize /noconfig -nowarn:618 -d:CONFIGURATION_2_0 -d:FEATURE_PAL,SYSTEM_NAMESPACE,MONO,PLATFORM_UNIX -d:MONO_FEATURE_PROCESS_START -d:MONO_FEATURE_MULTIPLE_APPDOMAINS -unsafe -d:INSIDE_SYSTEM -d:SECURITY_DEP -d:SECURITY_DEP -d:XML_DEP -r:./../../class/lib/monotouch_tv_runtime/System.Xml.dll -r:MonoSecurity=./../../class/lib/monotouch_tv_runtime/Mono.Security.dll</flags>
+      <flags>/codepage:65001 -d:NET_1_1 -d:NET_2_0 -d:NET_2_1 -d:NET_3_5 -d:NET_4_0 -d:NET_4_5 -d:MOBILE,MOBILE_LEGACY -d:MONO -d:MONOTOUCH -d:DISABLE_REMOTING -d:DISABLE_COM -d:FEATURE_INTERCEPTABLE_THREADPOOL_CALLBACK -d:NETSTANDARD -nowarn:1699 -nostdlib -r:./../../class/lib/monotouch_tv_runtime/mscorlib.dll -debug -d:MONOTOUCH_TV -optimize /noconfig -d:CONFIGURATION_2_0 -d:FEATURE_PAL,SYSTEM_NAMESPACE,MONO,PLATFORM_UNIX -d:MONO_FEATURE_PROCESS_START -d:MONO_FEATURE_MULTIPLE_APPDOMAINS -unsafe -d:INSIDE_SYSTEM -d:SECURITY_DEP -nowarn:618,1635 -d:SECURITY_DEP -d:XML_DEP -r:./../../class/lib/monotouch_tv_runtime/System.Xml.dll -r:MonoSecurity=./../../class/lib/monotouch_tv_runtime/Mono.Security.dll</flags>
       <output>System.dll</output>
       <built_sources></built_sources>
       <library_output>./../../class/lib/monotouch_tv_runtime/System.dll</library_output>
     </project>
     <project dir="class/System" library="System-bare-monotouch_tv_runtime">
       <boot>false</boot>
-      <flags>/codepage:65001 -d:NET_1_1 -d:NET_2_0 -d:NET_2_1 -d:NET_3_5 -d:NET_4_0 -d:NET_4_5 -d:MOBILE,MOBILE_LEGACY -d:MONO -d:MONOTOUCH -d:DISABLE_REMOTING -d:DISABLE_COM -d:FEATURE_INTERCEPTABLE_THREADPOOL_CALLBACK -d:NETSTANDARD -nowarn:1699 -nostdlib -r:./../../class/lib/monotouch_tv_runtime/mscorlib.dll -debug -d:MONOTOUCH_TV -optimize /noconfig -nowarn:618 -d:CONFIGURATION_2_0 -d:FEATURE_PAL,SYSTEM_NAMESPACE,MONO,PLATFORM_UNIX -d:MONO_FEATURE_PROCESS_START -d:MONO_FEATURE_MULTIPLE_APPDOMAINS -unsafe -d:INSIDE_SYSTEM -d:SECURITY_DEP</flags>
+      <flags>/codepage:65001 -d:NET_1_1 -d:NET_2_0 -d:NET_2_1 -d:NET_3_5 -d:NET_4_0 -d:NET_4_5 -d:MOBILE,MOBILE_LEGACY -d:MONO -d:MONOTOUCH -d:DISABLE_REMOTING -d:DISABLE_COM -d:FEATURE_INTERCEPTABLE_THREADPOOL_CALLBACK -d:NETSTANDARD -nowarn:1699 -nostdlib -r:./../../class/lib/monotouch_tv_runtime/mscorlib.dll -debug -d:MONOTOUCH_TV -optimize /noconfig -d:CONFIGURATION_2_0 -d:FEATURE_PAL,SYSTEM_NAMESPACE,MONO,PLATFORM_UNIX -d:MONO_FEATURE_PROCESS_START -d:MONO_FEATURE_MULTIPLE_APPDOMAINS -unsafe -d:INSIDE_SYSTEM -d:SECURITY_DEP -nowarn:618,1635</flags>
       <output>System.dll</output>
       <built_sources></built_sources>
       <library_output>./../../class/lib/monotouch_tv_runtime/bare/System.dll</library_output>
     </project>
     <project dir="class/System" library="System-secxml-monotouch_tv_runtime">
       <boot>false</boot>
-      <flags>/codepage:65001 -d:NET_1_1 -d:NET_2_0 -d:NET_2_1 -d:NET_3_5 -d:NET_4_0 -d:NET_4_5 -d:MOBILE,MOBILE_LEGACY -d:MONO -d:MONOTOUCH -d:DISABLE_REMOTING -d:DISABLE_COM -d:FEATURE_INTERCEPTABLE_THREADPOOL_CALLBACK -d:NETSTANDARD -nowarn:1699 -nostdlib -r:./../../class/lib/monotouch_tv_runtime/mscorlib.dll -debug -d:MONOTOUCH_TV -optimize /noconfig -nowarn:618 -d:CONFIGURATION_2_0 -d:FEATURE_PAL,SYSTEM_NAMESPACE,MONO,PLATFORM_UNIX -d:MONO_FEATURE_PROCESS_START -d:MONO_FEATURE_MULTIPLE_APPDOMAINS -unsafe -d:INSIDE_SYSTEM -d:SECURITY_DEP -d:SECURITY_DEP -d:XML_DEP -r:./../../class/lib/monotouch_tv_runtime/bare/System.Xml.dll -r:MonoSecurity=./../../class/lib/monotouch_tv_runtime/Mono.Security.dll</flags>
+      <flags>/codepage:65001 -d:NET_1_1 -d:NET_2_0 -d:NET_2_1 -d:NET_3_5 -d:NET_4_0 -d:NET_4_5 -d:MOBILE,MOBILE_LEGACY -d:MONO -d:MONOTOUCH -d:DISABLE_REMOTING -d:DISABLE_COM -d:FEATURE_INTERCEPTABLE_THREADPOOL_CALLBACK -d:NETSTANDARD -nowarn:1699 -nostdlib -r:./../../class/lib/monotouch_tv_runtime/mscorlib.dll -debug -d:MONOTOUCH_TV -optimize /noconfig -d:CONFIGURATION_2_0 -d:FEATURE_PAL,SYSTEM_NAMESPACE,MONO,PLATFORM_UNIX -d:MONO_FEATURE_PROCESS_START -d:MONO_FEATURE_MULTIPLE_APPDOMAINS -unsafe -d:INSIDE_SYSTEM -d:SECURITY_DEP -nowarn:618,1635 -d:SECURITY_DEP -d:XML_DEP -r:./../../class/lib/monotouch_tv_runtime/bare/System.Xml.dll -r:MonoSecurity=./../../class/lib/monotouch_tv_runtime/Mono.Security.dll</flags>
       <output>System.dll</output>
       <built_sources></built_sources>
       <library_output>./../../class/lib/monotouch_tv_runtime/secxml/System.dll</library_output>
     </project>
     <project dir="class/System" library="System-xammac">
       <boot>false</boot>
-      <flags>/codepage:65001 -d:NET_1_1 -d:NET_2_0 -d:NET_2_1 -d:NET_3_5 -d:NET_4_0 -d:NET_4_5 -d:MONO -d:MOBILE -d:MOBILE_DYNAMIC -d:XAMMAC -d:FEATURE_INTERCEPTABLE_THREADPOOL_CALLBACK -d:XAMARIN_MODERN -d:NETSTANDARD -nowarn:1699 -nostdlib -r:./../../class/lib/xammac/mscorlib.dll -debug -optimize /noconfig -nowarn:618 -d:CONFIGURATION_2_0 -d:FEATURE_PAL,SYSTEM_NAMESPACE,MONO,PLATFORM_UNIX -d:MONO_FEATURE_PROCESS_START -d:MONO_FEATURE_THREAD_ABORT -d:MONO_FEATURE_THREAD_SUSPEND_RESUME -d:MONO_FEATURE_MULTIPLE_APPDOMAINS -unsafe -d:INSIDE_SYSTEM -d:SECURITY_DEP -d:SECURITY_DEP -d:XML_DEP -r:./../../class/lib/xammac/System.Xml.dll -r:MonoSecurity=./../../class/lib/xammac/Mono.Security.dll</flags>
+      <flags>/codepage:65001 -d:NET_1_1 -d:NET_2_0 -d:NET_2_1 -d:NET_3_5 -d:NET_4_0 -d:NET_4_5 -d:MONO -d:MOBILE -d:MOBILE_DYNAMIC -d:XAMMAC -d:FEATURE_INTERCEPTABLE_THREADPOOL_CALLBACK -d:XAMARIN_MODERN -d:NETSTANDARD -nowarn:1699 -nostdlib -r:./../../class/lib/xammac/mscorlib.dll -debug -optimize /noconfig -d:CONFIGURATION_2_0 -d:FEATURE_PAL,SYSTEM_NAMESPACE,MONO,PLATFORM_UNIX -d:MONO_FEATURE_PROCESS_START -d:MONO_FEATURE_THREAD_ABORT -d:MONO_FEATURE_THREAD_SUSPEND_RESUME -d:MONO_FEATURE_MULTIPLE_APPDOMAINS -unsafe -d:MONO_FEATURE_BTLS -d:INSIDE_SYSTEM -d:SECURITY_DEP -nowarn:618,1635 -d:SECURITY_DEP -d:XML_DEP -r:./../../class/lib/xammac/System.Xml.dll -r:MonoSecurity=./../../class/lib/xammac/Mono.Security.dll</flags>
       <output>System.dll</output>
       <built_sources></built_sources>
       <library_output>./../../class/lib/xammac/System.dll</library_output>
     </project>
     <project dir="class/System" library="System-bare-xammac">
       <boot>false</boot>
-      <flags>/codepage:65001 -d:NET_1_1 -d:NET_2_0 -d:NET_2_1 -d:NET_3_5 -d:NET_4_0 -d:NET_4_5 -d:MONO -d:MOBILE -d:MOBILE_DYNAMIC -d:XAMMAC -d:FEATURE_INTERCEPTABLE_THREADPOOL_CALLBACK -d:XAMARIN_MODERN -d:NETSTANDARD -nowarn:1699 -nostdlib -r:./../../class/lib/xammac/mscorlib.dll -debug -optimize /noconfig -nowarn:618 -d:CONFIGURATION_2_0 -d:FEATURE_PAL,SYSTEM_NAMESPACE,MONO,PLATFORM_UNIX -d:MONO_FEATURE_PROCESS_START -d:MONO_FEATURE_THREAD_ABORT -d:MONO_FEATURE_THREAD_SUSPEND_RESUME -d:MONO_FEATURE_MULTIPLE_APPDOMAINS -unsafe -d:INSIDE_SYSTEM -d:SECURITY_DEP</flags>
+      <flags>/codepage:65001 -d:NET_1_1 -d:NET_2_0 -d:NET_2_1 -d:NET_3_5 -d:NET_4_0 -d:NET_4_5 -d:MONO -d:MOBILE -d:MOBILE_DYNAMIC -d:XAMMAC -d:FEATURE_INTERCEPTABLE_THREADPOOL_CALLBACK -d:XAMARIN_MODERN -d:NETSTANDARD -nowarn:1699 -nostdlib -r:./../../class/lib/xammac/mscorlib.dll -debug -optimize /noconfig -d:CONFIGURATION_2_0 -d:FEATURE_PAL,SYSTEM_NAMESPACE,MONO,PLATFORM_UNIX -d:MONO_FEATURE_PROCESS_START -d:MONO_FEATURE_THREAD_ABORT -d:MONO_FEATURE_THREAD_SUSPEND_RESUME -d:MONO_FEATURE_MULTIPLE_APPDOMAINS -unsafe -d:MONO_FEATURE_BTLS -d:INSIDE_SYSTEM -d:SECURITY_DEP -nowarn:618,1635</flags>
       <output>System.dll</output>
       <built_sources></built_sources>
       <library_output>./../../class/lib/xammac/bare/System.dll</library_output>
     </project>
     <project dir="class/System" library="System-secxml-xammac">
       <boot>false</boot>
-      <flags>/codepage:65001 -d:NET_1_1 -d:NET_2_0 -d:NET_2_1 -d:NET_3_5 -d:NET_4_0 -d:NET_4_5 -d:MONO -d:MOBILE -d:MOBILE_DYNAMIC -d:XAMMAC -d:FEATURE_INTERCEPTABLE_THREADPOOL_CALLBACK -d:XAMARIN_MODERN -d:NETSTANDARD -nowarn:1699 -nostdlib -r:./../../class/lib/xammac/mscorlib.dll -debug -optimize /noconfig -nowarn:618 -d:CONFIGURATION_2_0 -d:FEATURE_PAL,SYSTEM_NAMESPACE,MONO,PLATFORM_UNIX -d:MONO_FEATURE_PROCESS_START -d:MONO_FEATURE_THREAD_ABORT -d:MONO_FEATURE_THREAD_SUSPEND_RESUME -d:MONO_FEATURE_MULTIPLE_APPDOMAINS -unsafe -d:INSIDE_SYSTEM -d:SECURITY_DEP -d:SECURITY_DEP -d:XML_DEP -r:./../../class/lib/xammac/bare/System.Xml.dll -r:MonoSecurity=./../../class/lib/xammac/Mono.Security.dll</flags>
+      <flags>/codepage:65001 -d:NET_1_1 -d:NET_2_0 -d:NET_2_1 -d:NET_3_5 -d:NET_4_0 -d:NET_4_5 -d:MONO -d:MOBILE -d:MOBILE_DYNAMIC -d:XAMMAC -d:FEATURE_INTERCEPTABLE_THREADPOOL_CALLBACK -d:XAMARIN_MODERN -d:NETSTANDARD -nowarn:1699 -nostdlib -r:./../../class/lib/xammac/mscorlib.dll -debug -optimize /noconfig -d:CONFIGURATION_2_0 -d:FEATURE_PAL,SYSTEM_NAMESPACE,MONO,PLATFORM_UNIX -d:MONO_FEATURE_PROCESS_START -d:MONO_FEATURE_THREAD_ABORT -d:MONO_FEATURE_THREAD_SUSPEND_RESUME -d:MONO_FEATURE_MULTIPLE_APPDOMAINS -unsafe -d:MONO_FEATURE_BTLS -d:INSIDE_SYSTEM -d:SECURITY_DEP -nowarn:618,1635 -d:SECURITY_DEP -d:XML_DEP -r:./../../class/lib/xammac/bare/System.Xml.dll -r:MonoSecurity=./../../class/lib/xammac/Mono.Security.dll</flags>
       <output>System.dll</output>
       <built_sources></built_sources>
       <library_output>./../../class/lib/xammac/secxml/System.dll</library_output>
     </project>
     <project dir="class/System" library="System-xammac_net_4_5">
       <boot>false</boot>
-      <flags>/codepage:65001 -d:NET_4_0 -d:NET_4_5 -d:NET_4_6 -d:MONO -nowarn:1699 -nostdlib -r:./../../class/lib/xammac_net_4_5/mscorlib.dll -debug -d:FEATURE_INTERCEPTABLE_THREADPOOL_CALLBACK -d:NO_SYSTEM_DRAWING_DEPENDENCY -d:NO_WINFORMS_DEPENDENCY -d:NO_SYSTEM_WEB_DEPENDENCY -d:XAMMAC_4_5 -d:XAMARIN_MODERN -optimize /noconfig -nowarn:618 -d:CONFIGURATION_2_0 -d:FEATURE_PAL,SYSTEM_NAMESPACE,MONO,PLATFORM_UNIX -d:MONO_FEATURE_PROCESS_START -d:MONO_FEATURE_THREAD_ABORT -d:MONO_FEATURE_THREAD_SUSPEND_RESUME -d:MONO_FEATURE_MULTIPLE_APPDOMAINS -unsafe -resource:resources/Asterisk.wav -resource:resources/Beep.wav -resource:resources/Exclamation.wav -resource:resources/Hand.wav -resource:resources/Question.wav -d:SECURITY_DEP -d:XML_DEP -d:MONO_SECURITY_ALIAS -d:CONFIGURATION_DEP -r:./../../class/lib/xammac_net_4_5/System.Xml.dll -r:./../../class/lib/xammac_net_4_5/System.Configuration.dll -r:MonoSecurity=./../../class/lib/xammac_net_4_5/Mono.Security.dll</flags>
+      <flags>/codepage:65001 -d:NET_4_0 -d:NET_4_5 -d:NET_4_6 -d:MONO -nowarn:1699 -nostdlib -r:./../../class/lib/xammac_net_4_5/mscorlib.dll -debug -d:FEATURE_INTERCEPTABLE_THREADPOOL_CALLBACK -d:NO_SYSTEM_DRAWING_DEPENDENCY -d:NO_WINFORMS_DEPENDENCY -d:NO_SYSTEM_WEB_DEPENDENCY -d:XAMMAC_4_5 -d:XAMARIN_MODERN -optimize /noconfig -d:CONFIGURATION_2_0 -d:FEATURE_PAL,SYSTEM_NAMESPACE,MONO,PLATFORM_UNIX -d:MONO_FEATURE_PROCESS_START -d:MONO_FEATURE_THREAD_ABORT -d:MONO_FEATURE_THREAD_SUSPEND_RESUME -d:MONO_FEATURE_MULTIPLE_APPDOMAINS -unsafe -resource:resources/Asterisk.wav -resource:resources/Beep.wav -resource:resources/Exclamation.wav -resource:resources/Hand.wav -resource:resources/Question.wav -d:MONO_FEATURE_BTLS -d:SECURITY_DEP -d:XML_DEP -d:MONO_SECURITY_ALIAS -d:CONFIGURATION_DEP -r:./../../class/lib/xammac_net_4_5/System.Xml.dll -r:./../../class/lib/xammac_net_4_5/System.Configuration.dll -r:MonoSecurity=./../../class/lib/xammac_net_4_5/Mono.Security.dll</flags>
       <output>System.dll</output>
       <built_sources></built_sources>
       <library_output>./../../class/lib/xammac_net_4_5/System.dll</library_output>
     </project>
     <project dir="class/System" library="System-bare-xammac_net_4_5">
       <boot>false</boot>
-      <flags>/codepage:65001 -d:NET_4_0 -d:NET_4_5 -d:NET_4_6 -d:MONO -nowarn:1699 -nostdlib -r:./../../class/lib/xammac_net_4_5/mscorlib.dll -debug -d:FEATURE_INTERCEPTABLE_THREADPOOL_CALLBACK -d:NO_SYSTEM_DRAWING_DEPENDENCY -d:NO_WINFORMS_DEPENDENCY -d:NO_SYSTEM_WEB_DEPENDENCY -d:XAMMAC_4_5 -d:XAMARIN_MODERN -optimize /noconfig -nowarn:618 -d:CONFIGURATION_2_0 -d:FEATURE_PAL,SYSTEM_NAMESPACE,MONO,PLATFORM_UNIX -d:MONO_FEATURE_PROCESS_START -d:MONO_FEATURE_THREAD_ABORT -d:MONO_FEATURE_THREAD_SUSPEND_RESUME -d:MONO_FEATURE_MULTIPLE_APPDOMAINS -unsafe -resource:resources/Asterisk.wav -resource:resources/Beep.wav -resource:resources/Exclamation.wav -resource:resources/Hand.wav -resource:resources/Question.wav</flags>
+      <flags>/codepage:65001 -d:NET_4_0 -d:NET_4_5 -d:NET_4_6 -d:MONO -nowarn:1699 -nostdlib -r:./../../class/lib/xammac_net_4_5/mscorlib.dll -debug -d:FEATURE_INTERCEPTABLE_THREADPOOL_CALLBACK -d:NO_SYSTEM_DRAWING_DEPENDENCY -d:NO_WINFORMS_DEPENDENCY -d:NO_SYSTEM_WEB_DEPENDENCY -d:XAMMAC_4_5 -d:XAMARIN_MODERN -optimize /noconfig -d:CONFIGURATION_2_0 -d:FEATURE_PAL,SYSTEM_NAMESPACE,MONO,PLATFORM_UNIX -d:MONO_FEATURE_PROCESS_START -d:MONO_FEATURE_THREAD_ABORT -d:MONO_FEATURE_THREAD_SUSPEND_RESUME -d:MONO_FEATURE_MULTIPLE_APPDOMAINS -unsafe -resource:resources/Asterisk.wav -resource:resources/Beep.wav -resource:resources/Exclamation.wav -resource:resources/Hand.wav -resource:resources/Question.wav -d:MONO_FEATURE_BTLS</flags>
       <output>System.dll</output>
       <built_sources></built_sources>
       <library_output>./../../class/lib/xammac_net_4_5/bare/System.dll</library_output>
     </project>
     <project dir="class/System" library="System-secxml-xammac_net_4_5">
       <boot>false</boot>
-      <flags>/codepage:65001 -d:NET_4_0 -d:NET_4_5 -d:NET_4_6 -d:MONO -nowarn:1699 -nostdlib -r:./../../class/lib/xammac_net_4_5/mscorlib.dll -debug -d:FEATURE_INTERCEPTABLE_THREADPOOL_CALLBACK -d:NO_SYSTEM_DRAWING_DEPENDENCY -d:NO_WINFORMS_DEPENDENCY -d:NO_SYSTEM_WEB_DEPENDENCY -d:XAMMAC_4_5 -d:XAMARIN_MODERN -optimize /noconfig -nowarn:618 -d:CONFIGURATION_2_0 -d:FEATURE_PAL,SYSTEM_NAMESPACE,MONO,PLATFORM_UNIX -d:MONO_FEATURE_PROCESS_START -d:MONO_FEATURE_THREAD_ABORT -d:MONO_FEATURE_THREAD_SUSPEND_RESUME -d:MONO_FEATURE_MULTIPLE_APPDOMAINS -unsafe -resource:resources/Asterisk.wav -resource:resources/Beep.wav -resource:resources/Exclamation.wav -resource:resources/Hand.wav -resource:resources/Question.wav -d:SECURITY_DEP -d:XML_DEP -d:MONO_SECURITY_ALIAS -r:./../../class/lib/xammac_net_4_5/bare/System.Xml.dll -r:MonoSecurity=./../../class/lib/xammac_net_4_5/Mono.Security.dll</flags>
+      <flags>/codepage:65001 -d:NET_4_0 -d:NET_4_5 -d:NET_4_6 -d:MONO -nowarn:1699 -nostdlib -r:./../../class/lib/xammac_net_4_5/mscorlib.dll -debug -d:FEATURE_INTERCEPTABLE_THREADPOOL_CALLBACK -d:NO_SYSTEM_DRAWING_DEPENDENCY -d:NO_WINFORMS_DEPENDENCY -d:NO_SYSTEM_WEB_DEPENDENCY -d:XAMMAC_4_5 -d:XAMARIN_MODERN -optimize /noconfig -d:CONFIGURATION_2_0 -d:FEATURE_PAL,SYSTEM_NAMESPACE,MONO,PLATFORM_UNIX -d:MONO_FEATURE_PROCESS_START -d:MONO_FEATURE_THREAD_ABORT -d:MONO_FEATURE_THREAD_SUSPEND_RESUME -d:MONO_FEATURE_MULTIPLE_APPDOMAINS -unsafe -resource:resources/Asterisk.wav -resource:resources/Beep.wav -resource:resources/Exclamation.wav -resource:resources/Hand.wav -resource:resources/Question.wav -d:MONO_FEATURE_BTLS -d:SECURITY_DEP -d:XML_DEP -d:MONO_SECURITY_ALIAS -r:./../../class/lib/xammac_net_4_5/bare/System.Xml.dll -r:MonoSecurity=./../../class/lib/xammac_net_4_5/Mono.Security.dll</flags>
       <output>System.dll</output>
       <built_sources></built_sources>
       <library_output>./../../class/lib/xammac_net_4_5/secxml/System.dll</library_output>
index 068bb1d3dc0269bc87633813b76bae786ca0ac63..9ca318346557b586ab6b35914619cfa8fbe249dc 100644 (file)
@@ -165,10 +165,13 @@ CLEANFILES = etc/mono/config
 etc/mono/config: ../data/config Makefile $(symlinks)
        d=`cd ../support && pwd`; \
        sed 's,target="$$mono_libdir/libMonoPosixHelper$(libsuffix)",target="'$$d'/libMonoPosixHelper.la",' ../data/config > $@t
+       d=`cd ../mono/btls/build-shared && pwd`; \
+       sed 's,target="$$mono_libdir/libmono-btls-shared$(libsuffix)",target="'$$d'/libmono-btls-shared$(libsuffix)",' $@t > $@tt
        if test -z "$(libgdiplus_loc)"; then :; else \
-         sed 's,target="$(libgdiplus_install_loc)",target="$(libgdiplus_loc)",' $@t > $@tt; \
-         mv -f $@tt $@t; fi
-       mv -f $@t $@
+         sed 's,target="$(libgdiplus_install_loc)",target="$(libgdiplus_loc)",' $@tt > $@ttt; \
+         mv -f $@ttt $@tt; fi
+       mv -f $@tt $@
+       rm -f $@t
 
 $(tmpinst)/bin/mono: mono-wrapper etc/mono/config
        $(mkinstalldirs) $(tmpinst)/bin