1
0
Fork 0
forked from len0rd/rockbox

nwztools/upgtools: add support for windows

In order to avoid the crypto++ mess, the code uses the Windows Cryptography API,
which is standard. There is also some makefile magic to cross-compile:
  make PREFIX=i686-w64-mingw32- EXE_EXT=.exe
I selected the option so that it should statically link supports libraries used
by gcc (slsj and libwinpthread).

Change-Id: Iaf07da23afe81ed217fb3921ce13367c5441514d
This commit is contained in:
Amaury Pouly 2020-06-17 23:31:31 +02:00
parent 05fa8fc343
commit 1f338f7078
9 changed files with 239 additions and 90 deletions

View file

@ -25,6 +25,18 @@
#include <stdarg.h>
#include "misc.h"
#if defined(_WIN32) || defined(__WIN32__)
const char OFF[] = "";
const char GREY[] = "";
const char RED[] = "";
const char GREEN[] = "";
const char YELLOW[] = "";
const char BLUE[] = "";
#else
const char OFF[] = { 0x1b, 0x5b, 0x31, 0x3b, '0', '0', 0x6d, '\0' };
const char GREY[] = { 0x1b, 0x5b, 0x31, 0x3b, '3', '0', 0x6d, '\0' };
@ -33,6 +45,8 @@ const char GREEN[] = { 0x1b, 0x5b, 0x31, 0x3b, '3', '2', 0x6d, '\0' };
const char YELLOW[] = { 0x1b, 0x5b, 0x31, 0x3b, '3', '3', 0x6d, '\0' };
const char BLUE[] = { 0x1b, 0x5b, 0x31, 0x3b, '3', '4', 0x6d, '\0' };
#endif
static bool g_color_enable = true;
void enable_color(bool enable)