Commit 5473f625 authored by Michael Niedermayer's avatar Michael Niedermayer

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: 's avatarMichael Niedermayer <michaelni@gmx.at>
parents 12cd992d 3bbe63d1
...@@ -1393,6 +1393,7 @@ HAVE_LIST=" ...@@ -1393,6 +1393,7 @@ HAVE_LIST="
sched_getaffinity sched_getaffinity
sdl sdl
sdl_video_size sdl_video_size
SetConsoleTextAttribute
setmode setmode
setrlimit setrlimit
Sleep Sleep
...@@ -3648,6 +3649,7 @@ check_func_headers windows.h GetProcessAffinityMask ...@@ -3648,6 +3649,7 @@ check_func_headers windows.h GetProcessAffinityMask
check_func_headers windows.h GetProcessTimes check_func_headers windows.h GetProcessTimes
check_func_headers windows.h GetSystemTimeAsFileTime check_func_headers windows.h GetSystemTimeAsFileTime
check_func_headers windows.h MapViewOfFile check_func_headers windows.h MapViewOfFile
check_func_headers windows.h SetConsoleTextAttribute
check_func_headers windows.h Sleep check_func_headers windows.h Sleep
check_func_headers windows.h VirtualAlloc check_func_headers windows.h VirtualAlloc
check_func_headers glob.h glob check_func_headers glob.h glob
...@@ -3685,7 +3687,7 @@ if ! disabled vda && ! enabled ppc; then ...@@ -3685,7 +3687,7 @@ if ! disabled vda && ! enabled ppc; then
fi fi
if ! disabled w32threads && ! enabled pthreads; then if ! disabled w32threads && ! enabled pthreads; then
check_func _beginthreadex && enable w32threads check_func_headers "windows.h process.h" _beginthreadex && enable w32threads
fi fi
# check for some common methods of building with pthread support # check for some common methods of building with pthread support
......
...@@ -29,6 +29,9 @@ ...@@ -29,6 +29,9 @@
#if HAVE_UNISTD_H #if HAVE_UNISTD_H
#include <unistd.h> #include <unistd.h>
#endif #endif
#if HAVE_IO_H
#include <io.h>
#endif
#include <stdlib.h> #include <stdlib.h>
#include "avutil.h" #include "avutil.h"
#include "common.h" #include "common.h"
...@@ -39,9 +42,8 @@ ...@@ -39,9 +42,8 @@
static int av_log_level = AV_LOG_INFO; static int av_log_level = AV_LOG_INFO;
static int flags; static int flags;
#if defined(_WIN32) && !defined(__MINGW32CE__) #if HAVE_SETCONSOLETEXTATTRIBUTE
#include <windows.h> #include <windows.h>
#include <io.h>
static const uint8_t color[16 + AV_CLASS_CATEGORY_NB] = { static const uint8_t color[16 + AV_CLASS_CATEGORY_NB] = {
[AV_LOG_PANIC /8] = 12, [AV_LOG_PANIC /8] = 12,
[AV_LOG_FATAL /8] = 12, [AV_LOG_FATAL /8] = 12,
...@@ -101,7 +103,7 @@ static int use_color = -1; ...@@ -101,7 +103,7 @@ static int use_color = -1;
static void colored_fputs(int level, const char *str) static void colored_fputs(int level, const char *str)
{ {
if (use_color < 0) { if (use_color < 0) {
#if defined(_WIN32) && !defined(__MINGW32CE__) #if HAVE_SETCONSOLETEXTATTRIBUTE
CONSOLE_SCREEN_BUFFER_INFO con_info; CONSOLE_SCREEN_BUFFER_INFO con_info;
con = GetStdHandle(STD_ERROR_HANDLE); con = GetStdHandle(STD_ERROR_HANDLE);
use_color = (con != INVALID_HANDLE_VALUE) && !getenv("NO_COLOR") && use_color = (con != INVALID_HANDLE_VALUE) && !getenv("NO_COLOR") &&
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment