diff --git a/drivers/unix/net_socket_posix.h b/drivers/unix/net_socket_posix.h index aa59ff36eedb..0bb10868364d 100644 --- a/drivers/unix/net_socket_posix.h +++ b/drivers/unix/net_socket_posix.h @@ -33,6 +33,8 @@ #include "core/io/net_socket.h" +#ifndef UNIX_SOCKET_UNAVAILABLE + #if defined(WINDOWS_ENABLED) #include #include @@ -105,4 +107,6 @@ class NetSocketPosix : public NetSocket { ~NetSocketPosix(); }; +#endif + #endif // NET_SOCKET_POSIX_H diff --git a/drivers/unix/os_unix.cpp b/drivers/unix/os_unix.cpp index 8a9b13006897..41bac8f3bd8a 100644 --- a/drivers/unix/os_unix.cpp +++ b/drivers/unix/os_unix.cpp @@ -166,7 +166,9 @@ void OS_Unix::initialize_core() { DirAccess::make_default(DirAccess::ACCESS_USERDATA); DirAccess::make_default(DirAccess::ACCESS_FILESYSTEM); +#ifndef UNIX_SOCKET_UNAVAILABLE NetSocketPosix::make_default(); +#endif IPUnix::make_default(); process_map = memnew((HashMap)); @@ -175,7 +177,9 @@ void OS_Unix::initialize_core() { void OS_Unix::finalize_core() { memdelete(process_map); +#ifndef UNIX_SOCKET_UNAVAILABLE NetSocketPosix::cleanup(); +#endif } Vector OS_Unix::get_video_adapter_driver_info() const { diff --git a/platform/web/detect.py b/platform/web/detect.py index 26bbbccffa5d..25a5bbe5a596 100644 --- a/platform/web/detect.py +++ b/platform/web/detect.py @@ -201,7 +201,7 @@ def configure(env: "SConsEnvironment"): sys.exit(255) env.Prepend(CPPPATH=["#platform/web"]) - env.Append(CPPDEFINES=["WEB_ENABLED", "UNIX_ENABLED"]) + env.Append(CPPDEFINES=["WEB_ENABLED", "UNIX_ENABLED", "UNIX_SOCKET_UNAVAILABLE"]) if env["opengl3"]: env.AppendUnique(CPPDEFINES=["GLES3_ENABLED"])