osdepend.h

./mud++0.26/src/win32/osdepend.h · 910 B

From the archive mud++0.26f.tar.gz

Download the archive   « Back to the archive contents

// Hacks for WIN32 system

#ifndef WIN32_OSDEPEND_H
#define WIN32_OSDEPEND_H

#include <winsock.h>
#include <sys/timeb.h>
#include <process.h>

typedef unsigned char bool;
const unsigned char true = 1;
const unsigned char false = 0;

inline void gettimeofday( struct timeval * t , int )
{
	struct _timeb timebuffer;
	_ftime (& timebuffer);
	t->tv_sec = timebuffer.time;
	t->tv_usec = timebuffer.millitm * 1000;
}

extern bool DOWN;
extern WSAData WinsockInfo;

inline void mudpp_exit( int ecode )
{
	WSACleanup();
	exit(ecode);
}

//shameful hack, but working for now
#define EINPROGRESS WSAEINPROGRESS

#endif
#ifndef UNIX_OSDEPEND_H
#define UNIX_OSDEPEND_H

inline void mudpp_exit( int rcode )
{
	exit(rcode);
}

#endif
#ifndef OSDEPEND_H
#define OSDEPEND_H

#if defined(WIN32)
#include "win32/osdepend.h"
#elif defined(__CYGWIN32__)
// more elifs when needed
#else
#include "unix/osdepend.h"
#endif

#endif

Site Stats

Snippets: 1791
Codebases: 571