From 94a7ca141cd2bc60477036b49580f5fb3d2c253e Mon Sep 17 00:00:00 2001 From: XVilka Date: Mon, 26 Jan 2015 21:41:57 +0300 Subject: [PATCH] 256 colors support in cygwin --- libr/cons/rgb.c | 4 ++-- libr/core/config.c | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/libr/cons/rgb.c b/libr/cons/rgb.c index f029c53d43..bec7a7fd5c 100644 --- a/libr/cons/rgb.c +++ b/libr/cons/rgb.c @@ -64,7 +64,7 @@ static void unrgb(int color, int *r, int *g, int *b) { } static inline void rgbinit(int r, int g, int b) { -#if __UNIX__ +#if __UNIX__ || __CYGWIN__ r_cons_printf ("\x1b]4;%d;rgb:%2.2x/%2.2x/%2.2x\x1b\\", 16 + (r * 36) + (g * 6) + b, (r ? (r * 40 + 55) : 0), @@ -161,7 +161,7 @@ R_API char *r_cons_rgb_str (char *outstr, ut8 r, ut8 g, ut8 b, int is_bg) { } R_API void r_cons_rgb (ut8 r, ut8 g, ut8 b, int is_bg) { -#if __WINDOWS__ +#if __WINDOWS__ && !__CYGWIN__ #warning r_cons_rgb not yet supported on windows #else char outstr[64]; diff --git a/libr/core/config.c b/libr/core/config.c index 165ed9b19b..4c51f69962 100644 --- a/libr/core/config.c +++ b/libr/core/config.c @@ -964,7 +964,7 @@ R_API int r_core_config_init(RCore *core) { SETCB("cfg.datefmt", "%d:%m:%Y %H:%M:%S %z", &cb_cfgdatefmt, "Date format (%d:%m:%Y %H:%M:%S %z)"); SETCB("cfg.debug", "false", &cb_cfgdebug, "set/unset the debugger mode"); p = r_sys_getenv ("EDITOR"); -#if __WINDOWS__ +#if __WINDOWS__ && !__CYGWIN__ r_config_set (cfg, "cfg.editor", p? p: "notepad"); #else r_config_set (cfg, "cfg.editor", p? p: "vi"); @@ -1153,7 +1153,7 @@ R_API int r_core_config_init(RCore *core) { SETCB("scr.rows", "0", &cb_scrrows, "Set the rows number"); SETCB("scr.tee", "", &cb_teefile, "Pipe console output to file if not empty"); SETPREF("scr.seek", "", "Seek to the specified address on startup"); -#if __WINDOWS__ +#if __WINDOWS__ && !__CYGWIN__ r_config_set_cb (cfg, "scr.rgbcolor", "false", &cb_rgbcolors); #else r_config_set_cb (cfg, "scr.rgbcolor", "true", &cb_rgbcolors);