[MPlayer-dev-eng] [PATCH] -- FreeBSD RTC Support

Diego Biurrun diego at biurrun.de
Tue Jan 4 02:26:39 CET 2005


Reimar Döffinger writes:
> 
> On Mon, Jan 03, 2005 at 01:43:16AM +0100, Diego Biurrun wrote:
> > 
> > I think having two tests is unnecessary (and slows down configure,
> > which is not a speed demon anyway).  It should not be hard to add
> > support for more platforms later on.
> 
> I have a different suggestion: linux/rtc.h probably will always be
> linux-specific. How about using
> #ifdef __linux__
> #include <linux/rtc.h>
> #else
> <freebsd code here>
> #endif

Yeah, sounds good.

> > > > +#include <rtc.h>
> > > > +#define RTC_IRQP_READ RTCIO_IRQP_SET
> > > 
> > > That is ugly...
> > 
> > Why?
> 
> Because RTC_IRQP_READ is something different than RTC_IRQP_SET.

Point taken.

> > > > +#else
> > > >  #include <linux/rtc.h>
> > > > +#endif
> > > >  int main(void) { return RTC_IRQP_READ; }
> > > 
> > > better change it here... it looks like nonesense to me to test for a
> > > function that we don't use... Or is there a specific reason for this?
> > 
> > Huh?  The function is #defined to the one used on FreeBSD.  The idea
> > is taken from what you implemented for mplayer.c, so ...
> 
> No it is not.
> I have
> #define RTC_IRQP_SET RTCIO_IRQP_SET
> not
> #define RTC_IRQP_READ RTCIO_IRQP_SET
> If we were actually trying to do the ioctl, using SET probably wouldn't
> be a good idea but here it doesn't matter I'd say...

How about the attached version?  It incorporates your suggestions.

Diego

-------------- next part --------------
An embedded and charset-unspecified text was scrubbed...
Name: rtc.patch
URL: <http://lists.mplayerhq.hu/pipermail/mplayer-dev-eng/attachments/20050104/8d312a8d/attachment.asc>


More information about the MPlayer-dev-eng mailing list