1
0
mirror of https://github.com/GOSTSec/sgminer synced 2025-01-01 18:55:36 +00:00
sgminer/compat.h

43 lines
708 B
C
Raw Normal View History

2010-11-26 20:50:36 +00:00
#ifndef __COMPAT_H__
#define __COMPAT_H__
#ifdef WIN32
#include <time.h>
#include <pthread.h>
2010-11-26 20:50:36 +00:00
#include <windows.h>
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
#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__ */