diff options
author | Pasi Petäjäjärvi <pasi.petajajarvi@digia.com> | 2013-02-11 16:11:27 +0200 |
---|---|---|
committer | The Qt Project <gerrit-noreply@qt-project.org> | 2013-02-12 09:40:48 +0100 |
commit | 8840ad56a3afb185b4e0b9158130d6e265161f4e (patch) | |
tree | a9395c6b625ea5b91fb0739a531c7f001a173768 /src/corelib | |
parent | 1f5b10281fc275761a8a213fdba2edf2ccc7f17a (diff) |
Use stub function rand_r for VxWorks DKM mode
Vxworks DKM mode does not have rand_r function, use function
implementation from qfunctions_vxworks.h/cpp instead.
Change-Id: I8f23c3453ab9f31280eb90f66dd83d7a64ee98c9
Reviewed-by: Samuel Rødal <samuel.rodal@digia.com>
Diffstat (limited to 'src/corelib')
-rw-r--r-- | src/corelib/kernel/qfunctions_vxworks.cpp | 2 | ||||
-rw-r--r-- | src/corelib/kernel/qfunctions_vxworks.h | 2 |
2 files changed, 4 insertions, 0 deletions
diff --git a/src/corelib/kernel/qfunctions_vxworks.cpp b/src/corelib/kernel/qfunctions_vxworks.cpp index 8d25ad6a8d..e1abecb9d6 100644 --- a/src/corelib/kernel/qfunctions_vxworks.cpp +++ b/src/corelib/kernel/qfunctions_vxworks.cpp @@ -76,10 +76,12 @@ void *lfind(const void* key, const void* base, size_t* elements, size_t size, // no rand_r(), but rand() // NOTE: this implementation is wrong for multi threaded applications, // but there is no way to get it right on VxWorks (in kernel mode) +#if defined(_WRS_KERNEL) int rand_r(unsigned int * /*seedp*/) { return rand(); } +#endif // no usleep() support int usleep(unsigned int usec) diff --git a/src/corelib/kernel/qfunctions_vxworks.h b/src/corelib/kernel/qfunctions_vxworks.h index d12a302c8d..02c599f490 100644 --- a/src/corelib/kernel/qfunctions_vxworks.h +++ b/src/corelib/kernel/qfunctions_vxworks.h @@ -134,7 +134,9 @@ void *lfind(const void* key, const void* base, size_t* elements, size_t size, // no rand_r(), but rand() // NOTE: this implementation is wrong for multi threaded applications, // but there is no way to get it right on VxWorks (in kernel mode) +#if defined(_WRS_KERNEL) int rand_r(unsigned int * /*seedp*/); +#endif // no usleep() support int usleep(unsigned int); |