2010-11-26 20:50:36 +00:00
|
|
|
#ifndef __COMPAT_H__
|
|
|
|
#define __COMPAT_H__
|
|
|
|
|
|
|
|
#ifdef WIN32
|
2012-02-12 06:00:44 +00:00
|
|
|
#include <time.h>
|
|
|
|
#include <pthread.h>
|
2010-11-26 20:50:36 +00:00
|
|
|
|
|
|
|
#include <windows.h>
|
|
|
|
|
2012-02-12 06:00:44 +00:00
|
|
|
static inline void nanosleep(struct timespec *rgtp, void *__unused)
|
|
|
|
{
|
|
|
|
Sleep(rgtp->tv_nsec / 1000000);
|
|
|
|
}
|
|
|
|
static inline void sleep(unsigned int secs)
|
2010-11-26 20:50:36 +00:00
|
|
|
{
|
|
|
|
Sleep(secs * 1000);
|
|
|
|
}
|
|
|
|
|
2010-11-26 21:28:12 +00:00
|
|
|
enum {
|
|
|
|
PRIO_PROCESS = 0,
|
|
|
|
};
|
|
|
|
|
|
|
|
static inline int setpriority(int which, int who, int prio)
|
|
|
|
{
|
|
|
|
/* FIXME - actually do something */
|
|
|
|
return 0;
|
|
|
|
}
|
|
|
|
|
2011-06-24 18:43:37 +00:00
|
|
|
typedef unsigned long int ulong;
|
|
|
|
typedef unsigned short int ushort;
|
|
|
|
typedef unsigned int uint;
|
|
|
|
|
2011-07-18 01:37:16 +00:00
|
|
|
#ifndef __SUSECONDS_T_TYPE
|
|
|
|
typedef long suseconds_t;
|
|
|
|
#endif
|
|
|
|
|
2012-02-12 06:00:44 +00:00
|
|
|
#define PTH(thr) ((thr)->pth.p)
|
|
|
|
#else
|
|
|
|
#define PTH(thr) ((thr)->pth)
|
2010-11-26 20:50:36 +00:00
|
|
|
#endif /* WIN32 */
|
|
|
|
|
|
|
|
#endif /* __COMPAT_H__ */
|