summaryrefslogtreecommitdiffstats
path: root/src/corelib/kernel/qfunctions_vxworks.h
diff options
context:
space:
mode:
Diffstat (limited to 'src/corelib/kernel/qfunctions_vxworks.h')
-rw-r--r--src/corelib/kernel/qfunctions_vxworks.h56
1 files changed, 52 insertions, 4 deletions
diff --git a/src/corelib/kernel/qfunctions_vxworks.h b/src/corelib/kernel/qfunctions_vxworks.h
index 6339903cff..e33401a86a 100644
--- a/src/corelib/kernel/qfunctions_vxworks.h
+++ b/src/corelib/kernel/qfunctions_vxworks.h
@@ -41,6 +41,9 @@
#ifndef QFUNCTIONS_VXWORKS_H
#define QFUNCTIONS_VXWORKS_H
+
+#include <QtCore/qglobal.h>
+
#ifdef Q_OS_VXWORKS
#include <unistd.h>
@@ -52,7 +55,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>
@@ -61,15 +68,50 @@
#include <net/if.h>
#endif
-QT_BEGIN_HEADER
+// VxWorks has public header mbuf.h which defines following variables for DKM.
+// Let's undef those to because they overlap with Qt variable names-
+// File mbuf.h is included in headers <netinet/in.h> <net/if.h>, so make sure
+// that those are included before undef's.
+#if defined(mbuf)
+# undef mbuf
+#endif
+#if defined(m_data)
+# undef m_data
+#endif
+#if defined(m_type)
+# undef m_type
+#endif
+#if defined(m_next)
+# undef m_next
+#endif
+#if defined(m_len)
+# undef m_len
+#endif
+#if defined(m_flags)
+# undef m_flags
+#endif
+#if defined(m_hdr)
+# undef m_hdr
+#endif
+#if defined(m_ext)
+# undef m_ext
+#endif
+#if defined(m_act)
+# undef m_act
+#endif
+#if defined(m_nextpkt)
+# undef m_nextpkt
+#endif
+#if defined(m_pkthdr)
+# undef m_pkthdr
+#endif
+
QT_BEGIN_NAMESPACE
#ifdef QT_BUILD_CORE_LIB
#endif
QT_END_NAMESPACE
-QT_END_HEADER
-
#ifndef RTLD_LOCAL
#define RTLD_LOCAL 0
@@ -95,17 +137,23 @@ 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);
+#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
+// getpagesize() not available
int getpagesize();
// symlinks are not supported (lstat is now just a call to stat - see qplatformdefs.h)