Polyphase Game Engine
Loading...
Searching...
No Matches
NetworkTypes.h
Go to the documentation of this file.
1#pragma once
2
3#include <stdint.h>
4
5// Variant 2 platform-extension arm — see SystemTypes.h for the full rationale.
6// NetworkTypes_Platform.h is optional; ActionManager generates a stub bridge
7// when the addon doesn't supply one (engine code then degrades to "no
8// networking" via standard SocketHandle == -1 sentinels).
9#if defined(POLYPHASE_PLATFORM_ADDON)
10#include "PolyphasePlatform_NetworkTypes.h"
11#elif PLATFORM_WINDOWS
12#include <winsock.h>
13#elif PLATFORM_LINUX
14#include <sys/socket.h>
15#include <netdb.h>
16#include <sys/ioctl.h>
17#elif PLATFORM_ANDROID
18#include <sys/socket.h>
19#include <netdb.h>
20#include <sys/ioctl.h>
21#elif PLATFORM_3DS
22#include <sys/socket.h>
23#include <netdb.h>
24#include <sys/ioctl.h>
25#elif PLATFORM_DOLPHIN
26#include <network.h>
27#elif PLATFORM_ANDROID
28#include <sys/socket.h>
29#include <netdb.h>
30#include <sys/ioctl.h>
31#endif
32
33#if defined(POLYPHASE_PLATFORM_ADDON)
34// SocketHandle typedef supplied by PolyphasePlatform_NetworkTypes.h above.
35// (Addons that stub networking should `typedef int32_t SocketHandle;`.)
36#elif PLATFORM_WINDOWS
37 typedef SOCKET SocketHandle;
38#elif PLATFORM_LINUX
39 typedef int32_t SocketHandle;
40#elif PLATFORM_ANDROID
41 typedef int32_t SocketHandle;
42#elif PLATFORM_3DS
43 typedef int32_t SocketHandle;
44#elif PLATFORM_DOLPHIN
45 typedef int32_t SocketHandle;
46#endif
47