Initial MSVC support.

This commit is contained in:
XMRig 2017-06-12 16:19:07 +03:00
parent a370b8fd30
commit 3df545cfc5
21 changed files with 845 additions and 96 deletions

View file

@ -22,8 +22,10 @@
*/
#include <malloc.h>
#include <time.h>
#ifdef WIN32
# include <winsock2.h>
# include "3rdparty/winansi.h"
@ -97,12 +99,12 @@ void Console::message(Console::Level level, const char* fmt, ...)
m_colors ? kCL_N : ""
);
pthread_mutex_lock(&m_mutex);
uv_mutex_lock(&m_mutex);
vfprintf(stdout, buf, ap);
fflush(stdout);
pthread_mutex_unlock(&m_mutex);
uv_mutex_unlock(&m_mutex);
va_end(ap);
}
@ -121,12 +123,12 @@ void Console::text(const char* fmt, ...)
m_colors ? kCL_N : ""
);
pthread_mutex_lock(&m_mutex);
uv_mutex_lock(&m_mutex);
vfprintf(stdout, buf, ap);
fflush(stdout);
pthread_mutex_unlock(&m_mutex);
uv_mutex_unlock(&m_mutex);
va_end(ap);
}
@ -135,5 +137,5 @@ void Console::text(const char* fmt, ...)
Console::Console() :
m_colors(true)
{
pthread_mutex_init(&m_mutex, nullptr);
uv_mutex_init(&m_mutex);
}