[pulseaudio-discuss] Pull request for topic/osx

Daniel Mack daniel at caiaq.de
Tue Dec 15 23:06:25 PST 2009

On Thu, Dec 10, 2009 at 10:12:56AM +0000, Colin Guthrie wrote:
> 'Twas brillig, and Daniel Mack at 10/12/09 02:49 did gyre and gimble:
> > Colin, I'd take your offer and ask you to pull the tree I mentioned
> > above - I will not touch it anymore until you merged :)
> Excellent!
> Got a couple quick comments (regardless of what I said on IRC!!)
> There are a couple places where it appears a final #else.... #endif has
> been removed... this means code will be compiled that isn't needed (the
> previous matching #if/#elif block ends with a return) Some compilers
> throw up warnings about unreachable code in this case. It's probably
> best to ensure the #else #endif is restored (although, personally I
> prefer to have a return right before the closing brace, I don't want to
> mess with compiler warnings nor Lennart's current code style :))
> Files affected:
>  src/pulsecore/core-rtclock.c (two occurrences relating to

Hmm, not sure whether I follow here. The way it is now (with my patch
applied), all functions have a proper return value at the end. If it was
different before, that was a mistake the patch fixes :)

Everything else the patch does is shifting blocks around, which is
necessary due to the fact that on Mac OS X, HAVE_CLOCK_GETTIME is
defined but the actual functions are not implemented. Gna.

> --- a/src/pulsecore/poll.c
> +++ b/src/pulsecore/poll.c
> +/* Mac OSX fails to implement poll() in a working way since 10.4. IOW, for
> + * several years. We need to enable a dirty workaround and emulate that
> call
> + * with select(), just like for Windows. sic! */
> +
> +#if defined(HAVE_POLL_H) && !defined(OS_IS_DARWIN)
> +
> +int pa_poll (struct pollfd *fds, unsigned long int nfds, int timeout) {
> +       return poll(fds, nfds, timeout);
> +}
> +
> +#else
> Would this be better as a:
>  #define pa_poll poll

Yes, agreed. I replaced it by a macro now, but by one which has
arguments, so whoever searches for the implementation will get an idea
of what's going on.

The changed tree is again at

  git://github.com/zonque/pulseaudio.git topic/osx


More information about the pulseaudio-discuss mailing list