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>
This commit is contained in:
Pasi Petäjäjärvi 2013-02-11 16:11:27 +02:00 committed by The Qt Project
parent 1f5b10281f
commit 8840ad56a3
2 changed files with 4 additions and 0 deletions

View File

@ -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)

View File

@ -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);