1234567891011121314151617181920212223242526272829303132333435363738394041424344 |
- #ifndef Network_H
- #define Network_H
- #ifdef WIN32
- #ifdef _DEBUG
- #ifndef _LTMDB
- #define _CRTDBG_MAP_ALLOC
- #include <stdlib.h>
- #include <crtdbg.h>
- #define DEBUG_CLIENTBLOCK new( _CLIENT_BLOCK, __FILE__, __LINE__)
- #define new DEBUG_CLIENTBLOCK
- #define _LTMDB
- #endif
- #endif
- #define _WINSOCK_DEPRECATED_NO_WARNINGS
- #include <WinSock2.h>
- #else
- #include <netinet/in.h>
- #include <arpa/inet.h>
- #include <sys/socket.h>
- #include <sys/time.h>
- #include <unistd.h>
- #include <fcntl.h>
- #include <iostream>
- #define __declspec( x )
- #define __int64 long long
- #ifndef SOCKET
- #define SOCKET int
- #define SOCKADDR_IN sockaddr_in
- #define ADDR_ANY INADDR_ANY
- #define closesocket close
- #define PHOSTENT hostent*
- #endif
- #endif
- namespace Network
- {
- __declspec( dllexport ) void Start( int maxClients );
- __declspec( dllexport ) void getHostName( char *name, int bufferLen );
- __declspec( dllexport ) char *getHostAddresse();
- __declspec( dllexport ) void Exit();
- }
- #endif
|