Patched new filesystem code to compile.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55
diff --git a/src/filesystem/cocoa/SDL_sysfilesystem.m b/src/filesystem/cocoa/SDL_sysfilesystem.m
index 3c45974..3cf8878 100644
--- a/src/filesystem/cocoa/SDL_sysfilesystem.m
+++ b/src/filesystem/cocoa/SDL_sysfilesystem.m
@@ -27,6 +27,7 @@
#include <Cocoa/Cocoa.h>
#include <sys/stat.h>
+#include <sys/types.h>
#include "SDL_error.h"
#include "SDL_stdinc.h"
diff --git a/src/filesystem/unix/SDL_sysfilesystem.c b/src/filesystem/unix/SDL_sysfilesystem.c
index 326637e..09db1e5 100644
--- a/src/filesystem/unix/SDL_sysfilesystem.c
+++ b/src/filesystem/unix/SDL_sysfilesystem.c
@@ -26,12 +26,15 @@
/* System dependent filesystem routines */
#include <unistd.h>
+#include <sys/stat.h>
+#include <sys/types.h>
#include "SDL_error.h"
#include "SDL_stdinc.h"
#include "SDL_filesystem.h"
-static char *readSymLink(const char *path)
+static char *
+readSymLink(const char *path)
{
char *retval = NULL;
ssize_t len = 64;
@@ -71,7 +74,7 @@ SDL_GetBasePath(void)
char *retval = NULL;
/* is a Linux-style /proc filesystem available? */
- if (access("/proc", F_OK) {
+ if (access("/proc", F_OK) == 0) {
retval = readSymLink("/proc/self/exe");
if (retval == NULL) {
/* older kernels don't have /proc/self ... try PID version... */
diff --git a/src/filesystem/windows/SDL_sysfilesystem.c b/src/filesystem/windows/SDL_sysfilesystem.c
index fc17d5e..e55be7e 100644
--- a/src/filesystem/windows/SDL_sysfilesystem.c
+++ b/src/filesystem/windows/SDL_sysfilesystem.c
@@ -26,7 +26,7 @@
/* System dependent filesystem routines */
#include "SDL_error.h"
-#include "SDL_windows.h"
+#include "../../core/windows/SDL_windows.h"
#include "SDL_stdinc.h"
#include "SDL_filesystem.h"