From 98451267d8bbe1629f40184b48d003ef278644ce Mon Sep 17 00:00:00 2001 From: Tanguy Pruvot Date: Mon, 10 Nov 2014 17:05:27 +0100 Subject: [PATCH] vstudio: std::min fix --- fuguecoin.cpp | 8 +++++++- myriadgroestl.cpp | 8 +++++++- 2 files changed, 14 insertions(+), 2 deletions(-) diff --git a/fuguecoin.cpp b/fuguecoin.cpp index eedd330..5d1d59c 100644 --- a/fuguecoin.cpp +++ b/fuguecoin.cpp @@ -13,6 +13,12 @@ extern "C" void my_fugue256(void *cc, const void *data, size_t len); extern "C" void my_fugue256_close(void *cc, void *dst); extern "C" void my_fugue256_addbits_and_close(void *cc, unsigned ub, unsigned n, void *dst); +#ifdef _MSC_VER +#define MIN min +#else +#define MIN std::min +#endif + // vorbereitete Kontexte nach den ersten 80 Bytes sph_fugue256_context ctx_fugue_const[8]; @@ -25,7 +31,7 @@ extern "C" int scanhash_fugue256(int thr_id, uint32_t *pdata, const uint32_t *pt { uint32_t start_nonce = pdata[19]++; uint32_t throughPut = opt_work_size ? opt_work_size : (1 << 19); - throughPut = std::min(throughPut, max_nonce - start_nonce); + throughPut = MIN(throughPut, max_nonce - start_nonce); if (opt_benchmark) ((uint32_t*)ptarget)[7] = 0xf; diff --git a/myriadgroestl.cpp b/myriadgroestl.cpp index 75da442..d3c6f3f 100644 --- a/myriadgroestl.cpp +++ b/myriadgroestl.cpp @@ -16,6 +16,12 @@ void myriadgroestl_cpu_hash(int thr_id, int threads, uint32_t startNounce, void ((((x) << 24) & 0xff000000u) | (((x) << 8) & 0x00ff0000u) | \ (((x) >> 8) & 0x0000ff00u) | (((x) >> 24) & 0x000000ffu)) +#ifdef _MSC_VER +#define MIN min +#else +#define MIN std::min +#endif + extern "C" void myriadhash(void *state, const void *input) { sph_groestl512_context ctx_groestl; @@ -44,7 +50,7 @@ extern "C" int scanhash_myriad(int thr_id, uint32_t *pdata, const uint32_t *ptar uint32_t start_nonce = pdata[19]++; uint32_t throughPut = opt_work_size ? opt_work_size : (1 << 17); - throughPut = std::min(throughPut, max_nonce - start_nonce); + throughPut = MIN(throughPut, max_nonce - start_nonce); uint32_t *outputHash = (uint32_t*)malloc(throughPut * 16 * sizeof(uint32_t));