mirror of
https://onedev.site.tesses.net/tesses-framework
synced 2026-02-09 00:05:46 +00:00
Fix afunix win32
This commit is contained in:
@@ -25,7 +25,12 @@ using HttpUtils = Tesses::Framework::Http::HttpUtils;
|
|||||||
#include <winsock2.h>
|
#include <winsock2.h>
|
||||||
#include <iphlpapi.h>
|
#include <iphlpapi.h>
|
||||||
#include <windows.h>
|
#include <windows.h>
|
||||||
|
#if defined __has_include
|
||||||
|
#if __has_include(<afunix.h>)
|
||||||
#include <afunix.h>
|
#include <afunix.h>
|
||||||
|
#define HAS_AFUNIX
|
||||||
|
#endif
|
||||||
|
#endif
|
||||||
#undef min
|
#undef min
|
||||||
#pragma comment(lib, "ws2_32.lib")
|
#pragma comment(lib, "ws2_32.lib")
|
||||||
#else
|
#else
|
||||||
@@ -281,7 +286,7 @@ namespace Tesses::Framework::Streams {
|
|||||||
this->endOfStream=false;
|
this->endOfStream=false;
|
||||||
this->owns = true;
|
this->owns = true;
|
||||||
this->success=false;
|
this->success=false;
|
||||||
#if defined(AF_UNIX) && !defined(GEKKO) && !defined(__PS2__) && !defined(__SWITCH__)
|
#if defined(AF_UNIX) && !defined(GEKKO) && !defined(__PS2__) && !defined(__SWITCH__) && ((defined(_WIN32) && defined(HAS_AFUNIX) ) || !defined(_WIN32))
|
||||||
this->sock = NETWORK_SOCKET(AF_UNIX,SOCK_STREAM,0);
|
this->sock = NETWORK_SOCKET(AF_UNIX,SOCK_STREAM,0);
|
||||||
if(this->sock < 0)
|
if(this->sock < 0)
|
||||||
{
|
{
|
||||||
@@ -324,7 +329,7 @@ namespace Tesses::Framework::Streams {
|
|||||||
|
|
||||||
this->owns=true;
|
this->owns=true;
|
||||||
this->valid=false;
|
this->valid=false;
|
||||||
#if defined(AF_UNIX) && !defined(GEKKO) && !defined(__PS2__) && !defined(__SWITCH__)
|
#if defined(AF_UNIX) && !defined(GEKKO) && !defined(__PS2__) && !defined(__SWITCH__) && ((defined(_WIN32) && defined(HAS_AFUNIX) ) || !defined(_WIN32))
|
||||||
|
|
||||||
this->sock = NETWORK_SOCKET(AF_UNIX,SOCK_STREAM,0);
|
this->sock = NETWORK_SOCKET(AF_UNIX,SOCK_STREAM,0);
|
||||||
if(this->sock < 0)
|
if(this->sock < 0)
|
||||||
@@ -565,7 +570,7 @@ namespace Tesses::Framework::Streams {
|
|||||||
#endif
|
#endif
|
||||||
break;
|
break;
|
||||||
case SocketType::ST_UNIX:
|
case SocketType::ST_UNIX:
|
||||||
#if defined(AF_UNIX)
|
#if defined(AF_UNIX) && ((defined(_WIN32) && defined(HAS_AFUNIX) ) || !defined(_WIN32))
|
||||||
this->sock = NETWORK_SOCKET(AF_UNIX,SOCK_DGRAM, 0);
|
this->sock = NETWORK_SOCKET(AF_UNIX,SOCK_DGRAM, 0);
|
||||||
|
|
||||||
#endif
|
#endif
|
||||||
|
|||||||
Reference in New Issue
Block a user