mirror of
https://github.com/RetroDECK/Duckstation.git
synced 2024-11-26 15:45:42 +00:00
commit
d0d5b79b61
|
@ -28,8 +28,10 @@
|
||||||
#ifdef _MSC_VER
|
#ifdef _MSC_VER
|
||||||
#include <malloc.h>
|
#include <malloc.h>
|
||||||
#else
|
#else
|
||||||
|
#if !defined(__FreeBSD__)
|
||||||
#include <alloca.h>
|
#include <alloca.h>
|
||||||
#endif
|
#endif
|
||||||
|
#endif
|
||||||
|
|
||||||
Log_SetChannel(ByteStream);
|
Log_SetChannel(ByteStream);
|
||||||
|
|
||||||
|
|
|
@ -64,7 +64,7 @@ static u64 getthreadtime(thread_port_t thread)
|
||||||
}
|
}
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#ifdef __linux__
|
#if defined(__linux__) || defined(__FreeBSD__)
|
||||||
// Helper function to get either either the current cpu usage
|
// Helper function to get either either the current cpu usage
|
||||||
// in called thread or in id thread
|
// in called thread or in id thread
|
||||||
static u64 get_thread_time(void* id = 0)
|
static u64 get_thread_time(void* id = 0)
|
||||||
|
@ -227,7 +227,7 @@ u64 Threading::ThreadHandle::GetCPUTime() const
|
||||||
return user.u64time + kernel.u64time;
|
return user.u64time + kernel.u64time;
|
||||||
#elif defined(__APPLE__)
|
#elif defined(__APPLE__)
|
||||||
return getthreadtime(pthread_mach_thread_np((pthread_t)m_native_handle));
|
return getthreadtime(pthread_mach_thread_np((pthread_t)m_native_handle));
|
||||||
#elif defined(__linux__)
|
#elif defined(__linux__) || defined(__FreeBSD__)
|
||||||
return get_thread_time(m_native_handle);
|
return get_thread_time(m_native_handle);
|
||||||
#else
|
#else
|
||||||
return 0;
|
return 0;
|
||||||
|
|
|
@ -185,7 +185,7 @@ void NoGUIHost::SetDataDirectory()
|
||||||
EmuFolders::DataRoot = Path::Combine(StringUtil::WideStringToUTF8String(documents_directory), "DuckStation");
|
EmuFolders::DataRoot = Path::Combine(StringUtil::WideStringToUTF8String(documents_directory), "DuckStation");
|
||||||
CoTaskMemFree(documents_directory);
|
CoTaskMemFree(documents_directory);
|
||||||
}
|
}
|
||||||
#elif defined(__linux__)
|
#elif defined(__linux__) || defined(__FreeBSD__)
|
||||||
// Use $XDG_CONFIG_HOME/duckstation if it exists.
|
// Use $XDG_CONFIG_HOME/duckstation if it exists.
|
||||||
const char* xdg_config_home = getenv("XDG_CONFIG_HOME");
|
const char* xdg_config_home = getenv("XDG_CONFIG_HOME");
|
||||||
if (xdg_config_home && Path::IsAbsolute(xdg_config_home))
|
if (xdg_config_home && Path::IsAbsolute(xdg_config_home))
|
||||||
|
|
|
@ -290,7 +290,7 @@ void QtHost::SetDataDirectory()
|
||||||
EmuFolders::DataRoot = Path::Combine(StringUtil::WideStringToUTF8String(documents_directory), "DuckStation");
|
EmuFolders::DataRoot = Path::Combine(StringUtil::WideStringToUTF8String(documents_directory), "DuckStation");
|
||||||
CoTaskMemFree(documents_directory);
|
CoTaskMemFree(documents_directory);
|
||||||
}
|
}
|
||||||
#elif defined(__linux__)
|
#elif defined(__linux__) || defined(__FreeBSD__)
|
||||||
// Use $XDG_CONFIG_HOME/duckstation if it exists.
|
// Use $XDG_CONFIG_HOME/duckstation if it exists.
|
||||||
const char* xdg_config_home = getenv("XDG_CONFIG_HOME");
|
const char* xdg_config_home = getenv("XDG_CONFIG_HOME");
|
||||||
if (xdg_config_home && Path::IsAbsolute(xdg_config_home))
|
if (xdg_config_home && Path::IsAbsolute(xdg_config_home))
|
||||||
|
|
Loading…
Reference in a new issue