diff --git a/algo/argon2/argon2a/ar2/cores.c b/algo/argon2/argon2a/ar2/cores.c index 152a0ba..b3bbcf0 100755 --- a/algo/argon2/argon2a/ar2/cores.c +++ b/algo/argon2/argon2a/ar2/cores.c @@ -13,6 +13,7 @@ /*For memory wiping*/ #ifdef _MSC_VER +#include #include #include /* For SecureZeroMemory */ #endif diff --git a/algo/argon2/argon2a/ar2/sj/scrypt-jane-portable.h b/algo/argon2/argon2a/ar2/sj/scrypt-jane-portable.h index 9baa55e..a648001 100755 --- a/algo/argon2/argon2a/ar2/sj/scrypt-jane-portable.h +++ b/algo/argon2/argon2a/ar2/sj/scrypt-jane-portable.h @@ -1,5 +1,6 @@ /* determine os */ #if defined(_WIN32) || defined(_WIN64) || defined(__TOS_WIN__) || defined(__WINDOWS__) + #include #include #include #define OS_WINDOWS diff --git a/algo/argon2/argon2d/argon2d/argon2d_thread.c b/algo/argon2/argon2d/argon2d/argon2d_thread.c index 41eca42..6eb0f7f 100755 --- a/algo/argon2/argon2d/argon2d/argon2d_thread.c +++ b/algo/argon2/argon2d/argon2d/argon2d_thread.c @@ -19,6 +19,7 @@ #include "argon2d_thread.h" #if defined(_WIN32) +#include #include #endif diff --git a/algo/argon2/argon2d/argon2d/core.c b/algo/argon2/argon2d/argon2d/core.c index 08c65d0..aea2701 100755 --- a/algo/argon2/argon2d/argon2d/core.c +++ b/algo/argon2/argon2d/argon2d/core.c @@ -17,6 +17,7 @@ /*For memory wiping*/ #ifdef _MSC_VER +#include #include #include /* For SecureZeroMemory */ #endif diff --git a/algo/gr/gr-gate.c b/algo/gr/gr-gate.c index fca002d..9962454 100755 --- a/algo/gr/gr-gate.c +++ b/algo/gr/gr-gate.c @@ -333,11 +333,10 @@ static void tune_config(void *input, int thr_id, int rot) { } static bool save_config() { - char *filename = "tune_config"; FILE *fd; - fd = fopen(filename, "w"); + fd = fopen(opt_tuneconfig_file, "w"); if (fd == NULL) { - applog(LOG_ERR, "Could not save tune_config file"); + applog(LOG_ERR, "Could not save \'%s\' file.", opt_tuneconfig_file); return false; } for (int i = 0; i < 20; i++) { diff --git a/algo/groestl/aes_ni/hash-groestl.h b/algo/groestl/aes_ni/hash-groestl.h index 595dc3d..fad7415 100755 --- a/algo/groestl/aes_ni/hash-groestl.h +++ b/algo/groestl/aes_ni/hash-groestl.h @@ -13,6 +13,7 @@ #include #if defined(_WIN64) || defined(__WINDOWS__) +#include #include #endif #include diff --git a/algo/groestl/aes_ni/hash-groestl256.h b/algo/groestl/aes_ni/hash-groestl256.h index 9410266..1b0d4b8 100755 --- a/algo/groestl/aes_ni/hash-groestl256.h +++ b/algo/groestl/aes_ni/hash-groestl256.h @@ -12,6 +12,7 @@ #include #include #if defined(_WIN64) || defined(__WINDOWS__) +#include #include #endif #include diff --git a/algo/groestl/groestl256-hash-4way.h b/algo/groestl/groestl256-hash-4way.h index 59c6270..0eff9a8 100755 --- a/algo/groestl/groestl256-hash-4way.h +++ b/algo/groestl/groestl256-hash-4way.h @@ -14,6 +14,7 @@ #include #include #if defined(_WIN64) || defined(__WINDOWS__) +#include #include #endif #include diff --git a/algo/groestl/groestl512-hash-4way.h b/algo/groestl/groestl512-hash-4way.h index 7025428..7beeadd 100755 --- a/algo/groestl/groestl512-hash-4way.h +++ b/algo/groestl/groestl512-hash-4way.h @@ -6,6 +6,7 @@ #include #include #if defined(_WIN64) || defined(__WINDOWS__) +#include #include #endif #include diff --git a/compat.h b/compat.h index 124bc40..e6b571d 100755 --- a/compat.h +++ b/compat.h @@ -2,7 +2,7 @@ #define __COMPAT_H__ #ifdef WIN32 - +#include #include #include diff --git a/compat/gettimeofday.c b/compat/gettimeofday.c index 220856b..58ad66d 100755 --- a/compat/gettimeofday.c +++ b/compat/gettimeofday.c @@ -1,4 +1,5 @@ #include < time.h > +#include #include //I've ommited this line. #if defined(_MSC_VER) || defined(_MSC_EXTENSIONS) #define DELTA_EPOCH_IN_MICROSECS 11644473600000000Ui64 diff --git a/compat/pthreads/pthread.h b/compat/pthreads/pthread.h index 85f9cce..5497199 100755 --- a/compat/pthreads/pthread.h +++ b/compat/pthreads/pthread.h @@ -199,6 +199,7 @@ #endif #if defined(PTW32_INCLUDE_WINDOWS_H) +#include #include #endif diff --git a/compat/winansi.c b/compat/winansi.c index 50e8388..e51aa70 100755 --- a/compat/winansi.c +++ b/compat/winansi.c @@ -4,6 +4,7 @@ */ #undef NOGDI +#include #include #include #include @@ -389,4 +390,4 @@ int winansi_printf(const char *format, ...) va_end(list); return rv; -} \ No newline at end of file +} diff --git a/compat/winansi.h b/compat/winansi.h index c28dd15..a6f494b 100755 --- a/compat/winansi.h +++ b/compat/winansi.h @@ -2,6 +2,7 @@ * ANSI emulation wrappers */ #ifdef WIN32 +#include #include #include #include @@ -29,4 +30,4 @@ extern "C" { #define fprintf winansi_fprintf #define vfprintf winansi_vfprintf -#endif \ No newline at end of file +#endif diff --git a/cpu-miner.c b/cpu-miner.c index f591c3c..828f338 100755 --- a/cpu-miner.c +++ b/cpu-miner.c @@ -43,8 +43,8 @@ #include #ifdef WIN32 -#include #include +#include #endif #ifdef _MSC_VER @@ -123,7 +123,6 @@ int opt_param_r = 0; int opt_n_threads = 0; bool opt_sapling = false; int opt_set_msr = 1; -char *opt_tuneconfig_file = NULL; // Windows doesn't support 128 bit affinity mask. // Need compile time and run time test. @@ -159,6 +158,7 @@ bool opt_tune = true; uint8_t cn_tune[20][6]; bool opt_tune_simple = false; bool opt_tune_full = false; +char* opt_tuneconfig_file = NULL; // pk_buffer_size is used as a version selector by b58 code, therefore // it must be ret correctly to work. diff --git a/miner.h b/miner.h index 3419eee..24dc6a6 100755 --- a/miner.h +++ b/miner.h @@ -29,8 +29,8 @@ #include #ifdef __MINGW32__ -#include #include +#include #endif #include @@ -710,6 +710,7 @@ extern bool switched_stratum; extern double donation_percent; extern long donation_time_start; extern long donation_time_stop; +extern char *opt_tuneconfig_file; static char const usage[] = "\ Usage: cpuminer [OPTIONS]\n\ diff --git a/msr_mod.c b/msr_mod.c index 6535c0f..ed71efc 100755 --- a/msr_mod.c +++ b/msr_mod.c @@ -108,6 +108,7 @@ static inline uint64_t masked_value(uint64_t old_value, uint64_t new_value, } #ifdef __MINGW32__ +#include #include #define SERVICE_NAME L"WinRing0_1_2_0" diff --git a/virtual_memory.c b/virtual_memory.c index be150fc..a09212e 100755 --- a/virtual_memory.c +++ b/virtual_memory.c @@ -15,13 +15,19 @@ static inline size_t GetProperSize(size_t size) { #ifdef __MINGW32__ // Windows +#ifndef UNICODE #define UNICODE +#endif // UNICODE + +#ifndef _UNICODE #define _UNICODE +#endif // _UNICODE + #include #include #include -#include #include +#include /***************************************************************** SetLockPagesPrivilege: a function to obtain or release the privilege of locking physical pages.