1
0
mirror of https://github.com/GOSTSec/sgminer synced 2025-02-03 02:24:35 +00:00

sleep function still needed for MingW not MW-W64

This commit is contained in:
tonobitc 2014-01-28 14:50:54 -08:00
parent d203dddabb
commit af01573a4f

View File

@ -47,16 +47,18 @@ static inline int nanosleep(const struct timespec *req, struct timespec *rem)
} }
#endif #endif
/* Reported unneded in https://github.com/veox/sgminer/issues/37 */ #if defined __MINGW32__ && !defined __MINGW64_VERSION_MAJOR
/* static inline int sleep(unsigned int secs) */ // Reported unneded in https://github.com/veox/sgminer/issues/37 */
/* { */ static inline int sleep(unsigned int secs)
/* struct timespec req, rem; */ {
/* req.tv_sec = secs; */ struct timespec req, rem;
/* req.tv_nsec = 0; */ req.tv_sec = secs;
/* if (!nanosleep(&req, &rem)) */ req.tv_nsec = 0;
/* return 0; */ if (!nanosleep(&req, &rem))
/* return rem.tv_sec + (rem.tv_nsec ? 1 : 0); */ return 0;
/* } */ return rem.tv_sec + (rem.tv_nsec ? 1 : 0);
}
#endif
enum { enum {
PRIO_PROCESS = 0, PRIO_PROCESS = 0,