[vlc-devel] [PATCH] Fix the latest mingw-w64 crt trunk

Martell Malone martellmalone at gmail.com
Tue Nov 25 13:19:34 CET 2014


After some digging through the archives

https://mailman.videolan.org/pipermail/vlc-devel/2009-April/058234.html

Seems HAVE_TIME_H has been removed ?

On Tue, Nov 25, 2014 at 12:05 PM, Martell Malone <martellmalone at gmail.com>
wrote:

> Moving on from this I am now working on the modules but I am stuck on
> demux of mkv
>
> C:/msys64/home/Martell/MINGW-packages/mingw-w64-vlc-git/src/vlc/modules/demux/mkv/matroska_segment_parse.cpp:
>> In member function 'void
>> matroska_segment_c::ParseInfo(libmatroska::KaxInfo*)':
>> C:/msys64/home/Martell/MINGW-packages/mingw-w64-vlc-git/src/vlc/modules/demux/mkv/matroska_segment_parse.cpp:904:43:
>> error: 'gmtime_r' was not declared in this scope
>>              if( gmtime_r( &i_date, &tmres ) &&
>>                                            ^
>> C:/msys64/home/Martell/MINGW-packages/mingw-w64-vlc-git/src/vlc/modules/demux/mkv/matroska_segment_parse.cpp:906:34:
>> error: 'strftime' was not declared in this scope
>>                            &tmres ) )
>>                                   ^
>
>
> looking at matroska_segment_parse.cpp it includes mkv.hpp which has
>
> #ifdef HAVE_CONFIG_H
>> # include "config.h"
>> #endif
>> #include <inttypes.h>
>> #include <vlc_common.h>
>> #include <vlc_plugin.h>
>> #ifdef HAVE_TIME_H
>> #   include <time.h>                                               /*
>> time() */
>> #endif
>
>
> at the start so I don't understand why time.h is being missed here ?
> could it be because it is a .hpp and not a .h file or something silly like
> this
> Anyone got any hints?
>
> Many thanks
> Martell
>
> On Tue, Nov 25, 2014 at 12:03 PM, Martell Malone <martellmalone at gmail.com>
> wrote:
>
>> Hi Remi,
>>
>> This should fix building libvlc under new mingw-w64 trunk in the way you
>> suggested.
>>
>> From 2ae7aa2bbad3b89f8c02696c3ceacdbe1cc82780 Mon Sep 17 00:00:00 2001
>> From: Martell Malone <martellmalone at gmail.com>
>> Date: Tue, 25 Nov 2014 11:33:57 +0000
>> Subject: [PATCH] added time include to win32 thread
>>
>> ---
>>  src/win32/thread.c | 1 +
>>  1 file changed, 1 insertion(+)
>>
>> diff --git a/src/win32/thread.c b/src/win32/thread.c
>> index 7dcfc4c..9bc787d 100644
>> --- a/src/win32/thread.c
>> +++ b/src/win32/thread.c
>> @@ -37,6 +37,7 @@
>>  #include <assert.h>
>>  #include <limits.h>
>>  #include <errno.h>
>> +#include <time.h>
>>
>>  /*** Static mutex and condition variable ***/
>>  static vlc_mutex_t super_mutex;
>> --
>> 2.1.3
>>
>>
>> On Tue, Nov 18, 2014 at 7:06 PM, Martell Malone <martellmalone at gmail.com>
>> wrote:
>>
>>> I will do them all one by one then.
>>> I will include time.h in thread.c and any other file that uses the time
>>> function.
>>>
>>> This does mean that this bug was present in vlc already.
>>> It's just HAVE_GMTIME_R and HAVE_LOCALTIME_R were never true for vlc
>>> under mingw-w64 before.
>>> So the developers never included time.h where they used it
>>>
>>> You can do whatever is most convenient for you or your organization
>>>> within your VLC fork or VLC patch series. But upstream, you get to fix bugs
>>>> properly, even if it means one by one.
>>>
>>>
>>> This is not for another fork of vlc this is so that you guys can build
>>> for WinRT under latest trunk
>>>
>>>
>>> On Tue, Nov 18, 2014 at 6:41 PM, Rémi Denis-Courmont <remi at remlab.net>
>>> wrote:
>>>
>>>> Le 2014-11-18 19:17, Martell Malone a écrit :
>>>>
>>>>> If I include time.h in thread.c the error appears somewhere else then
>>>>> if I patch that it appears somewhere else again and so on.
>>>>> This is why I changed vlc_fixups.h to fix them all.
>>>>>
>>>>> Im not sure if there is another solution but
>>>>> I can go through them all 1 by 1 if you want ?
>>>>> It will be time consuming is all.
>>>>>
>>>>> Either way I need to get this fixed. :)
>>>>>
>>>>
>>>> You can do whatever is most convenient for you or your organization
>>>> within your VLC fork or VLC patch series. But upstream, you get to fix bugs
>>>> properly, even if it means one by one.
>>>>
>>>>
>>>> --
>>>> Rémi Denis-Courmont
>>>> _______________________________________________
>>>> vlc-devel mailing list
>>>> To unsubscribe or modify your subscription options:
>>>> https://mailman.videolan.org/listinfo/vlc-devel
>>>>
>>>
>>>
>>
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mailman.videolan.org/pipermail/vlc-devel/attachments/20141125/85525e17/attachment.html>


More information about the vlc-devel mailing list