Fix compilation errors on mingw32 to do with order of pulling in headers, curses.h and definition of bool.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65
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) { }