diff options
author | Pasi Petäjäjärvi <pasi.petajajarvi@digia.com> | 2012-06-15 13:33:58 +0300 |
---|---|---|
committer | The Qt Project <gerrit-noreply@qt-project.org> | 2013-01-23 10:38:47 +0100 |
commit | 7e3d5a720752900b1ccbb3d8dcbf12cc02b01b63 (patch) | |
tree | 4b9b94db1c5483463f7b2899b9f7e065f3646ee7 | |
parent | fb5bbea031d6a7cdc033121c01a2fca9c12c67fb (diff) |
Use Qt defined gettimeofday for VxWorks and no fallback to X11 version
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 <samuel.rodal@digia.com>
-rw-r--r-- | src/corelib/kernel/qfunctions_vxworks.cpp | 2 | ||||
-rw-r--r-- | src/corelib/kernel/qfunctions_vxworks.h | 8 |
2 files changed, 9 insertions, 1 deletions
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 <errno.h> #include <sys/types.h> #include <sys/ioctl.h> +#if defined(_WRS_KERNEL) #include <sys/times.h> +#else +#include <sys/time.h> +#endif #include <sys/socket.h> #include <sys/stat.h> #include <sys/wait.h> @@ -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(); |