aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJeff Garzik <jeff@garzik.org>2010-11-26 15:50:36 -0500
committerJeff Garzik <jgarzik@redhat.com>2010-11-26 15:50:36 -0500
commit352bab2109d491639b9571211b6f59ddeda0e304 (patch)
tree7732467ef2951064a0244e22c0f056b7238ff8b0
parentb7cc9b68ad0df14e976fa02e5eaa51149aac2414 (diff)
Introduce compat.h, for Win32 builds
-rw-r--r--compat.h15
-rw-r--r--cpu-miner.c1
2 files changed, 16 insertions, 0 deletions
diff --git a/compat.h b/compat.h
new file mode 100644
index 0000000..a318991
--- /dev/null
+++ b/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__ */
diff --git a/cpu-miner.c b/cpu-miner.c
index 05b5a9a..f1eacf7 100644
--- a/cpu-miner.c
+++ b/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"