mirror of
https://github.com/libretro/RetroArch
synced 2025-03-01 16:13:40 +00:00
Also relying on $TMPDIR is problematic because Discord uses NSTemporaryDirectory() which may not be the same.
This commit is contained in:
parent
b59cd4fcd8
commit
a60249ff87
10
deps/discord-rpc/src/connection_unix.cpp
vendored
10
deps/discord-rpc/src/connection_unix.cpp
vendored
@ -9,6 +9,10 @@
|
||||
#include <sys/un.h>
|
||||
#include <unistd.h>
|
||||
|
||||
#if defined(OSX)
|
||||
extern "C" void CFTemporaryDirectory(char *s, size_t len);
|
||||
#endif
|
||||
|
||||
struct BaseConnectionUnix : public BaseConnection {
|
||||
int sock{-1};
|
||||
};
|
||||
@ -23,12 +27,18 @@ static int MsgFlags = 0;
|
||||
|
||||
static const char* GetTempPath(void)
|
||||
{
|
||||
#if defined(OSX)
|
||||
static char temp[1024];
|
||||
CFTemporaryDirectory(temp, 1024);
|
||||
return temp;
|
||||
#else
|
||||
const char* temp = getenv("XDG_RUNTIME_DIR");
|
||||
temp = temp ? temp : getenv("TMPDIR");
|
||||
temp = temp ? temp : getenv("TMP");
|
||||
temp = temp ? temp : getenv("TEMP");
|
||||
temp = temp ? temp : "/tmp";
|
||||
return temp;
|
||||
#endif
|
||||
}
|
||||
|
||||
/*static*/ BaseConnection* BaseConnection::Create()
|
||||
|
@ -139,7 +139,7 @@ static void CFSearchPathForDirectoriesInDomains(
|
||||
CFStringGetCString(array_val, s, len, kCFStringEncodingUTF8);
|
||||
}
|
||||
|
||||
static void CFTemporaryDirectory(char *s, size_t len)
|
||||
void CFTemporaryDirectory(char *s, size_t len)
|
||||
{
|
||||
#if __has_feature(objc_arc)
|
||||
CFStringRef path = (__bridge CFStringRef)NSTemporaryDirectory();
|
||||
|
@ -1692,5 +1692,8 @@ STEAM INTEGRATION USING MIST
|
||||
#ifdef HAVE_MIST
|
||||
#include "../steam/steam.c"
|
||||
#include "../tasks/task_steam.c"
|
||||
#endif
|
||||
|
||||
#ifdef HAVE_PRESENCE
|
||||
#include "../network/presence.c"
|
||||
#endif
|
||||
|
@ -57,6 +57,7 @@ OTHER_CFLAGS = $(inherited) -DHAVE_OPENGL_CORE
|
||||
OTHER_CFLAGS = $(inherited) -DHAVE_OVERLAY
|
||||
OTHER_CFLAGS = $(inherited) -DHAVE_OZONE
|
||||
OTHER_CFLAGS = $(inherited) -DHAVE_PATCH
|
||||
OTHER_CFLAGS = $(inherited) -DHAVE_PRESENCE
|
||||
OTHER_CFLAGS = $(inherited) -DHAVE_RBMP
|
||||
OTHER_CFLAGS = $(inherited) -DHAVE_REWIND
|
||||
OTHER_CFLAGS = $(inherited) -DHAVE_RGUI
|
||||
|
Loading…
x
Reference in New Issue
Block a user