Commit 16aff37c6629218899bc6b80633345b41f8b2fec

Con Kolivas 2011-09-06T09:36:42

Fix compilation errors on mingw32 to do with order of pulling in headers, curses.h and definition of bool.

diff --git a/adl.c b/adl.c
index 9e3a794..df575a3 100644
--- a/adl.c
+++ b/adl.c
@@ -1,25 +1,25 @@
-#include "miner.h"
-#include "adl.h"
-
-bool adl_active;
+#include "config.h"
 
 #ifdef HAVE_ADL
-#if defined (__linux)
- #include "ADL_SDK/adl_sdk.h"
- #include <dlfcn.h>
- #include <stdlib.h>
- #include <unistd.h>
-#else
- #include <windows.h>
- #include <tchar.h>
- #include "ADL_SDK/adl_sdk.h"
-#endif
 
 #include <stdio.h>
 #include <curses.h>
 
+#include "miner.h"
+#include "ADL_SDK/adl_sdk.h"
+
+#if defined (__linux)
+#include <dlfcn.h>
+#include <stdlib.h>
+#include <unistd.h>
+#else
+#include <windows.h>
+#include <tchar.h>
+#endif
 #include "adl_functions.h"
 
+bool adl_active;
+
 int opt_hysteresis = 3;
 int opt_targettemp = 75;
 int opt_overheattemp = 85;
diff --git a/adl.h b/adl.h
index 817e21d..f3d95e9 100644
--- a/adl.h
+++ b/adl.h
@@ -1,7 +1,7 @@
 #ifndef __ADL_H__
 #define __ADL_H__
-bool adl_active;
 #ifdef HAVE_ADL
+bool adl_active;
 int opt_hysteresis;
 int opt_targettemp;
 int opt_overheattemp;
@@ -19,6 +19,7 @@ void change_gpusettings(int gpu);
 void gpu_autotune(int gpu);
 void clear_adl(int nDevs);
 #else /* HAVE_ADL */
+#define adl_active (0)
 static inline void init_adl(int nDevs) {}
 static inline void change_gpusettings(int gpu) { }
 static inline void gpu_autotune(int gpu) { }