[MPlayer-dev-eng] osdep/gettimeofday.c gettimeofday() prototype

Jerome Duval jeromed at bluestreaktech.com
Thu Jan 6 16:56:02 CET 2011


-----Original Message-----
From: mplayer-dev-eng-bounces at mplayerhq.hu [mailto:mplayer-dev-eng-bounces at mplayerhq.hu] On Behalf Of Diego Biurrun
Sent: January-06-11 7:16 AM
To: mplayer-dev-eng at mplayerhq.hu
Subject: [MPlayer-dev-eng] osdep/gettimeofday.c gettimeofday() prototype

I'm somewhat confused what the correct prototype for gettimeofday() is.

I stumbled across the following problem report where compilation of osdep/gettimeofday.c is failing due to a conflicting prototype between our implementation and the system header:
http://lists.mplayerhq.hu/pipermail/mplayerosx-devel/2010-December/000030.html

POSIX specifies the following prototype:

http://pubs.opengroup.org/onlinepubs/9699919799/functions/gettimeofday.html
  int gettimeofday(struct timeval *restrict tp, void *restrict tzp);

while my Linux man page has the following:

  int gettimeofday(struct timeval *tv, struct timezone *tz);

which is the same as our local implementation.  What gives?

Diego
_______________________________________________
MPlayer-dev-eng mailing list
MPlayer-dev-eng at mplayerhq.hu
https://lists.mplayerhq.hu/mailman/listinfo/mplayer-dev-eng

Looking quickly online, restrict is C99 and up and modifies the pointer type to help with aliasing. They are different and Linux hasn't (or maybe won't) update to the new type?


More information about the MPlayer-dev-eng mailing list