[FFmpeg-devel] [PATCH] add colours to warnings and errors

James Darnley james.darnley
Sun Apr 25 17:04:33 CEST 2010


On 25 April 2010 00:45, James Darnley <james.darnley at gmail.com> wrote:
> On 25 April 2010 00:00, Michael Niedermayer <michaelni at gmx.at> wrote:
>> On Sat, Apr 24, 2010 at 11:35:31PM +0200, James Darnley wrote:
>>> On 24 April 2010 23:18, Michael Niedermayer <michaelni at gmx.at> wrote:
>>>
>>> >
>>> > ? ?if(use_win_color){
>>> > ? ?...
>>> > ? ?}else
>>> > #else
>>> > ? ?{
>>> > ? ? ? ?if(use_ansi_color<0){
>>> > ? ?#if HAVE_ISATTY && !defined(_WIN32)
>>> > ? ? ? ? ? ?use_ansi_color= getenv("TERM") && !getenv("NO_COLOR") && isatty(2);
>>> > @@ -53,6 +121,7 @@
>>> > ? ? ? ?if(use_ansi_color){
>>> > ? ? ? ? ? ?fprintf(stderr, "\033[0m");
>>> > ? ? ? ?}
>>> > ? ?}
>>> > #endif
>>> >
>>>
>>> Was this a hint that you want if(use_win_color) before if(use_ansi_color)?
>>
>> no, i just meant to reduce the ifdefery and reduce the duplication of the
>> ansi printing
>
> As far as I can see, reducing the duplication would mean one more
> ifdef for the "colour reset function"
>

I've reduced the duplication by adding:
#ifndef _WIN32
#define SetConsoleTextAttribute(x,y) ;
#endif
so that this function becomes nothing.
-------------- next part --------------
A non-text attachment was scrubbed...
Name: colours.diff
Type: application/octet-stream
Size: 3385 bytes
Desc: not available
URL: <http://lists.mplayerhq.hu/pipermail/ffmpeg-devel/attachments/20100425/1194952f/attachment.obj>



More information about the ffmpeg-devel mailing list