[vlc-devel] [PATCH] messages.c: added logging via OutputDebugString under windows.

Sergey Radionov rsatom at gmail.com
Thu Dec 22 00:26:45 CET 2011


2011/12/21 Tobias Güntner <fatbull at web.de>:
> Am 21.12.2011 04:09, schrieb Sergey Radionov:
>>
>> Signed-off-by: Rafaël Carré<funman at videolan.org>
>
>
>> +#ifdef WIN32
>> +    va_list dol;
>> +    va_copy (dol, args);
>> +    Win32DebugOutputMsg (0, type,&msg, format, dol);
>> +    va_end (dol);
>> +#endif
>
>
> Maybe test IsDebuggerPresent() as well?
http://msdn.microsoft.com/en-us/library/windows/desktop/ms680345(v=vs.85).aspx
*Requirements:
Minimum supported client Windows 2000 Professional
Minimum supported server Windows 2000 Server*

What about WinNT 4.0, 3.x ? and win 95/98/Me?

>
>
>> +    size_t fmt_len = strlen(format);
>> +    char *fmt_cr = malloc(fmt_len + 1 + 1);
>> +    if (!fmt_cr)
>> +        return;
>> +
>> +    strcpy(fmt_cr, format);
>> +    fmt_cr[fmt_len] = '\n';
>> +    fmt_cr[fmt_len + 1] = '\0';
>
>
> Perhaps asprintf would be easier.
>
>
>> +    char *msg;
>> +    if (vasprintf(&msg, fmt_cr, dol))
>> +        msg = NULL;
>
>
> vasprintf returns -1 on error.
>
> Regards,
> Tobias
>
>
> _______________________________________________
> vlc-devel mailing list
> To unsubscribe or modify your subscription options:
> http://mailman.videolan.org/listinfo/vlc-devel



More information about the vlc-devel mailing list