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_MAC
18#include <sys/socket.h>
19#include <netdb.h>
20#include <sys/ioctl.h>
21#elif PLATFORM_ANDROID
22#include <sys/socket.h>
23#include <netdb.h>
24#include <sys/ioctl.h>
25#elif PLATFORM_3DS
26#include <sys/socket.h>
27#include <netdb.h>
28#include <sys/ioctl.h>
29#elif PLATFORM_DOLPHIN
30#include <network.h>
31#elif PLATFORM_ANDROID
32#include <sys/socket.h>
33#include <netdb.h>
34#include <sys/ioctl.h>
35#endif
36
37#if defined(POLYPHASE_PLATFORM_ADDON)
38// SocketHandle typedef supplied by PolyphasePlatform_NetworkTypes.h above.
39// (Addons that stub networking should `typedef int32_t SocketHandle;`.)
40#elif PLATFORM_WINDOWS
41 typedef SOCKET SocketHandle;
42#elif PLATFORM_LINUX
43 typedef int32_t SocketHandle;
44#elif PLATFORM_MAC
45 typedef int32_t SocketHandle;
46#elif PLATFORM_ANDROID
47 typedef int32_t SocketHandle;
48#elif PLATFORM_3DS
49 typedef int32_t SocketHandle;
50#elif PLATFORM_DOLPHIN
51 typedef int32_t SocketHandle;
52#endif
53