Browse Source

Merge commit 'cd61807' into bfgminer-3.2.x

Luke Dashjr 12 years ago
parent
commit
9e9b4ed834
2 changed files with 5 additions and 1 deletions
  1. 3 1
      compat.h
  2. 2 0
      configure.ac

+ 3 - 1
compat.h

@@ -123,7 +123,7 @@ static inline int nanosleep(const struct timespec *req, struct timespec *rem)
 #undef cgtime
 #endif
 
-#ifdef WIN32
+#ifndef HAVE_SLEEP
 static inline int sleep(unsigned int secs)
 {
 	struct timespec req, rem;
@@ -133,7 +133,9 @@ static inline int sleep(unsigned int secs)
 		return 0;
 	return rem.tv_sec + (rem.tv_nsec ? 1 : 0);
 }
+#endif
 
+#ifdef WIN32
 enum {
 	PRIO_PROCESS		= 0,
 };

+ 2 - 0
configure.ac

@@ -76,6 +76,8 @@ AC_CHECK_HEADERS([sys/epoll.h])
 AC_CHECK_HEADERS([sys/prctl.h])
 AC_CHECK_HEADERS([sys/file.h])
 
+AC_CHECK_FUNCS([sleep])
+
 AC_FUNC_ALLOCA
 
 have_cygwin=false