mirror of
https://github.com/jwinterm/xmr-stak.git
synced 2026-12-05 12:54:10 +01:00
Tweaks to make the application more Windows-friendly
This commit is contained in:
+44
-7
@@ -21,30 +21,67 @@
|
||||
|
||||
#include <stdlib.h>
|
||||
#include <stdio.h>
|
||||
#include <string.h>
|
||||
|
||||
//Do a press any key for the windows folk. *insert any key joke here*
|
||||
#ifdef _WIN32
|
||||
void win_exit()
|
||||
{
|
||||
|
||||
printer::inst()->print_str("Press any key to exit.");
|
||||
get_key();
|
||||
return;
|
||||
}
|
||||
|
||||
#define strcasecmp _stricmp
|
||||
|
||||
#else
|
||||
void win_exit() { return; }
|
||||
#endif // _WIN32
|
||||
|
||||
int main(int argc, char *argv[])
|
||||
{
|
||||
if(argc != 2 || strcmp(argv[1], "-h") == 0)
|
||||
const char* sFilename = "config.txt";
|
||||
|
||||
if(argc >= 2)
|
||||
{
|
||||
printer::inst()->print_msg(L0, "Usage %s [CONFIG FILE]", argv[0]);
|
||||
return 0;
|
||||
if(strcmp(argv[1], "-h") == 0)
|
||||
{
|
||||
printer::inst()->print_msg(L0, "Usage %s [CONFIG FILE]", argv[0]);
|
||||
win_exit();
|
||||
return 0;
|
||||
}
|
||||
|
||||
if(argc >= 3 && strcasecmp(argv[1], "-c") == 0)
|
||||
sFilename = argv[2];
|
||||
else
|
||||
sFilename = argv[1];
|
||||
}
|
||||
|
||||
if(!jconf::inst()->parse_config(argv[1]))
|
||||
if(!jconf::inst()->parse_config(sFilename))
|
||||
{
|
||||
win_exit();
|
||||
return 0;
|
||||
|
||||
}
|
||||
|
||||
printer::inst()->print_str("-------------------------------------------------------------------\n");
|
||||
printer::inst()->print_str("XMR-Stak-CPU mining software, CPU Version.\n");
|
||||
printer::inst()->print_str("Based on CPU mining code by wolf9466 (heavily optimized by myself).\n");
|
||||
printer::inst()->print_str("Brought to you by fireice_uk under GPLv3.\n");
|
||||
printer::inst()->print_str("Brought to you by fireice_uk under GPLv3.\n\n");
|
||||
char buffer[64];
|
||||
snprintf(buffer, sizeof(buffer), "Configurable dev donation level is set to %.1f %%\n", fDevDonationLevel * 100.0);
|
||||
snprintf(buffer, sizeof(buffer), "Configurable dev donation level is set to %.1f %%\n\n", fDevDonationLevel * 100.0);
|
||||
printer::inst()->print_str(buffer);
|
||||
printer::inst()->print_str("You can use following keys to display reports:\n");
|
||||
printer::inst()->print_str("'h' - hashrate\n");
|
||||
printer::inst()->print_str("'r' - results\n");
|
||||
printer::inst()->print_str("'c' - connection\n");
|
||||
printer::inst()->print_str("-------------------------------------------------------------------\n");
|
||||
|
||||
if (!minethd::self_test())
|
||||
{
|
||||
win_exit();
|
||||
return 0;
|
||||
}
|
||||
|
||||
executor::inst()->ex_start();
|
||||
|
||||
|
||||
Reference in New Issue
Block a user