[mythtv] [mythtv-commits] mythtv/master commit: c7b18dbc4 by Daniel Kristjansson (daniel-kristjansson)

Jonathan Martens jonathan at snetram.nl
Tue Aug 23 21:36:05 UTC 2011


On 23-8-2011 23:21, Daniel Kristjansson wrote:
> On Tue, 2011-08-23 at 23:07 +0200, Jonathan Martens wrote:
>> On 23-8-2011 22:57, Jonathan Martens wrote:
>>> I am afraid that this is the first in a line of things braking windows
>>> compilation as before I did a 'make distclean' I already observed this
>
> Sorry, I wrote this based on the Microsoft documentation, I didn't
> realize mingw doesn't support those the Microsoft stdlib.h. My
> googling on mingw and random doesn't seem to turn anything up.

No harm done. :-)

> rand() isn't supposed to be used in multi-threaded programs. How
> badly it fails depends on a particular implementation, but I can't
> find any documentation the MINGW rand() implementation.

I know.

> If we need to, we can go back to the posix_rand_r() in my previous
> commit but it isn't exactly fast since it uses a mutex. Maybe some
> windows developer can speak up on how to get decent pseudo-random
> numbers in a thread-safe way using mingw?

I will see what I can find, but I am not that good I am afraid, the best 
thing I can do in this case is consulting Google :-0
Reverting the changes brings me at least past the first pitfall...

> As for srandom() we can just put a stub in compat.h for that on
> windows, it just initializes the pseudo-random number generator.

You mean something like:

#define srandom srand

Or something else?

Kind regards,

Jonathan


More information about the mythtv-dev mailing list