Browse Source

Introduce compat.h, for Win32 builds

Jeff Garzik 15 years ago
parent
commit
352bab2109
2 changed files with 16 additions and 0 deletions
  1. 15 0
      compat.h
  2. 1 0
      cpu-miner.c

+ 15 - 0
compat.h

@@ -0,0 +1,15 @@
+#ifndef __COMPAT_H__
+#define __COMPAT_H__
+
+#ifdef WIN32
+
+#include <windows.h>
+
+static inline void sleep(int secs)
+{
+	Sleep(secs * 1000);
+}
+
+#endif /* WIN32 */
+
+#endif /* __COMPAT_H__ */

+ 1 - 0
cpu-miner.c

@@ -20,6 +20,7 @@
 #include <pthread.h>
 #include <getopt.h>
 #include <jansson.h>
+#include "compat.h"
 #include "miner.h"
 
 #define PROGRAM_NAME		"minerd"