aboutsummaryrefslogtreecommitdiff
path: root/frontend/main.c
diff options
context:
space:
mode:
authornotaz2015-01-03 02:22:14 +0200
committernotaz2015-01-03 02:25:30 +0200
commit003cfc63c69b3e900de768317354dfb80bbf6a55 (patch)
treeaf0c284d996d5969731337244b18b55facea5e08 /frontend/main.c
parent3aba41853f8dc014ff61e05e8a2c616d89f88715 (diff)
downloadpcsx_rearmed-003cfc63c69b3e900de768317354dfb80bbf6a55.tar.gz
pcsx_rearmed-003cfc63c69b3e900de768317354dfb80bbf6a55.tar.bz2
pcsx_rearmed-003cfc63c69b3e900de768317354dfb80bbf6a55.zip
mingw build fixes
Diffstat (limited to 'frontend/main.c')
-rw-r--r--frontend/main.c31
1 files changed, 25 insertions, 6 deletions
diff --git a/frontend/main.c b/frontend/main.c
index 426ef13..bdea1b5 100644
--- a/frontend/main.c
+++ b/frontend/main.c
@@ -8,12 +8,12 @@
#include <stdio.h>
#include <string.h>
#include <stdarg.h>
-#include <dlfcn.h>
-#include <sys/stat.h>
-#include <sys/types.h>
#include <unistd.h>
#include <signal.h>
#include <time.h>
+#ifndef _WIN32
+#include <dlfcn.h>
+#endif
#include "main.h"
#include "plugin.h"
@@ -141,7 +141,7 @@ void emu_set_default_config(void)
spu_config.iXAPitch = 0;
spu_config.iVolume = 768;
spu_config.iTempo = 0;
-#if defined(__arm__) && !defined(__ARM_ARCH_7A__) /* XXX */
+#if defined(__arm__) && !defined(__ARM_ARCH_7A__) /* XXX GPH hack */
spu_config.iUseReverb = 0;
spu_config.iUseInterpolation = 0;
spu_config.iTempo = 1;
@@ -452,6 +452,10 @@ void emu_core_ask_exit(void)
}
#ifndef NO_FRONTEND
+
+#include <sys/stat.h>
+#include <sys/types.h>
+
static void create_profile_dir(const char *directory) {
char path[MAXPATHLEN];
@@ -766,7 +770,7 @@ int emu_save_state(int slot)
return ret;
ret = SaveState(fname);
-#ifndef __ARM_ARCH_7A__ /* XXX */
+#if defined(__arm__) && !defined(__ARM_ARCH_7A__) /* XXX GPH hack */
sync();
#endif
SysPrintf("* %s \"%s\" [%d]\n",
@@ -968,7 +972,7 @@ static const int builtin_plugin_ids[] = {
void *SysLoadLibrary(const char *lib) {
const char *tmp = strrchr(lib, '/');
- void *ret;
+ void *ret = NULL;
int i;
SysPrintf("plugin: %s\n", lib);
@@ -980,9 +984,14 @@ void *SysLoadLibrary(const char *lib) {
return (void *)(long)(PLUGIN_DL_BASE + builtin_plugin_ids[i]);
}
+#ifndef _WIN32
ret = dlopen(lib, RTLD_NOW);
if (ret == NULL)
SysMessage("dlopen: %s", dlerror());
+#else
+ /* no external plugin support, abi is no longer
+ * compatible with psemu/pcsx anyway */
+#endif
return ret;
}
@@ -992,11 +1001,19 @@ void *SysLoadSym(void *lib, const char *sym) {
if (PLUGIN_DL_BASE <= plugid && plugid < PLUGIN_DL_BASE + ARRAY_SIZE(builtin_plugins))
return plugin_link(plugid - PLUGIN_DL_BASE, sym);
+#ifndef _WIN32
return dlsym(lib, sym);
+#else
+ return NULL;
+#endif
}
const char *SysLibError() {
+#ifndef _WIN32
return dlerror();
+#else
+ return "not supported";
+#endif
}
void SysCloseLibrary(void *lib) {
@@ -1005,6 +1022,8 @@ void SysCloseLibrary(void *lib) {
if (PLUGIN_DL_BASE <= plugid && plugid < PLUGIN_DL_BASE + ARRAY_SIZE(builtin_plugins))
return;
+#ifndef _WIN32
dlclose(lib);
+#endif
}