diff --git a/OSlibs/win/release/nanomsg.dll b/OSlibs/win/release/nanomsg.dll new file mode 100644 index 000000000..5d5dc7e20 Binary files /dev/null and b/OSlibs/win/release/nanomsg.dll differ diff --git a/OSlibs/win/release/nanomsg.lib b/OSlibs/win/release/nanomsg.lib new file mode 100644 index 000000000..082e2cf03 Binary files /dev/null and b/OSlibs/win/release/nanomsg.lib differ diff --git a/OSlibs/win/release/pthreadVC2.lib b/OSlibs/win/release/pthreadVC2.lib new file mode 100644 index 000000000..d793e7144 Binary files /dev/null and b/OSlibs/win/release/pthreadVC2.lib differ diff --git a/OSlibs/win/release/pthreadvc2.dll b/OSlibs/win/release/pthreadvc2.dll new file mode 100644 index 000000000..93f562baa Binary files /dev/null and b/OSlibs/win/release/pthreadvc2.dll differ diff --git a/OSlibs/win/x64/release/nanomsg.dll b/OSlibs/win/x64/release/nanomsg.dll new file mode 100644 index 000000000..1a9074fed Binary files /dev/null and b/OSlibs/win/x64/release/nanomsg.dll differ diff --git a/OSlibs/win/x64/release/nanomsg.lib b/OSlibs/win/x64/release/nanomsg.lib new file mode 100644 index 000000000..0a9a4a694 Binary files /dev/null and b/OSlibs/win/x64/release/nanomsg.lib differ diff --git a/crypto777/curve25519.c b/crypto777/curve25519.c index 6e06267c9..eae51aefc 100755 --- a/crypto777/curve25519.c +++ b/crypto777/curve25519.c @@ -1839,7 +1839,11 @@ uint64_t acct777_validate(struct acct777_sig *sig,bits256 privkey,bits256 pubkey struct acct777_sig checksig; uint64_t signerbits; int32_t datalen; uint8_t *serialized; datalen = (int32_t)(sig->allocsize - sizeof(*sig)); checksig = *sig; +#if defined(_M_X64) + serialized = (uint8_t *)((unsigned char *)sig + sizeof(*sig)); +#else serialized = (uint8_t *)((long)sig + sizeof(*sig)); +#endif //{ int32_t i; for (i=0; itimestamp,serialized,datalen); if ( memcmp(checksig.sigbits.bytes,sig->sigbits.bytes,sizeof(checksig.sigbits)) != 0 ) diff --git a/crypto777/iguana_OS.c b/crypto777/iguana_OS.c index 0032a8886..425e65d73 100755 --- a/crypto777/iguana_OS.c +++ b/crypto777/iguana_OS.c @@ -217,10 +217,18 @@ static uint64_t _align16(uint64_t ptrval) { if ( (ptrval & 15) != 0 ) ptrval += void *myaligned_alloc(uint64_t allocsize) { void *ptr,*realptr; uint64_t tmp; +#if defined(_M_X64) + realptr = mycalloc('A', 1, (uint64_t)(allocsize + 16 + sizeof(realptr))); +#else realptr = mycalloc('A',1,(long)(allocsize + 16 + sizeof(realptr))); +#endif tmp = _align16((long)realptr + sizeof(ptr)); memcpy(&ptr,&tmp,sizeof(ptr)); +#if defined(_M_X64) + memcpy((void *)((unsigned char *)ptr - sizeof(realptr)), &realptr, sizeof(realptr)); +#else memcpy((void *)((long)ptr - sizeof(realptr)),&realptr,sizeof(realptr)); +#endif //printf("aligned_alloc(%llu) realptr.%p -> ptr.%p, diff.%ld\n",(long long)allocsize,realptr,ptr,((long)ptr - (long)realptr)); return(ptr); } diff --git a/iguana.vcxproj b/iguana.vcxproj index 9a8fc8140..290de16b1 100644 --- a/iguana.vcxproj +++ b/iguana.vcxproj @@ -126,13 +126,15 @@ true true _CRT_SECURE_NO_WARNINGS;NATIVE_WINDOWS;WIN32;_CONSOLE;NDEBUG;%(PreprocessorDefinitions) + 1Byte Console true true true - Ws2_32.lib;%(AdditionalDependencies) + Ws2_32.lib;pthreadVC2.lib;nanomsg.lib;%(AdditionalDependencies) + .\OSlibs\win\release;%(AdditionalLibraryDirectories) @@ -144,7 +146,7 @@ true true WIN64;_WIN64;_CRT_SECURE_NO_WARNINGS;NATIVE_WINDOWS;WIN32;_CONSOLE;NDEBUG;%(PreprocessorDefinitions) - 8Bytes + 1Byte MultiThreaded @@ -152,7 +154,8 @@ true true true - Ws2_32.lib;Advapi32.lib;$(SolutionDir)OSlibs\win\x64\pthread_lib.lib;%(AdditionalDependencies) + Ws2_32.lib;Advapi32.lib;$(SolutionDir)OSlibs\win\x64\pthread_lib.lib;nanomsg.lib;%(AdditionalDependencies) + .\OSlibs\win\x64\release;%(AdditionalLibraryDirectories) diff --git a/iguana/iguana_bundles.c b/iguana/iguana_bundles.c index be66da25f..fb382e2cd 100755 --- a/iguana/iguana_bundles.c +++ b/iguana/iguana_bundles.c @@ -435,7 +435,11 @@ struct iguana_txid *iguana_bundletx(struct iguana_info *coin,struct iguana_bundl iguana_peerfname(coin,&hdrsi,iter==0?"DB/ro":"DB",fname,0,bp->hashes[0],zero,bp->n,1); if ( (fp= fopen(fname,"rb")) != 0 ) { +#if defined(_M_X64) + fseek(fp, (uint64_t)&rdata.Toffset - (uint64_t)&rdata, SEEK_SET); +#else fseek(fp,(long)&rdata.Toffset - (long)&rdata,SEEK_SET); +#endif if ( fread(&Toffset,1,sizeof(Toffset),fp) == sizeof(Toffset) ) { fseek(fp,Toffset + sizeof(struct iguana_txid) * txidind,SEEK_SET); diff --git a/iguana/iguana_json.c b/iguana/iguana_json.c index 431e1954f..14471dbc1 100755 --- a/iguana/iguana_json.c +++ b/iguana/iguana_json.c @@ -263,7 +263,11 @@ int32_t template_emit(char *retbuf,int32_t maxsize,char *template,char *varname, varnamelen = (int32_t)strlen(varname); while ( (match= strstr(varname,&template[offset])) != 0 ) { +#if defined(_M_X64) + position = (int32_t)((uint64_t)match - (uint64_t)&template[offset]); +#else position = (int32_t)((long)match - (long)&template[offset]); +#endif printf("found match.(%s) at %d offset.%d\n",varname,position,offset); if ( size + (valuelen + position) > maxsize ) return(-1); diff --git a/iguana/iguana_mofn.c b/iguana/iguana_mofn.c index ab094bf5d..50d024457 100755 --- a/iguana/iguana_mofn.c +++ b/iguana/iguana_mofn.c @@ -563,10 +563,17 @@ int32_t test_mofn256(struct supernet_info *myinfo,int32_t M,int32_t N) if ( m >= M ) printf("%s %s error m.%d vs M.%d N.%d\n",bits256_str(str,secret),bits256_str(str2,recover),m,mofn->M,mofn->N); } +#if defined(_M_X64) + if (((uint64_t)mofn - (uint64_t)space) >= sizeof(space) || ((uint64_t)mofn - (uint64_t)space) < 0) + free(mofn); + if (((uint64_t)cmp - (uint64_t)space) >= sizeof(space) || ((uint64_t)cmp - (uint64_t)space) < 0) + free(cmp); +#else if ( ((long)mofn - (long)space) >= sizeof(space) || ((long)mofn - (long)space) < 0 ) free(mofn); if ( ((long)cmp - (long)space) >= sizeof(space) || ((long)cmp - (long)space) < 0 ) free(cmp); +#endif return(retval); } diff --git a/iguana/iguana_unspents.c b/iguana/iguana_unspents.c index fcbe8b8b6..759993e73 100755 --- a/iguana/iguana_unspents.c +++ b/iguana/iguana_unspents.c @@ -1416,7 +1416,11 @@ int32_t iguana_utxoaddr_map(struct iguana_info *coin,char *fname) memcpy(&last,(void *)((long)coin->utxoaddrfileptr+sizeof(uint64_t)),sizeof(last)); memcpy(&coin->utxoaddrind,(void *)((long)coin->utxoaddrfileptr+sizeof(uint64_t)+sizeof(uint32_t)),sizeof(coin->utxoaddrind)); memcpy(&coin->utxoaddrhash.bytes,(void *)((long)coin->utxoaddrfileptr+sizeof(uint64_t)+2*sizeof(uint32_t)),sizeof(coin->utxoaddrhash)); +#if defined(_M_X64) + coin->utxoaddroffsets = (void *)((unsigned char *)coin->utxoaddrfileptr + sizeof(uint64_t) + 2 * sizeof(uint32_t) + sizeof(bits256)); +#else coin->utxoaddroffsets = (void *)((long)coin->utxoaddrfileptr + sizeof(uint64_t) + 2*sizeof(uint32_t) + sizeof(bits256)); +#endif for (ind=total=count=0; ind<0x10000; ind++) { if ( (offset= coin->utxoaddroffsets[ind]) != 0 )