Planet
navi homePPSaboutscreenshotsdownloaddevelopmentforum

source: code/trunk/src/external/enet/win32.h @ 10462

Last change on this file since 10462 was 7954, checked in by rgrieder, 14 years ago

Resolved ENet and windows header include problem for good.

  • Property svn:eol-style set to native
File size: 1.5 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
49typedef fd_set ENetSocketSet;
50
51#define ENET_SOCKETSET_EMPTY(sockset)          FD_ZERO (& (sockset))
52#define ENET_SOCKETSET_ADD(sockset, socket)    FD_SET (socket, & (sockset))
53#define ENET_SOCKETSET_REMOVE(sockset, socket) FD_CLEAR (socket, & (sockset))
54#define ENET_SOCKETSET_CHECK(sockset, socket)  FD_ISSET (socket, & (sockset))
55
56#ifndef AI_ADDRCONFIG
57#define AI_ADDRCONFIG 0x0400 /* AI_ADDRCONFIG is not defined everywhere */
58#endif
59
60#endif /* __ENET_WIN32_H__ */
61
62
Note: See TracBrowser for help on using the repository browser.