Repository : ssh://darcs.haskell.org//srv/darcs/packages/base On branch : master
http://hackage.haskell.org/trac/ghc/changeset/dfca290a74ae88f79968c1f0ad7734ea834f6777 >--------------------------------------------------------------- commit dfca290a74ae88f79968c1f0ad7734ea834f6777 Author: Ian Lynagh <[email protected]> Date: Fri Nov 25 17:31:45 2011 +0000 Add a C wrapper for gettimeofday Based on part of a patch from Arnaud Degroote in #5480. On NetBSD just calling the function directly warns: warning: reference to compatibility gettimeofday(); include <sys/time.h> to generate correct reference >--------------------------------------------------------------- GHC/Event/Clock.hsc | 2 +- include/HsBase.h | 4 ++++ 2 files changed, 5 insertions(+), 1 deletions(-) diff --git a/GHC/Event/Clock.hsc b/GHC/Event/Clock.hsc index ac44805..0cf6272 100644 --- a/GHC/Event/Clock.hsc +++ b/GHC/Event/Clock.hsc @@ -45,6 +45,6 @@ instance Storable CTimeval where #{poke struct timeval, tv_sec} ptr (sec tv) #{poke struct timeval, tv_usec} ptr (usec tv) -foreign import ccall unsafe "sys/time.h gettimeofday" gettimeofday +foreign import ccall unsafe "__hsbase_gettimeofday" gettimeofday :: Ptr CTimeval -> Ptr () -> IO CInt diff --git a/include/HsBase.h b/include/HsBase.h index a9c19e4..109eb58 100644 --- a/include/HsBase.h +++ b/include/HsBase.h @@ -633,6 +633,10 @@ INLINE int __hscore_select(int nfds, fd_set *readfds, fd_set *writefds, #if !defined(__MINGW32__) +INLINE int __hsbase_gettimeofday(struct timeval *tv, struct timezone *tz) { + return gettimeofday(tv, tz); +} + INLINE HsInt sizeofTimeVal(void) { return sizeof(struct timeval); } INLINE HsWord64 getUSecOfDay(void) _______________________________________________ Cvs-libraries mailing list [email protected] http://www.haskell.org/mailman/listinfo/cvs-libraries
