From 7f7557b59b08e6fc8c25db7e49242d4e8a1ec1f1 Mon Sep 17 00:00:00 2001 From: elbandi Date: Thu, 31 Mar 2016 21:43:25 +0000 Subject: [PATCH] Fix VERSION redefine warnings --- api.h | 2 -- config_parser.h | 3 --- findnonce.c | 2 -- findnonce.h | 1 - logging.c | 2 +- logging.h | 1 - miner.h | 35 ++++++++++++++--------------------- ocl.h | 9 --------- ocl/binary_kernel.c | 5 +++-- ocl/build_kernel.c | 3 ++- ocl/build_kernel.h | 1 - 11 files changed, 20 insertions(+), 44 deletions(-) diff --git a/api.h b/api.h index cf36628b..4ac1c0ce 100644 --- a/api.h +++ b/api.h @@ -1,8 +1,6 @@ #ifndef API_H #define API_H -#include "config.h" - #include "miner.h" // BUFSIZ varies on Windows and Linux diff --git a/config_parser.h b/config_parser.h index e5b5117d..e42ec5f4 100644 --- a/config_parser.h +++ b/config_parser.h @@ -1,11 +1,8 @@ #ifndef CONFIG_PARSER_H #define CONFIG_PARSER_H -#include "config.h" - #include "miner.h" #include "api.h" -#include "algorithm.h" //profile structure struct profile { diff --git a/findnonce.c b/findnonce.c index 72dcaaef..4e80dac1 100644 --- a/findnonce.c +++ b/findnonce.c @@ -8,8 +8,6 @@ * any later version. See COPYING for more details. */ -#include "config.h" - #include #include #include diff --git a/findnonce.h b/findnonce.h index 9376a57b..64a8361b 100644 --- a/findnonce.h +++ b/findnonce.h @@ -2,7 +2,6 @@ #define FINDNONCE_H #include "miner.h" -#include "config.h" #define MAXTHREADS (0xFFFFFFFEULL) #define MAXBUFFERS (0x100) diff --git a/logging.c b/logging.c index 7f8b5d65..1429831a 100644 --- a/logging.c +++ b/logging.c @@ -12,8 +12,8 @@ #include -#include "logging.h" #include "miner.h" +#include "logging.h" bool opt_debug = false; bool opt_debug_console = false; diff --git a/logging.h b/logging.h index 07d37351..3c554542 100644 --- a/logging.h +++ b/logging.h @@ -1,7 +1,6 @@ #ifndef LOGGING_H #define LOGGING_H -#include "config.h" #include #include diff --git a/miner.h b/miner.h index 00ebbd78..6d08f246 100644 --- a/miner.h +++ b/miner.h @@ -3,24 +3,12 @@ #include "config.h" -#if defined(USE_GIT_VERSION) && defined(GIT_VERSION) -#undef VERSION -#define VERSION GIT_VERSION -#endif - -#ifdef BUILD_NUMBER -#define CGMINER_VERSION VERSION "-" BUILD_NUMBER -#else -#define CGMINER_VERSION VERSION -#endif - -#include "algorithm.h" - #include #include #include #include #include +#include #ifdef HAVE_LIBCURL #include #else @@ -34,22 +22,29 @@ extern char *curly; #endif #include +#if defined(USE_GIT_VERSION) && defined(GIT_VERSION) +#undef VERSION +#define VERSION GIT_VERSION +#endif + +#ifdef BUILD_NUMBER +#define CGMINER_VERSION VERSION "-" BUILD_NUMBER +#else +#define CGMINER_VERSION VERSION +#endif + #include "elist.h" #include "uthash.h" #include "logging.h" #include "util.h" +#include "algorithm.h" + #include #ifndef WIN32 # include # include #endif -#ifdef __APPLE_CC__ -#include -#else -#include -#endif - #ifdef STDC_HEADERS # include # include @@ -135,8 +130,6 @@ static inline int fsync (int fd) #include "ADL_SDK/adl_sdk.h" #endif -#include - #if (!defined(WIN32) && ((__GNUC__ > 4) || (__GNUC__ == 4 && __GNUC_MINOR__ >= 3))) \ || (defined(WIN32) && ((__GNUC__ > 4) || (__GNUC__ == 4 && __GNUC_MINOR__ >= 7))) #ifndef bswap_16 diff --git a/ocl.h b/ocl.h index 8d6467f1..5d423249 100644 --- a/ocl.h +++ b/ocl.h @@ -1,16 +1,7 @@ #ifndef OCL_H #define OCL_H -#include "config.h" - #include -#ifdef __APPLE_CC__ -#include -#else -#include -#endif - -#include "algorithm.h" typedef struct __clState { cl_context context; diff --git a/ocl/binary_kernel.c b/ocl/binary_kernel.c index 4fd77875..874ce61e 100644 --- a/ocl/binary_kernel.c +++ b/ocl/binary_kernel.c @@ -1,8 +1,9 @@ -#include "binary_kernel.h" -#include "miner.h" #include #include +#include "miner.h" +#include "binary_kernel.h" + cl_program load_opencl_binary_kernel(build_kernel_data *data) { FILE *binaryfile = NULL; diff --git a/ocl/build_kernel.c b/ocl/build_kernel.c index 2e1b7383..a5407a01 100644 --- a/ocl/build_kernel.c +++ b/ocl/build_kernel.c @@ -1,6 +1,7 @@ #include -#include "build_kernel.h" + #include "miner.h" +#include "build_kernel.h" static char *file_contents(const char *filename, int *length) { diff --git a/ocl/build_kernel.h b/ocl/build_kernel.h index 89fb8db8..edb57c89 100644 --- a/ocl/build_kernel.h +++ b/ocl/build_kernel.h @@ -2,7 +2,6 @@ #define BUILD_KERNEL_H #include -#include "logging.h" #ifdef __APPLE_CC__ #include