summaryrefslogtreecommitdiff
path: root/libavutil/log.c
diff options
context:
space:
mode:
authorMichael Niedermayer <michaelni@gmx.at>2012-12-01 13:10:48 +0100
committerMichael Niedermayer <michaelni@gmx.at>2012-12-01 13:10:48 +0100
commit5473f6258c63d21494cbd8f176b8840713150b82 (patch)
tree1206206ea4e612b3f3cffa03bc376c70278baad4 /libavutil/log.c
parent12cd992d67d996f7283f6fb61fdbbaf759f3570a (diff)
parent3bbe63d1a45853c6b760f1ea9551668568bff7ee (diff)
Merge remote-tracking branch 'qatar/master'
* qatar/master: configure: Use headers in the check for _beginthreadex for w32threads avutil: Use a configure check to enable windows console functions avutil: Include io.h with a separate condition from windows console functions Conflicts: libavutil/log.c Merged-by: Michael Niedermayer <michaelni@gmx.at>
Diffstat (limited to 'libavutil/log.c')
-rw-r--r--libavutil/log.c8
1 files changed, 5 insertions, 3 deletions
diff --git a/libavutil/log.c b/libavutil/log.c
index 1bae1b2165..57b3d5d087 100644
--- a/libavutil/log.c
+++ b/libavutil/log.c
@@ -29,6 +29,9 @@
#if HAVE_UNISTD_H
#include <unistd.h>
#endif
+#if HAVE_IO_H
+#include <io.h>
+#endif
#include <stdlib.h>
#include "avutil.h"
#include "common.h"
@@ -39,9 +42,8 @@
static int av_log_level = AV_LOG_INFO;
static int flags;
-#if defined(_WIN32) && !defined(__MINGW32CE__)
+#if HAVE_SETCONSOLETEXTATTRIBUTE
#include <windows.h>
-#include <io.h>
static const uint8_t color[16 + AV_CLASS_CATEGORY_NB] = {
[AV_LOG_PANIC /8] = 12,
[AV_LOG_FATAL /8] = 12,
@@ -101,7 +103,7 @@ static int use_color = -1;
static void colored_fputs(int level, const char *str)
{
if (use_color < 0) {
-#if defined(_WIN32) && !defined(__MINGW32CE__)
+#if HAVE_SETCONSOLETEXTATTRIBUTE
CONSOLE_SCREEN_BUFFER_INFO con_info;
con = GetStdHandle(STD_ERROR_HANDLE);
use_color = (con != INVALID_HANDLE_VALUE) && !getenv("NO_COLOR") &&