From 228597e894fcc5a8ad1b2c58221e8a2b34a1bb3d Mon Sep 17 00:00:00 2001 From: cedric Date: Sat, 28 Jul 2012 15:53:15 +0000 Subject: [PATCH] edje: compile again on windows. Patch half Vincent, half myself. git-svn-id: svn+ssh://svn.enlightenment.org/var/svn/e/trunk/edje@74537 7cbeb6ba-43b4-40fd-8cce-4c39aea84d33 --- src/bin/edje_cc.h | 33 +++++++++++++++++++++++++++++---- 1 file changed, 29 insertions(+), 4 deletions(-) diff --git a/src/bin/edje_cc.h b/src/bin/edje_cc.h index 8438827..4b78382 100644 --- a/src/bin/edje_cc.h +++ b/src/bin/edje_cc.h @@ -17,19 +17,44 @@ extern Eina_Prefix *pfx; /* logging variables */ extern int _edje_cc_log_dom ; #define EDJE_CC_DEFAULT_LOG_COLOR EINA_COLOR_CYAN + +#ifdef _WIN32 +# define EDJE_ERR_COLOR FOREGROUND_RED | FOREGROUND_INTENSITY +# define EDJE_INF_COLOR FOREGROUND_RED | FOREGROUND_BLUE | FOREGROUND_INTENSITY +# define EDJE_WRN_COLOR FOREGROUND_RED | FOREGROUND_GREEN | FOREGROUND_INTENSITY +# define EDJE_LOG(str, color, ...) do { \ + SetConsoleTextAttribute(GetStdHandle(STD_OUTPUT_HANDLE), \ + color); \ + printf(str); \ + SetConsoleTextAttribute(GetStdHandle(STD_OUTPUT_HANDLE), \ + FOREGROUND_RED | FOREGROUND_GREEN | FOREGROUND_BLUE); \ + printf(": "); \ + printf(__VA_ARGS__); \ + printf("\n"); \ + } while (0) +#else +# define EDJE_ERR_COLOR "\033[31m" +# define EDJE_INF_COLOR "\033[35m" +# define EDJE_WRN_COLOR "\033[33m" +# define EDJE_LOG(str, color, ...) do { \ + printf("\033[31m"); \ + printf(__VA_ARGS__); \ + printf("\033[0m\n"); } \ + while (0) +#endif + #ifdef ERR # undef ERR #endif -#define ERR(...) do{printf("\033[31m");printf(__VA_ARGS__);printf("\033[0m\n");} while (0) +#define ERR(...) EDJE_LOG("ERR", EDJE_ERR_COLOR, __VA_ARGS__) #ifdef INF # undef INF #endif -#define INF(...) do{printf("\033[35m");printf(__VA_ARGS__);printf("\033[0m\n");} while (0) +#define INF(...) EDJE_LOG("INF", EDJE_INF_COLOR, __VA_ARGS__) #ifdef WRN # undef WRN #endif -#define WRN(...) do{printf("\033[33m");printf(__VA_ARGS__);printf("\033[0m\n");} while (0) - +#define WRN(...) EDJE_LOG("WRN", EDJE_WRN_COLOR, __VA_ARGS__) /* types */ typedef struct _New_Object_Handler New_Object_Handler; -- 2.7.4