From 7e3d5a720752900b1ccbb3d8dcbf12cc02b01b63 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Pasi=20Pet=C3=A4j=C3=A4j=C3=A4rvi?= Date: Fri, 15 Jun 2012 13:33:58 +0300 Subject: Use Qt defined gettimeofday for VxWorks and no fallback to X11 version MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit VxWorks don't have gettimeofday function so we always use the one implemented in Qt. VxWorks DIAB compiler is not supported building Qt for VxWorks 6.9.2. Anyone using older VxWorks should also not be affected so use new defines VXWORKS_DKM and VXWORKS_RTP for VxWorks version 6.9.2 onward. Change-Id: I2e9546a101256ea0557b65163b40cd0f28be8519 Reviewed-by: Samuel Rødal --- src/corelib/kernel/qfunctions_vxworks.cpp | 2 +- src/corelib/kernel/qfunctions_vxworks.h | 8 ++++++++ 2 files changed, 9 insertions(+), 1 deletion(-) diff --git a/src/corelib/kernel/qfunctions_vxworks.cpp b/src/corelib/kernel/qfunctions_vxworks.cpp index add4108762..49d9d51ac0 100644 --- a/src/corelib/kernel/qfunctions_vxworks.cpp +++ b/src/corelib/kernel/qfunctions_vxworks.cpp @@ -92,7 +92,7 @@ int usleep(unsigned int usec) // gettimeofday() is declared, but is missing from the library // It IS however defined in the Curtis-Wright X11 libraries, so // we have to make the symbol 'weak' -#if defined(Q_CC_DIAB) +#if defined(Q_CC_DIAB) && !defined(VXWORKS_DKM) && !defined(VXWORKS_RTP) # pragma weak gettimeofday #endif int gettimeofday(struct timeval *tv, void /*struct timezone*/ *) diff --git a/src/corelib/kernel/qfunctions_vxworks.h b/src/corelib/kernel/qfunctions_vxworks.h index d0f6e60cb2..323d662ba1 100644 --- a/src/corelib/kernel/qfunctions_vxworks.h +++ b/src/corelib/kernel/qfunctions_vxworks.h @@ -52,7 +52,11 @@ #include #include #include +#if defined(_WRS_KERNEL) #include +#else +#include +#endif #include #include #include @@ -100,10 +104,14 @@ int rand_r(unsigned int * /*seedp*/); // no usleep() support int usleep(unsigned int); +#if defined(VXWORKS_DKM) || defined(VXWORKS_RTP) +int gettimeofday(struct timeval *, void *); +#else // gettimeofday() is declared, but is missing from the library. // It IS however defined in the Curtis-Wright X11 libraries, so // we have to make the symbol 'weak' int gettimeofday(struct timeval *tv, void /*struct timezone*/ *) __attribute__((weak)); +#endif // neither getpagesize() or sysconf(_SC_PAGESIZE) are available int getpagesize(); -- cgit v1.2.3