diff options
| author | 2020-08-31 10:09:06 -0400 | |
|---|---|---|
| committer | 2020-12-06 18:56:40 -0500 | |
| commit | 0e122c13ad42c9b782d556bfb1d6541499cd650e (patch) | |
| tree | 899ffb51a317e1ee5c1c9a9df8ffc4614285f411 /src/core/network | |
| parent | Merge pull request #5146 from comex/xx-num (diff) | |
| download | yuzu-0e122c13ad42c9b782d556bfb1d6541499cd650e.tar.gz yuzu-0e122c13ad42c9b782d556bfb1d6541499cd650e.tar.xz yuzu-0e122c13ad42c9b782d556bfb1d6541499cd650e.zip | |
CMakeLists,network: Create YUZU_UNIX macro to replace __unix__
__unix__ is not predefined on Apple platforms even though they are Unix.
Diffstat (limited to 'src/core/network')
| -rw-r--r-- | src/core/network/network.cpp | 6 | ||||
| -rw-r--r-- | src/core/network/sockets.h | 4 |
2 files changed, 5 insertions, 5 deletions
diff --git a/src/core/network/network.cpp b/src/core/network/network.cpp index 5ef2e8511..5a8cc6fc2 100644 --- a/src/core/network/network.cpp +++ b/src/core/network/network.cpp | |||
| @@ -11,7 +11,7 @@ | |||
| 11 | #ifdef _WIN32 | 11 | #ifdef _WIN32 |
| 12 | #define _WINSOCK_DEPRECATED_NO_WARNINGS // gethostname | 12 | #define _WINSOCK_DEPRECATED_NO_WARNINGS // gethostname |
| 13 | #include <winsock2.h> | 13 | #include <winsock2.h> |
| 14 | #elif __unix__ | 14 | #elif YUZU_UNIX |
| 15 | #include <errno.h> | 15 | #include <errno.h> |
| 16 | #include <fcntl.h> | 16 | #include <fcntl.h> |
| 17 | #include <netdb.h> | 17 | #include <netdb.h> |
| @@ -54,7 +54,7 @@ constexpr IPv4Address TranslateIPv4(in_addr addr) { | |||
| 54 | sockaddr TranslateFromSockAddrIn(SockAddrIn input) { | 54 | sockaddr TranslateFromSockAddrIn(SockAddrIn input) { |
| 55 | sockaddr_in result; | 55 | sockaddr_in result; |
| 56 | 56 | ||
| 57 | #ifdef __unix__ | 57 | #if YUZU_UNIX |
| 58 | result.sin_len = sizeof(result); | 58 | result.sin_len = sizeof(result); |
| 59 | #endif | 59 | #endif |
| 60 | 60 | ||
| @@ -99,7 +99,7 @@ bool EnableNonBlock(SOCKET fd, bool enable) { | |||
| 99 | return ioctlsocket(fd, FIONBIO, &value) != SOCKET_ERROR; | 99 | return ioctlsocket(fd, FIONBIO, &value) != SOCKET_ERROR; |
| 100 | } | 100 | } |
| 101 | 101 | ||
| 102 | #elif __unix__ // ^ _WIN32 v __unix__ | 102 | #elif YUZU_UNIX // ^ _WIN32 v YUZU_UNIX |
| 103 | 103 | ||
| 104 | using SOCKET = int; | 104 | using SOCKET = int; |
| 105 | using WSAPOLLFD = pollfd; | 105 | using WSAPOLLFD = pollfd; |
diff --git a/src/core/network/sockets.h b/src/core/network/sockets.h index 7bdff0fe4..a44393325 100644 --- a/src/core/network/sockets.h +++ b/src/core/network/sockets.h | |||
| @@ -9,7 +9,7 @@ | |||
| 9 | 9 | ||
| 10 | #if defined(_WIN32) | 10 | #if defined(_WIN32) |
| 11 | #include <winsock.h> | 11 | #include <winsock.h> |
| 12 | #elif !defined(__unix__) | 12 | #elif !YUZU_UNIX |
| 13 | #error "Platform not implemented" | 13 | #error "Platform not implemented" |
| 14 | #endif | 14 | #endif |
| 15 | 15 | ||
| @@ -84,7 +84,7 @@ public: | |||
| 84 | 84 | ||
| 85 | #if defined(_WIN32) | 85 | #if defined(_WIN32) |
| 86 | SOCKET fd = INVALID_SOCKET; | 86 | SOCKET fd = INVALID_SOCKET; |
| 87 | #elif defined(__unix__) | 87 | #elif YUZU_UNIX |
| 88 | int fd = -1; | 88 | int fd = -1; |
| 89 | #endif | 89 | #endif |
| 90 | }; | 90 | }; |