ifndef DEBUG
CFLAGS += -O2 -DNDEBUG
endif
-CFLAGS += -DHAVE_MMAP=$(if $(NO_MMAP),0,1)
+CFLAGS += -DHAVE_MMAP=$(if $(NO_MMAP),0,1) \
+ -DHAVE_PTHREAD=$(if $(NO_PTHREAD),0,1)
CXXFLAGS += $(CFLAGS)
#DRC_DBG = 1
#PCNT = 1
spu_config.iUseThread = 0;
}
-#ifndef _WIN32
- var.value = NULL;
- var.key = "pcsx_rearmed_async_cd";
- if (environ_cb(RETRO_ENVIRONMENT_GET_VARIABLE, &var) && var.value)
- {
- if (strcmp(var.value, "async") == 0)
- {
- Config.AsyncCD = 1;
- Config.CHD_Precache = 0;
- }
- else if (strcmp(var.value, "sync") == 0)
- {
- Config.AsyncCD = 0;
- Config.CHD_Precache = 0;
- }
- else if (strcmp(var.value, "precache") == 0)
- {
- Config.AsyncCD = 0;
- Config.CHD_Precache = 1;
- }
+ if (HAVE_PTHREAD) {
+ var.value = NULL;
+ var.key = "pcsx_rearmed_async_cd";
+ if (environ_cb(RETRO_ENVIRONMENT_GET_VARIABLE, &var) && var.value)
+ {
+ if (strcmp(var.value, "async") == 0)
+ {
+ Config.AsyncCD = 1;
+ Config.CHD_Precache = 0;
+ }
+ else if (strcmp(var.value, "sync") == 0)
+ {
+ Config.AsyncCD = 0;
+ Config.CHD_Precache = 0;
+ }
+ else if (strcmp(var.value, "precache") == 0)
+ {
+ Config.AsyncCD = 0;
+ Config.CHD_Precache = 1;
+ }
+ }
}
-#endif
var.value = NULL;
var.key = "pcsx_rearmed_noxadecoding";
},
"enabled",
},
-#if !defined(THREAD_ENABLED) && !defined(_WIN32) && !defined(NO_OS)
+#if HAVE_PTHREAD
{
"pcsx_rearmed_spu_thread",
"Threaded SPU",
},
"disabled",
},
-#endif // THREAD_ENABLED
+#endif // HAVE_PTHREAD
{
"pcsx_rearmed_show_input_settings",
"Show Input Settings",
#include <process.h>
#include <windows.h>
#define strcasecmp _stricmp
-#define usleep(x) Sleep((x) / 1000)
-#else
+#elif HAVE_PTHREAD
#include <pthread.h>
#include <sys/time.h>
#include <unistd.h>
* *
***************************************************************************/
-#if !defined(THREAD_ENABLED) && !defined(_WIN32) && !defined(NO_OS)
-#define THREAD_ENABLED 1
-#endif
#include "stdafx.h"
#define _IN_SPU
// optional worker thread handling
-#if defined(THREAD_ENABLED) || defined(WANT_THREAD_CODE)
+#if HAVE_PTHREAD || defined(WANT_THREAD_CODE)
// worker thread state
static struct spu_worker {
static const void * const worker = NULL;
-#endif // THREAD_ENABLED
+#endif // HAVE_PTHREAD || defined(WANT_THREAD_CODE)
////////////////////////////////////////////////////////////////////////
// MAIN SPU FUNCTION
/* special code for TI C64x DSP */
#include "spu_c64x.c"
-#elif defined(THREAD_ENABLED)
+#elif HAVE_PTHREAD
#include <pthread.h>
#include <semaphore.h>
worker = NULL;
}
-#else // if !THREAD_ENABLED
+#else // if !HAVE_PTHREAD
static void init_spu_thread(void)
{