Refactor shared memory logic.

This commit is contained in:
Augustin Cavalier
2015-03-05 13:47:43 -05:00
parent d6a5544233
commit 582c9ee678
2 changed files with 14 additions and 38 deletions

View File

@@ -36,17 +36,12 @@
#include <string>
#include <cassert>
#ifdef LMMS_BUILD_WIN32
#if defined(LMMS_HAVE_SYS_IPC_H) && defined(LMMS_HAVE_SEMAPHORE_H)
#include <sys/ipc.h>
#include <semaphore.h>
#else
#define USE_QT_SEMAPHORES
#define USE_QT_SHMEM
#endif
#ifdef LMMS_BUILD_APPLE
#define USE_QT_SEMAPHORES
#endif
#ifdef USE_QT_SEMAPHORES
#ifdef LMMS_HAVE_PROCESS_H
#include <process.h>
@@ -54,39 +49,25 @@
#include <QtCore/QtGlobal>
#include <QtCore/QSystemSemaphore>
#else /* USE_QT_SEMAPHORES */
#ifdef LMMS_HAVE_SYS_IPC_H
#include <sys/ipc.h>
#endif
#ifdef LMMS_HAVE_SEMAPHORE_H
#include <semaphore.h>
#endif
#endif
#ifdef USE_QT_SHMEM
#include <QtCore/QtGlobal>
#include <QtCore/QSharedMemory>
typedef int32_t key_t;
#else /* USE_QT_SHMEM */
#ifdef LMMS_HAVE_SYS_SHM_H
#include <sys/shm.h>
#endif
#ifdef LMMS_HAVE_UNISTD_H
#include <unistd.h>
#endif
#else
#define USE_QT_SHMEM
#include <QtCore/QtGlobal>
#include <QtCore/QSharedMemory>
#if !defined(LMMS_HAVE_SYS_TYPES_H) || defined(LMMS_BUILD_WIN32)
typedef int32_t key_t;
#endif
#endif
#ifdef LMMS_HAVE_LOCALE_H

View File

@@ -30,12 +30,7 @@
#include "lmmsconfig.h"
#include "Mixer.h"
#include "VstSyncController.h"
#ifdef LMMS_BUILD_WIN32
#ifndef USE_QT_SHMEM
#define USE_QT_SHMEM
#endif
#endif
#include "RemotePlugin.h"
#ifndef USE_QT_SHMEM
#include <stdio.h>