diff options
author | Pasi Petäjäjärvi <pasi.petajajarvi@digia.com> | 2012-06-15 10:33:58 (GMT) |
---|---|---|
committer | The Qt Project <gerrit-noreply@qt-project.org> | 2013-01-28 13:13:06 (GMT) |
commit | 51404b0e979d0a971cace7e265638e6bec48f935 (patch) | |
tree | b3d3611cc6bd8b222a56c47f7f1d7438ed599f89 /src/corelib/kernel | |
parent | 056eb48d78717e1cbffc4f959b229b95116780fa (diff) | |
download | Qt-51404b0e979d0a971cace7e265638e6bec48f935.zip Qt-51404b0e979d0a971cace7e265638e6bec48f935.tar.gz Qt-51404b0e979d0a971cace7e265638e6bec48f935.tar.bz2 |
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
(cherry picked from qtbase/7e3d5a720752900b1ccbb3d8dcbf12cc02b01b63)
Reviewed-by: Samuel Rødal <samuel.rodal@digia.com>
Diffstat (limited to 'src/corelib/kernel')
-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 2174588..7e2516e 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 0d3e838..761c051 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> @@ -139,10 +143,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(); |