Fixed build for windows

This commit is contained in:
WolverinDEV 2019-07-07 22:32:17 +02:00
parent 81f3695539
commit d659ec9767
2 changed files with 27 additions and 3 deletions

View File

@ -9,6 +9,6 @@
"./deploy/",
"build.ts",
"package.ts",
"package_linux.ts"
"package_windows.ts"
]
}
}

View File

@ -4,6 +4,7 @@
#include <iostream>
#include <mutex>
#include <event2/thread.h>
#include <misc/digest.h>
#include "logger.h"
#include "NanException.h"
@ -61,7 +62,6 @@ void testTomMath(){
mp_clear_multi(&x, &n, &exp, &r, nullptr);
}
tc::audio::AudioOutput* global_audio_output;
#define ENUM_SET(object, key, value) \
Nan::DefineOwnProperty(object, Nan::New<v8::String>(key).ToLocalChecked(), Nan::New<v8::Number>(value), v8::DontDelete); \
@ -71,6 +71,30 @@ NAN_MODULE_INIT(init) {
logger::initialize_node();
logger::info(category::general, "Hello World from C");
/*
{
auto data = (uint8_t*) "Hello World";
auto hash_result = digest::sha1((const char*) data, 11);
if(hash_result.length() != 20)
Nan::ThrowError("digest::sha1 test failed");
log_error(category::connection, tr("Hash result: {}"), hash_result.length());
}
*/
{
auto data = (uint8_t*) "Hello World";
auto hash_result = digest::sha1(std::string("Hello World"));
if(hash_result.length() != 20)
Nan::ThrowError("digest::sha1 test failed");
}
{
auto data = (uint8_t*) "Hello World";
uint8_t result[SHA_DIGEST_LENGTH];
digest::tomcrypt::sha1((char*) data, 11, result);
auto hash_result = std::string((const char*) result, SHA_DIGEST_LENGTH);
log_error(category::connection, tr("Hash result: {}"), hash_result.length());
}
string error;
//TODO here
//PaJack_SetClientName("TeaClient");