summaryrefslogtreecommitdiffstats
path: root/src/corelib/kernel
diff options
context:
space:
mode:
authorRitt Konstantin <ritt.ks@gmail.com>2011-04-01 08:30:59 (GMT)
committerJoão Abecasis <joao.abecasis@nokia.com>2011-04-01 08:31:19 (GMT)
commite2078f5099d4db1aa2c59d2c9fa9fa8efc5a6c46 (patch)
tree93c787f628699816e05747c496a07255a89d6728 /src/corelib/kernel
parentb63e0f7c612f7e63831dbee3565292ddca7dba59 (diff)
downloadQt-e2078f5099d4db1aa2c59d2c9fa9fa8efc5a6c46.zip
Qt-e2078f5099d4db1aa2c59d2c9fa9fa8efc5a6c46.tar.gz
Qt-e2078f5099d4db1aa2c59d2c9fa9fa8efc5a6c46.tar.bz2
move semun declaration to qcore_unix_p.h
according to X/OPEN we have to define semun ourselves but on some systems sem.h will have it, so let's use a prefixed one (qt_semun). this allows to avoid the code duplication and makes things a bit easier to undesrtand Merge-request: 2586 Reviewed-by: João Abecasis <joao.abecasis@nokia.com>
Diffstat (limited to 'src/corelib/kernel')
-rw-r--r--src/corelib/kernel/qcore_unix_p.h9
-rw-r--r--src/corelib/kernel/qsystemsemaphore_unix.cpp7
2 files changed, 9 insertions, 7 deletions
diff --git a/src/corelib/kernel/qcore_unix_p.h b/src/corelib/kernel/qcore_unix_p.h
index 2e84f3b..33df0da 100644
--- a/src/corelib/kernel/qcore_unix_p.h
+++ b/src/corelib/kernel/qcore_unix_p.h
@@ -319,6 +319,15 @@ timeval qt_gettime(); // in qelapsedtimer_mac.cpp or qtimestamp_unix.cpp
Q_CORE_EXPORT int qt_safe_select(int nfds, fd_set *fdread, fd_set *fdwrite, fd_set *fdexcept,
const struct timeval *tv);
+// according to X/OPEN we have to define semun ourselves
+// we use prefix as on some systems sem.h will have it
+struct semid_ds;
+union qt_semun {
+ int val; /* value for SETVAL */
+ struct semid_ds *buf; /* buffer for IPC_STAT, IPC_SET */
+ unsigned short *array; /* array for GETALL, SETALL */
+};
+
QT_END_NAMESPACE
#endif
diff --git a/src/corelib/kernel/qsystemsemaphore_unix.cpp b/src/corelib/kernel/qsystemsemaphore_unix.cpp
index a68abd3..55b65b7 100644
--- a/src/corelib/kernel/qsystemsemaphore_unix.cpp
+++ b/src/corelib/kernel/qsystemsemaphore_unix.cpp
@@ -64,13 +64,6 @@
QT_BEGIN_NAMESPACE
-// We have to define this as on some sem.h will have it
-union qt_semun {
- int val; /* value for SETVAL */
- struct semid_ds *buf; /* buffer for IPC_STAT, IPC_SET */
- unsigned short *array; /* array for GETALL, SETALL */
-};
-
QSystemSemaphorePrivate::QSystemSemaphorePrivate() :
semaphore(-1), createdFile(false),
createdSemaphore(false), unix_key(-1), error(QSystemSemaphore::NoError)