Diarkis C++Client Library API Document
network.h
Go to the documentation of this file.
1 // © 2019-2024 Diarkis Inc. All rights reserved.
2 
3 
4 #pragma once
5 
6 #include "diarkis/common.h"
7 
8 #if defined(DIARKIS_PLATFORM_WINDOWS)
9 #include <winsock2.h>
10 #include <windows.h>
11 #elif defined(DIARKIS_PLATFORM_XBOX)
12 #include <winsock2.h>
13 #include <windows.h>
14 #elif defined(DIARKIS_PLATFORM_NINTENDO_SWITCH)
15 #include <nn/socket/socket_Types.h>
16 #else
17 #include <sys/socket.h>
18 #endif // DIARKIS_PLATFORM_WINDOWS
19 
20 // ADD NAMESPACE NAME TAG
21 namespace Diarkis { namespace Network { namespace Types
22 {
23 #if defined(DIARKIS_HAS_SOCKADDR_STORAGE)
24 #if defined(DIARKIS_PLATFORM_WINDOWS)
25  using SockAddrStorage = SOCKADDR_STORAGE_LH;
26 #elif defined(DIARKIS_PLATFORM_XBOX)
27  using SockAddrStorage = SOCKADDR_STORAGE_LH;
28 #else
29  using SockAddrStorage = struct sockaddr_storage;
30 #endif // DIARKIS_PLATFORM_WINDOWS
31 #elif defined(DIARKIS_PLATFORM_NINTENDO_SWITCH)
32  using SockAddrStorage = struct nn::socket::SockAddrStorage;
33 #else
34  // define other platform SockAddrStorageNative here
35 #error "struct sockaddr_storage is not defined"
36 #endif // DIARKIS_HAS_SOCKADDR_STORAGE
37 } } }
38 // ADD NAMESPACE } TAG
Diarkis
Definition: commands.h:9
common.h