[mythtv] usleep on Win
Jonathan Martens
jonathan at snetram.nl
Sat Dec 5 00:45:29 UTC 2009
On 5-12-2009 0:42, Jonathan wrote:
> Further to my previous post regarding a win compile and mythmainwindow.cpp
>
>
> Line 38
> #include "compat.h" // for usleep on MS Windows.
> I add this line after:
> #include "unistd.h" // for my machine - usleep is defined in here for mingw
This issue has been brought up multiple times now, including compat.h
will _not_ include unistd.h (for usleep) as it is not included or
defined (anymore) in this file.
I am not sure on how to resolve this properly, but I think we either
need to include unistd.h when we use usleep() (which is the most
reasonable to me as this would cause no side effects on *nix systems:
http://linux.die.net/man/3/usleep) or include it in compat.h to solve
the problem of developers thinking including compat.h will solve the
usleep() dependency issues as it might be included on *nix systems by
some other include logic, which I am unaware of.
Since I have no saying on what would be best, I would advocate for
including unistd.h when using usleep() in the code as the usleep
workaround has been removed since r19910
(http://svn.mythtv.org/trac/changeset/19910)
Kind regards,
Jonathan
More information about the mythtv-dev
mailing list