summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorcedric <cedric@7cbeb6ba-43b4-40fd-8cce-4c39aea84d33>2012-07-28 15:53:15 +0000
committercedric <cedric@7cbeb6ba-43b4-40fd-8cce-4c39aea84d33>2012-07-28 15:53:15 +0000
commit228597e894fcc5a8ad1b2c58221e8a2b34a1bb3d (patch)
tree733850602dc470a876e4da0f64eee4d525c8a916
parent9cff0ca5febaf69c883f544c117efc8f62af39a6 (diff)
downloadedje-228597e894fcc5a8ad1b2c58221e8a2b34a1bb3d.tar.gz
edje-228597e894fcc5a8ad1b2c58221e8a2b34a1bb3d.tar.bz2
edje-228597e894fcc5a8ad1b2c58221e8a2b34a1bb3d.zip
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
-rw-r--r--src/bin/edje_cc.h33
1 files 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;