diff --git a/Makefile.wii b/Makefile.wii index ab46345..c97b520 100644 --- a/Makefile.wii +++ b/Makefile.wii @@ -26,7 +26,8 @@ SRCS := $(wildcard $(SRC_DIR)/*.c $(SRC_DIR)/gfxdep/*.c $(SRC_DIR)/joydep/*.c $( SRCS := $(filter-out src/compemu_raw_x86.c src/compemu_fpp.c src/compemu_support.c src/svgancui.c src/build68k.c src/catweasel.c \ src/cdrom.c src/blkdev-libscg.c src/blkdev.c src/blitops.c src/akiko.c src/filesys_bootrom.c \ - src/genblitter.c src/gencomp.c src/gencpu.c src/genlinetoscr.c src/compemu.c src/compstbl.c \ + src/filesys.c src/fsdb.c src/fsdb_unix.c src/hardfile_unix.c src/genblitter.c src/gencomp.c src/gencpu.c \ + src/hardfile.c src/genlinetoscr.c src/compemu.c src/compstbl.c \ src/readdisk.c src/gengenblitter.c src/scsiemul.c src/tui.c src/linetoscr.c, $(SRCS)) # Library object files. @@ -76,7 +77,7 @@ COMMON_FLAGS := -g -O2 -mrvl -Wall $(MACHDEP) INCLUDES := -Isrc/md-generic/ -Isrc/include -Isrc -I$(DEVKITPRO)/libogc/include -I$(DEVKITPRO)/libogc/include/SDL DEFINES := -DGEKKO -DFPUEMU -DCPUEMU_0 -DCPUEMU_5 -DCPUEMU_6 -DAGA \ -DAUTOCONFIG -DFILESYS -DSUPPORT_THREADS -DUSE_SDL -DFDI2RAW -DDEBUGGER -DSAVESTATE \ - -DENFORCER -DACTION_REPLAY + -DENFORCER -DACTION_REPLAY -UFILESYS CFLAGS := $(COMMON_FLAGS) $(INCLUDES) $(DEFINES) # Test link flags. diff --git a/src/filesys.c b/src/filesys.c index da9dacf..917d1f1 100644 --- a/src/filesys.c +++ b/src/filesys.c @@ -59,6 +59,20 @@ #define DUMPLOCK(u,x) #endif +#if defined(GEKKOb) +#define R_OK 1 +static int wii_access (const char *pathname, int mode) +{ + struct stat st; + + if (stat(pathname, &st) < 0) + return -1; + if (mode == R_OK && !S_ISDIR(st)) + return 0; + return -1; +} +#define access wii_access +#endif static void aino_test (a_inode *aino) { diff --git a/src/fsdb_unix.c b/src/fsdb_unix.c index c56b719..48da1fd 100644 --- a/src/fsdb_unix.c +++ b/src/fsdb_unix.c @@ -135,10 +135,19 @@ char *fsdb_create_unique_nname (a_inode *base, const char *suggestion) for (;;) { int i; char *p = build_nname (base->nname, tmp); +#if !defined(GEKKOb) if (access (p, R_OK) < 0 && errno == ENOENT) { printf ("unique name: %s\n", p); return p; } +#else + struct stat st; + + if (stat(p, &st) < 0) { + printf ("unique name: %s\n", p); + return p; + } +#endif free (p); /* tmpnam isn't reentrant and I don't really want to hack configure diff --git a/src/main.c b/src/main.c index 559e879..50697ac 100644 --- a/src/main.c +++ b/src/main.c @@ -795,7 +795,9 @@ void real_main (int argc, char **argv) { show_version (); +#if defined(FILESYS) currprefs.mountinfo = changed_prefs.mountinfo = &options_mountinfo; +#endif restart_program = 1; #ifdef _WIN32 sprintf (restart_config, "%sConfigurations\\", start_path); diff --git a/src/od-generic/main.c b/src/od-generic/main.c index c2e5841..99ea6af 100644 --- a/src/od-generic/main.c +++ b/src/od-generic/main.c @@ -35,7 +35,7 @@ static RETSIGTYPE sigbrkhandler (int foo) void setup_brkhandler (void) { -#if defined(__unix) && !defined(__NeXT__) +#if defined(__unix) && !defined(__NeXT__) && !defined(GEKKO) struct sigaction sa; sa.sa_handler = sigbrkhandler; sa.sa_flags = 0;