Skip to content

Commit

Permalink
windows: update vstudio project + mingw64 vars
Browse files Browse the repository at this point in the history
Also fix a few warnings
  • Loading branch information
tpruvot committed Oct 2, 2015
1 parent 78a3ef9 commit 2a5ea59
Show file tree
Hide file tree
Showing 5 changed files with 21 additions and 4 deletions.
2 changes: 2 additions & 0 deletions compat.h
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,9 @@
#include <windows.h>
#include <time.h>

#ifndef localtime_r
#define localtime_r(src, dst) localtime_s(dst, src)
#endif

#define sleep(secs) Sleep((secs) * 1000)

Expand Down
3 changes: 3 additions & 0 deletions configure.ac
Original file line number Diff line number Diff line change
Expand Up @@ -145,6 +145,7 @@ AC_ARG_WITH([curl],

if test -n "$with_curl" ; then
LIBCURL_CFLAGS="$LIBCURL_CFLAGS -I$with_curl/include"
LIBCURL_CPPFLAGS="$LIBCURL_CPPFLAGS -I$with_curl/include"
LIBCURL_LDFLAGS="-L$with_curl/lib $LIBCURL_LDFLAGS"
LIBCURL="-lcurl -lz"
fi
Expand All @@ -155,11 +156,13 @@ AC_ARG_WITH([crypto],

if test -n "$with_crypto" ; then
LIBCURL_CFLAGS="$LIBCURL_CFLAGS -I$with_crypto/include"
LIBCURL_CPPFLAGS="$LIBCURL_CPPFLAGS -I$with_crypto/include"
LIBCURL_LDFLAGS="-L$with_crypto/lib $LIBCURL_LDFLAGS"
LIBCURL="$LIBCURL -lssl -lcrypto"
fi

CFLAGS="$CFLAGS $LIBCURL_CFLAGS"
CPPFLAGS="$CPPFLAGS $LIBCURL_CPPFLAGS"
LDFLAGS="$LDFLAGS $LIBCURL_LDFLAGS"

#AC_CHECK_LIB([z],[gzopen],[],[])
Expand Down
3 changes: 1 addition & 2 deletions cpu-miner.c
Original file line number Diff line number Diff line change
Expand Up @@ -504,7 +504,6 @@ static void calc_network_diff(struct work *work)
uint32_t bits = (nbits & 0xffffff);
int16_t shift = (swab32(nbits) & 0xff); // 0x1c = 28

uint64_t diffone = 0x0000FFFF00000000ull;
double d = (double)0x0000ffff / (double)bits;

for (int m=shift; m < 29; m++) d *= 256.0;
Expand Down Expand Up @@ -2398,7 +2397,7 @@ static void *stratum_thread(void *userdata)

if (stratum.job.clean || jsonrpc_2) {
static uint32_t last_bloc_height;
if (!opt_quiet) {
if (!opt_quiet && last_bloc_height != stratum.bloc_height) {
last_bloc_height = stratum.bloc_height;
if (net_diff > 0.)
applog(LOG_BLUE, "%s block %d, diff %.3f", algo_names[opt_algo],
Expand Down
15 changes: 14 additions & 1 deletion cpuminer.vcxproj.filters
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
<ItemGroup>
<ClCompile Include="cpu-miner.c" />
<ClCompile Include="util.c" />
<ClCompile Include="uint256.cpp" />
<ClCompile Include="sha3\sph_blake.c">
<Filter>sph</Filter>
</ClCompile>
Expand Down Expand Up @@ -66,6 +67,9 @@
<ClCompile Include="sha3\aes_helper.c">
<Filter>sph</Filter>
</ClCompile>
<ClCompile Include="sha3\sph_gost.c">
<Filter>sph</Filter>
</ClCompile>
<ClCompile Include="compat\winansi.c">
<Filter>compat</Filter>
</ClCompile>
Expand Down Expand Up @@ -266,6 +270,9 @@
<ClCompile Include="algo\axiom.c">
<Filter>algo</Filter>
</ClCompile>
<ClCompile Include="algo\sibcoin.c">
<Filter>algo</Filter>
</ClCompile>
</ItemGroup>
<ItemGroup>
<ClInclude Include="sha3\sph_blake.h">
Expand Down Expand Up @@ -322,6 +329,9 @@
<ClInclude Include="sha3\sph_whirlpool.h">
<Filter>sph</Filter>
</ClInclude>
<ClInclude Include="sha3\sph_gost.h">
<Filter>sph</Filter>
</ClInclude>
<ClInclude Include="compat.h">
<Filter>compat</Filter>
</ClInclude>
Expand Down Expand Up @@ -352,6 +362,9 @@
<ClInclude Include="compat\cpuminer-config.h">
<Filter>headers</Filter>
</ClInclude>
<ClInclude Include="uint256.h">
<Filter>headers</Filter>
</ClInclude>
<ClInclude Include="compat\jansson\jansson.h">
<Filter>jansson</Filter>
</ClInclude>
Expand Down Expand Up @@ -511,4 +524,4 @@
<Filter>res</Filter>
</ResourceCompile>
</ItemGroup>
</Project>
</Project>
2 changes: 1 addition & 1 deletion sha3/sph_gost.c
Original file line number Diff line number Diff line change
Expand Up @@ -939,7 +939,7 @@ static void hash_X(unsigned char *IV,const unsigned char *message,unsigned long

g_N(N,hash,m);
v512[63] = len & 0xFF;
v512[62] = len >> 8;
v512[62] = (unsigned char) (len >> 8);
AddModulo512(N,v512,N);

AddModulo512(Sigma,m,Sigma);
Expand Down

0 comments on commit 2a5ea59

Please sign in to comment.