[netcore] Disable socket support to fix warnings.
authorZoltan Varga <vargaz@gmail.com>
Sun, 1 Sep 2019 11:30:07 +0000 (07:30 -0400)
committerLarry Ewing <lewing@microsoft.com>
Wed, 4 Sep 2019 02:24:23 +0000 (21:24 -0500)
Commit migrated from https://github.com/mono/mono/commit/4107a1538993b75e08f5ed062a27bb76dfd20c5a

src/mono/mono/metadata/appdomain.c
src/mono/mono/metadata/w32socket.c

index 50e77d9..d400f1a 100644 (file)
@@ -362,10 +362,7 @@ mono_runtime_init_checked (MonoDomain *domain, MonoThreadStartCB start_cb, MonoT
                mono_runtime_install_appctx_properties ();
 #endif
 
-#ifndef DISABLE_SOCKETS
        mono_network_init ();
-#endif
-       
        mono_console_init ();
        mono_attach_init ();
 
@@ -527,10 +524,7 @@ mono_runtime_cleanup (MonoDomain *domain)
        mono_gc_cleanup ();
 
        mono_thread_cleanup ();
-
-#ifndef DISABLE_SOCKETS
        mono_network_cleanup ();
-#endif
        mono_marshal_cleanup ();
 
        mono_type_initialization_cleanup ();
index 639f331..3881939 100644 (file)
@@ -16,7 +16,9 @@
 
 #include <config.h>
 
-#ifndef DISABLE_SOCKETS
+#include <mono/metadata/w32socket.h>
+
+#if !defined(DISABLE_SOCKETS) && !defined(ENABLE_NETCORE)
 
 #if defined(__APPLE__) || defined(__FreeBSD__)
 #define __APPLE_USE_RFC_3542
@@ -66,7 +68,6 @@
 #include <mono/utils/mono-memory-model.h>
 #include <mono/utils/networking.h>
 #include <mono/metadata/w32handle.h>
-#include <mono/metadata/w32socket.h>
 #include <mono/metadata/w32socket-internals.h>
 #include <mono/metadata/w32error.h>
 
@@ -2655,4 +2656,16 @@ ves_icall_cancel_blocking_socket_operation (MonoThreadObjectHandle thread, MonoE
        mono_thread_info_abort_socket_syscall_for_close (MONO_UINT_TO_NATIVE_THREAD_ID (tid));
 }
 
+#else
+
+void
+mono_network_init (void)
+{
+}
+
+void
+mono_network_cleanup (void)
+{
+}
+
 #endif /* #ifndef DISABLE_SOCKETS */