Planet
navi homePPSaboutscreenshotsdownloaddevelopmentforum

source: code/branches/network/src/enet/win32.h @ 498

Last change on this file since 498 was 134, checked in by scheusso, 17 years ago

nothing so far

File size: 1.1 KB
Line 
1/**
2 @file  win32.h
3 @brief ENet Win32 header
4*/
5#ifndef __ENET_WIN32_H__
6#define __ENET_WIN32_H__
7
8#ifdef ENET_BUILDING_LIB
9#pragma warning (disable: 4996) // 'strncpy' was declared deprecated
10#pragma warning (disable: 4267) // size_t to int conversion
11#pragma warning (disable: 4244) // 64bit to 32bit int
12#pragma warning (disable: 4018) // signed/unsigned mismatch
13#endif
14
15#include <stdlib.h>
16#include <winsock2.h>
17
18typedef SOCKET ENetSocket;
19
20enum
21{
22    ENET_SOCKET_NULL = INVALID_SOCKET
23};
24
25#define ENET_HOST_TO_NET_16(value) (htons (value))
26#define ENET_HOST_TO_NET_32(value) (htonl (value))
27
28#define ENET_NET_TO_HOST_16(value) (ntohs (value))
29#define ENET_NET_TO_HOST_32(value) (ntohl (value))
30
31typedef struct
32{
33    size_t dataLength;
34    void * data;
35} ENetBuffer;
36
37#define ENET_CALLBACK __cdecl
38
39#if defined ENET_DLL
40#if defined ENET_BUILDING_LIB
41#define ENET_API __declspec( dllexport )
42#else
43#define ENET_API __declspec( dllimport )
44#endif /* ENET_BUILDING_LIB */
45#else /* !ENET_DLL */
46#define ENET_API extern
47#endif /* ENET_DLL */
48
49#endif /* __ENET_WIN32_H__ */
50
51
Note: See TracBrowser for help on using the repository browser.