diff --git a/basilisk/basilisk.c b/basilisk/basilisk.c index 8610f2d66..de6ebd330 100755 --- a/basilisk/basilisk.c +++ b/basilisk/basilisk.c @@ -953,6 +953,7 @@ void basilisks_init(struct supernet_info *myinfo) #include "../includes/iguana_apidefs.h" #include "../includes/iguana_apideclares.h" +#include "../includes/iguana_apideclares2.h" TWO_STRINGS(tradebot,gensvm,base,rel) { diff --git a/iguana/iguana_exchanges.c b/iguana/iguana_exchanges.c index 8be8d38c3..d7445f681 100755 --- a/iguana/iguana_exchanges.c +++ b/iguana/iguana_exchanges.c @@ -1176,6 +1176,7 @@ cJSON *iguana_pricesarray(struct supernet_info *myinfo,char *exchange,char *base #include "../includes/iguana_apidefs.h" #include "../includes/iguana_apideclares.h" +#include "../includes/iguana_apideclares2.h" THREE_STRINGS_AND_THREE_INTS(InstantDEX,orderbook,exchange,base,rel,depth,allfields,ignore) { diff --git a/iguana/iguana_json.c b/iguana/iguana_json.c index 8002aa331..743ba3b0b 100755 --- a/iguana/iguana_json.c +++ b/iguana/iguana_json.c @@ -498,6 +498,14 @@ char *SuperNET_htmlstr(char *fname,char *htmlstr,int32_t maxsize,char *agentstr) return(OS_filestr(&filesize,"index7778.html")); } +#ifdef WIN32 +/** +* workaround for MSVS compiler bug - +* instead of going on if-else-if block split the if-else-if into two function +*/ +char *SuperNET_parser2(struct supernet_info *myinfo, char *agentstr, char *method, cJSON *json, char *remoteaddr); +#endif + char *SuperNET_parser(struct supernet_info *myinfo,char *agentstr,char *method,cJSON *json,char *remoteaddr) { char *coinstr; struct iguana_info *coin = 0; @@ -614,13 +622,31 @@ char *SuperNET_parser(struct supernet_info *myinfo,char *agentstr,char *method,c #define STRING_ARRAY_OBJ_STRING IGUANA_DISPATCH_SAOS #include "../includes/iguana_apideclares.h" - +#ifdef WIN32 +return SuperNET_parser2(myinfo, agentstr, method, json, remoteaddr); +#else #undef IGUANA_ARGS #undef _IGUANA_APIDEC_H_ #include "../includes/iguana_apiundefs.h" char errstr[512]; sprintf(errstr,"{\"error\":\"unsupported call\",\"agent\":\"%s\",\"method\":\"%s\"}",agentstr,method); return(clonestr(errstr)); +#endif } +#ifdef WIN32 +char *SuperNET_parser2(struct supernet_info *myinfo, char *agentstr, char *method, cJSON *json, char *remoteaddr) { + char *coinstr; struct iguana_info *coin = 0; + if (remoteaddr != 0 && (remoteaddr[0] == 0 || strcmp(remoteaddr, "127.0.0.1") == 0)) + remoteaddr = 0; +#include "../includes/iguana_apideclares2.h" +#undef IGUANA_ARGS +#undef _IGUANA_APIDEC_H_ +#include "../includes/iguana_apiundefs.h" + char errstr[512]; + sprintf(errstr, "{\"error\":\"unsupported call\",\"agent\":\"%s\",\"method\":\"%s\"}", agentstr, method); + return(clonestr(errstr)); +} + +#endif \ No newline at end of file diff --git a/iguana/iguana_notary.c b/iguana/iguana_notary.c index d4378efd6..dc4d436d8 100755 --- a/iguana/iguana_notary.c +++ b/iguana/iguana_notary.c @@ -224,6 +224,7 @@ void dpow_addresses() #include "../includes/iguana_apidefs.h" #include "../includes/iguana_apideclares.h" +#include "../includes/iguana_apideclares2.h" TWO_STRINGS(iguana,dpow,symbol,pubkey) { diff --git a/iguana/iguana_payments.c b/iguana/iguana_payments.c index 55f550354..1406a47d1 100755 --- a/iguana/iguana_payments.c +++ b/iguana/iguana_payments.c @@ -700,6 +700,7 @@ char *sendtoaddress(struct supernet_info *myinfo,struct iguana_info *coin,char * #include "../includes/iguana_apidefs.h" #include "../includes/iguana_apideclares.h" +#include "../includes/iguana_apideclares2.h" STRING_AND_INT(bitcoinrpc,sendrawtransaction,rawtx,allowhighfees) { diff --git a/iguana/iguana_tradebots.c b/iguana/iguana_tradebots.c index 0ece4f0e3..c514ed4bd 100755 --- a/iguana/iguana_tradebots.c +++ b/iguana/iguana_tradebots.c @@ -221,6 +221,7 @@ char *tradebot_control(struct supernet_info *myinfo,char *exchangestr,char *boti #include "../includes/iguana_apidefs.h" #include "../includes/iguana_apideclares.h" +#include "../includes/iguana_apideclares2.h" HASH_ARRAY_STRING(tradebot,liquidity,hash,vals,targetcoin) { diff --git a/iguana/iguana_unspents.c b/iguana/iguana_unspents.c index b9d0a0ca0..6534c2431 100755 --- a/iguana/iguana_unspents.c +++ b/iguana/iguana_unspents.c @@ -1799,6 +1799,7 @@ void iguana_utxoaddrs_purge(struct iguana_info *coin) #include "../includes/iguana_apidefs.h" #include "../includes/iguana_apideclares.h" +#include "../includes/iguana_apideclares2.h" STRING_AND_INT(iguana,snapshot,symbol,height) { diff --git a/iguana/iguana_wallet.c b/iguana/iguana_wallet.c index 90303ae80..c73259f29 100755 --- a/iguana/iguana_wallet.c +++ b/iguana/iguana_wallet.c @@ -995,6 +995,7 @@ cJSON *iguana_privkeysjson(struct supernet_info *myinfo,struct iguana_info *coin #include "../includes/iguana_apidefs.h" #include "../includes/iguana_apideclares.h" +#include "../includes/iguana_apideclares2.h" int64_t iguana_addressreceived(struct supernet_info *myinfo,struct iguana_info *coin,cJSON *json,char *remoteaddr,cJSON *txids,cJSON *vouts,cJSON *unspents,cJSON *spends,char *coinaddr,int32_t minconf,int32_t firstheight) { diff --git a/iguana/main.c b/iguana/main.c index fcde8209e..984f2c27a 100755 --- a/iguana/main.c +++ b/iguana/main.c @@ -1026,6 +1026,7 @@ void SuperNET_parsepeers(struct supernet_info *myinfo,cJSON *array,int32_t n,int #include "../includes/iguana_apidefs.h" #include "../includes/iguana_apideclares.h" +#include "../includes/iguana_apideclares2.h" STRING_ARG(iguana,initfastfind,activecoin) { diff --git a/iguana/ramchain_api.c b/iguana/ramchain_api.c index 267f17ffd..e28a106ff 100755 --- a/iguana/ramchain_api.c +++ b/iguana/ramchain_api.c @@ -18,6 +18,7 @@ #include "../includes/iguana_apidefs.h" #include "../includes/iguana_apideclares.h" +#include "../includes/iguana_apideclares2.h" STRING_ARG(iguana,peers,activecoin) diff --git a/includes/iguana_apideclares.h b/includes/iguana_apideclares.h index 955acffe0..048165ccd 100755 --- a/includes/iguana_apideclares.h +++ b/includes/iguana_apideclares.h @@ -335,6 +335,8 @@ STRING_ARG(hash,base64_decode,message); STRING_ARG(hash,rmd160_sha256,message); STRING_ARG(hash,sha256_sha256,message); +#ifndef WIN32 + STRING_ARG(hash,sha224,message); STRING_ARG(hash,sha256,message); STRING_ARG(hash,sha384,message); @@ -366,3 +368,5 @@ TWO_STRINGS(hmac,tiger192_3,message,passphrase); TWO_STRINGS(hmac,whirlpool,message,passphrase); #endif + +#endif diff --git a/includes/iguana_apideclares2.h b/includes/iguana_apideclares2.h new file mode 100644 index 000000000..952301d89 --- /dev/null +++ b/includes/iguana_apideclares2.h @@ -0,0 +1,31 @@ +#ifdef WIN32 +STRING_ARG(hash, sha224, message); +STRING_ARG(hash, sha256, message); +STRING_ARG(hash, sha384, message); +STRING_ARG(hash, sha512, message); +STRING_ARG(hash, rmd128, message); +STRING_ARG(hash, rmd160, message); +STRING_ARG(hash, rmd256, message); +STRING_ARG(hash, rmd320, message); +STRING_ARG(hash, sha1, message); +STRING_ARG(hash, md2, message); +STRING_ARG(hash, md4, message); +STRING_ARG(hash, md5, message); +STRING_ARG(hash, tiger192_3, message); +STRING_ARG(hash, whirlpool, message); + +TWO_STRINGS(hmac, sha224, message, passphrase); +TWO_STRINGS(hmac, sha256, message, passphrase); +TWO_STRINGS(hmac, sha384, message, passphrase); +TWO_STRINGS(hmac, sha512, message, passphrase); +TWO_STRINGS(hmac, rmd128, message, passphrase); +TWO_STRINGS(hmac, rmd160, message, passphrase); +TWO_STRINGS(hmac, rmd256, message, passphrase); +TWO_STRINGS(hmac, rmd320, message, passphrase); +TWO_STRINGS(hmac, sha1, message, passphrase); +TWO_STRINGS(hmac, md2, message, passphrase); +TWO_STRINGS(hmac, md4, message, passphrase); +TWO_STRINGS(hmac, md5, message, passphrase); +TWO_STRINGS(hmac, tiger192_3, message, passphrase); +TWO_STRINGS(hmac, whirlpool, message, passphrase); +#endif \ No newline at end of file