diff --git a/.gitignore b/.gitignore index 1f09726..43042b3 100644 --- a/.gitignore +++ b/.gitignore @@ -15,7 +15,7 @@ depcomp missing install-sh stamp-h1 -cpuminer-config.h* +ccminer-config.h* compile config.log config.status @@ -41,6 +41,8 @@ x64/Release/ *.opensdf *.sdf *.pdb +*.VC.opendb +*.VC.db .settings/ .project diff --git a/Makefile.am b/Makefile.am index 9f7bd8e..79b4d41 100644 --- a/Makefile.am +++ b/Makefile.am @@ -9,7 +9,7 @@ endif EXTRA_DIST = autogen.sh README.md README.txt LICENSE.txt \ ccminer.sln ccminer.vcxproj ccminer.vcxproj.filters \ - compat/gettimeofday.c compat/getopt/getopt_long.c cpuminer-config.h.in + compat/gettimeofday.c compat/getopt/getopt_long.c SUBDIRS = compat diff --git a/ccminer.cpp b/ccminer.cpp index a49531c..8e672ac 100644 --- a/ccminer.cpp +++ b/ccminer.cpp @@ -9,7 +9,7 @@ * any later version. See COPYING for more details. */ -#include "cpuminer-config.h" +#include #include #include @@ -3244,7 +3244,7 @@ int main(int argc, char *argv[]) printf("*** ccminer " PACKAGE_VERSION " for nVidia GPUs by tpruvot@github ***\n"); #ifdef _MSC_VER - printf(" Built with VC++ 2013 and nVidia CUDA SDK %d.%d\n\n", + printf(" Built with VC++ %d and nVidia CUDA SDK %d.%d\n\n", msver(), #else printf(" Built with the nVidia CUDA Toolkit %d.%d\n\n", #endif diff --git a/ccminer.vcxproj b/ccminer.vcxproj index 10d32f2..800fa36 100644 --- a/ccminer.vcxproj +++ b/ccminer.vcxproj @@ -23,22 +23,19 @@ ccminer - + Application - false MultiByte v120 false false + + + false true - Application true - MultiByte - v120 - false - false @@ -227,6 +224,7 @@ + false @@ -310,7 +308,7 @@ - + diff --git a/ccminer.vcxproj.filters b/ccminer.vcxproj.filters index ed942f3..33e3c30 100644 --- a/ccminer.vcxproj.filters +++ b/ccminer.vcxproj.filters @@ -219,6 +219,9 @@ Source Files\jansson + + Header Files\compat + Source Files\sph @@ -267,7 +270,7 @@ Header Files - Header Files + Header Files\compat Header Files @@ -290,8 +293,8 @@ Header Files\compat - - Header Files + + Header Files\compat Header Files diff --git a/compat.h b/compat.h index 3e9d975..a98dab9 100644 --- a/compat.h +++ b/compat.h @@ -51,6 +51,17 @@ static __inline int setpriority(int which, int who, int prio) #define strcasecmp(x,y) _stricmp(x,y) typedef int ssize_t; +__inline int msver(void) { + switch (_MSC_VER) { + case 1500: return 2008; + case 1600: return 2010; + case 1700: return 2012; + case 1800: return 2013; + case 1900: return 2015; + default: return (_MSC_VER/100); + } +} + #include static __inline char * dirname(char *file) { char buffer[_MAX_PATH] = { 0 }; diff --git a/cpuminer-config.h b/compat/ccminer-config.h similarity index 92% rename from cpuminer-config.h rename to compat/ccminer-config.h index 86fbc1e..9c4d81a 100644 --- a/cpuminer-config.h +++ b/compat/ccminer-config.h @@ -1,5 +1,4 @@ -/* cpuminer-config.h. Generated from cpuminer-config.h.in by configure. */ -/* cpuminer-config.h.in. Generated from configure.ac by autoheader. */ +/* CONFIG ONLY FOR MS VC++ BUILD */ /* Define to one of `_getb67', `GETB67', `getb67' for Cray-2 and Cray-YMP systems. This function is required for `alloca.c' support on those systems. @@ -161,17 +160,11 @@ /* Define to the full name of this package. */ #define PACKAGE_NAME "ccminer" -/* Define to the full name and version of this package. */ -#define PACKAGE_STRING "ccminer 1.7.6" - -/* Define to the one symbol short name of this package. */ -#define PACKAGE_TARNAME "ccminer" - /* Define to the home page for this package. */ #define PACKAGE_URL "http://github.com/tpruvot/ccminer" /* Define to the version of this package. */ -#define PACKAGE_VERSION "1.7.6" +#define PACKAGE_VERSION "1.8-dev" /* If using the C implementation of alloca, define if you know the direction of stack growth for your system; otherwise it will be @@ -184,11 +177,12 @@ /* Define to 1 if you have the ANSI C header files. */ #define STDC_HEADERS 1 -/* Version number of package */ -#define VERSION "1.7.6" - /* Define curl_free() as free() if our version of curl lacks curl_free. */ /* #undef curl_free */ /* Define to `unsigned int' if does not define. */ //#define size_t unsigned int + +#if !defined(HAVE_STRUCT_TIMESPEC) && _MSC_VER >= 1900 +#define HAVE_STRUCT_TIMESPEC +#endif diff --git a/compat/jansson/jansson_config.h b/compat/jansson/jansson_config.h index 90ca129..0f3c7ca 100644 --- a/compat/jansson/jansson_config.h +++ b/compat/jansson/jansson_config.h @@ -23,6 +23,9 @@ #ifdef _MSC_VER #define inline __inline +#if !defined(HAVE_STRUCT_TIMESPEC) && _MSC_VER >= 1900 +#define HAVE_STRUCT_TIMESPEC +#endif #endif #ifdef __cplusplus diff --git a/compat/pthreads/pthread.h b/compat/pthreads/pthread.h index 85f9cce..c8ee778 100644 --- a/compat/pthreads/pthread.h +++ b/compat/pthreads/pthread.h @@ -37,6 +37,10 @@ #if !defined( PTHREAD_H ) #define PTHREAD_H +#if !defined(HAVE_STRUCT_TIMESPEC) && _MSC_VER >= 1900 +#define HAVE_STRUCT_TIMESPEC +#endif + /* * See the README file for an explanation of the pthreads-win32 version * numbering scheme and how the DLL is named etc. diff --git a/configure.ac b/configure.ac index aec2fe6..62486f5 100644 --- a/configure.ac +++ b/configure.ac @@ -1,10 +1,10 @@ -AC_INIT([ccminer], [1.7.6], [], [ccminer], [http://github.com/tpruvot/ccminer]) +AC_INIT([ccminer], [1.8-dev], [], [ccminer], [http://github.com/tpruvot/ccminer]) AC_PREREQ([2.59c]) AC_CANONICAL_SYSTEM AC_CONFIG_SRCDIR([ccminer.cpp]) AM_INIT_AUTOMAKE([foreign subdir-objects]) -AC_CONFIG_HEADERS([cpuminer-config.h]) +AC_CONFIG_HEADERS([ccminer-config.h]) dnl Make sure anyone changing configure.ac/Makefile.am has a clue AM_MAINTAINER_MODE diff --git a/miner.h b/miner.h index 1efc579..10dd6a4 100644 --- a/miner.h +++ b/miner.h @@ -5,7 +5,7 @@ extern "C" { #endif -#include "cpuminer-config.h" +#include #include #include diff --git a/res/ccminer.rc b/res/ccminer.rc index 4df91aa..8c37fcb 100644 --- a/res/ccminer.rc +++ b/res/ccminer.rc @@ -60,8 +60,8 @@ IDI_ICON1 ICON "ccminer.ico" // VS_VERSION_INFO VERSIONINFO - FILEVERSION 1,7,6,0 - PRODUCTVERSION 1,7,6,0 + FILEVERSION 1,8,0,0 + PRODUCTVERSION 1,8,0,0 FILEFLAGSMASK 0x3fL #ifdef _DEBUG FILEFLAGS 0x21L @@ -76,10 +76,10 @@ BEGIN BEGIN BLOCK "040904e4" BEGIN - VALUE "FileVersion", "1.7.6" + VALUE "FileVersion", "1.8.rc" VALUE "LegalCopyright", "Copyright (C) 2016" VALUE "ProductName", "ccminer" - VALUE "ProductVersion", "1.7.6" + VALUE "ProductVersion", "1.8.rc" END END BLOCK "VarFileInfo" diff --git a/sph/sha2.c b/sph/sha2.c index 517bdcf..7160c75 100644 --- a/sph/sha2.c +++ b/sph/sha2.c @@ -8,7 +8,6 @@ * any later version. See COPYING for more details. */ -#include "cpuminer-config.h" #include "miner.h" #include diff --git a/util.cpp b/util.cpp index df32394..7f57019 100644 --- a/util.cpp +++ b/util.cpp @@ -10,7 +10,7 @@ */ //#define _GNU_SOURCE -#include "cpuminer-config.h" +#include #include #include