mirror of
https://github.com/FFmpeg/FFmpeg.git
synced 2025-01-24 13:56:33 +02:00
avutil: Use a configure check to enable windows console functions
Not all versions or API subsets of windows have these functions. Signed-off-by: Martin Storsjö <martin@martin.st>
This commit is contained in:
parent
b70abd5b61
commit
7e6a11bcf7
2
configure
vendored
2
configure
vendored
@ -1242,6 +1242,7 @@ HAVE_LIST="
|
|||||||
sched_getaffinity
|
sched_getaffinity
|
||||||
sdl
|
sdl
|
||||||
sdl_video_size
|
sdl_video_size
|
||||||
|
SetConsoleTextAttribute
|
||||||
setmode
|
setmode
|
||||||
setrlimit
|
setrlimit
|
||||||
Sleep
|
Sleep
|
||||||
@ -3305,6 +3306,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
|
||||||
|
|
||||||
|
@ -41,7 +41,7 @@
|
|||||||
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>
|
||||||
static const uint8_t color[] = { 12, 12, 12, 14, 7, 10, 11 };
|
static const uint8_t color[] = { 12, 12, 12, 14, 7, 10, 11 };
|
||||||
static int16_t background, attr_orig;
|
static int16_t background, attr_orig;
|
||||||
@ -59,7 +59,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") &&
|
||||||
|
Loading…
x
Reference in New Issue
Block a user