From 7b93bda2932da0cd14da0e08e2b5a34ce03d99cb Mon Sep 17 00:00:00 2001 From: Andrei Karas Date: Sat, 29 Dec 2012 15:36:38 +0300 Subject: Add workaround fix for broken macports libs. Probably broken physfs. --- src/utils/physfsrwops.cpp | 12 ++++++++++++ 1 file changed, 12 insertions(+) (limited to 'src/utils/physfsrwops.cpp') diff --git a/src/utils/physfsrwops.cpp b/src/utils/physfsrwops.cpp index e755ea353..67376d3dc 100644 --- a/src/utils/physfsrwops.cpp +++ b/src/utils/physfsrwops.cpp @@ -179,6 +179,10 @@ SDL_RWops *PHYSFSRWOPS_openRead(const char *fname) { if (!fname || !*fname) return nullptr; +#ifdef __APPLE__ + if (!PHYSFS_exists(fname)) + return nullptr; +#endif return create_rwops(PHYSFS_openRead(fname)); } /* PHYSFSRWOPS_openRead */ @@ -186,6 +190,10 @@ SDL_RWops *PHYSFSRWOPS_openWrite(const char *fname) { if (!fname || !*fname) return nullptr; +#ifdef __APPLE__ + if (!PHYSFS_exists(fname)) + return nullptr; +#endif return create_rwops(PHYSFS_openWrite(fname)); } /* PHYSFSRWOPS_openWrite */ @@ -193,6 +201,10 @@ SDL_RWops *PHYSFSRWOPS_openAppend(const char *fname) { if (!fname || !*fname) return nullptr; +#ifdef __APPLE__ + if (!PHYSFS_exists(fname)) + return nullptr; +#endif return create_rwops(PHYSFS_openAppend(fname)); } /* PHYSFSRWOPS_openAppend */ -- cgit v1.2.3-70-g09d2