comparison log.c @ 940:fc75699d2910 libavutil

Fix compilation on windows CE
author mstorsjo
date Mon, 14 Jun 2010 08:51:46 +0000
parents 823d95e42402
children 1cf2ecdd1127
comparison
equal deleted inserted replaced
939:1acef06f2739 940:fc75699d2910
32 #if LIBAVUTIL_VERSION_MAJOR > 50 32 #if LIBAVUTIL_VERSION_MAJOR > 50
33 static 33 static
34 #endif 34 #endif
35 int av_log_level = AV_LOG_INFO; 35 int av_log_level = AV_LOG_INFO;
36 36
37 #ifdef _WIN32 37 #if defined(_WIN32) && !defined(__MINGW32CE__)
38 #include <windows.h> 38 #include <windows.h>
39 static const uint8_t color[] = {12,12,12,14,7,7,7}; 39 static const uint8_t color[] = {12,12,12,14,7,7,7};
40 static int16_t background, attr_orig; 40 static int16_t background, attr_orig;
41 static HANDLE con; 41 static HANDLE con;
42 #define set_color(x) SetConsoleTextAttribute(con, background | color[x]) 42 #define set_color(x) SetConsoleTextAttribute(con, background | color[x])
49 static int use_color=-1; 49 static int use_color=-1;
50 50
51 #undef fprintf 51 #undef fprintf
52 static void colored_fputs(int level, const char *str){ 52 static void colored_fputs(int level, const char *str){
53 if(use_color<0){ 53 if(use_color<0){
54 #ifdef _WIN32 54 #if defined(_WIN32) && !defined(__MINGW32CE__)
55 CONSOLE_SCREEN_BUFFER_INFO con_info; 55 CONSOLE_SCREEN_BUFFER_INFO con_info;
56 con = GetStdHandle(STD_ERROR_HANDLE); 56 con = GetStdHandle(STD_ERROR_HANDLE);
57 use_color = (con != INVALID_HANDLE_VALUE) && !getenv("NO_COLOR"); 57 use_color = (con != INVALID_HANDLE_VALUE) && !getenv("NO_COLOR");
58 if (use_color) { 58 if (use_color) {
59 GetConsoleScreenBufferInfo(con, &con_info); 59 GetConsoleScreenBufferInfo(con, &con_info);