mirror of
https://github.com/coop-deluxe/sm64coopdx.git
synced 2025-10-30 08:01:01 +00:00
Maybe fix mac
This commit is contained in:
parent
2bcf5ea851
commit
cea41c95e0
1 changed files with 10 additions and 0 deletions
|
|
@ -11,6 +11,10 @@
|
||||||
#include <unistd.h>
|
#include <unistd.h>
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
#ifdef OSX_BUILD
|
||||||
|
#include <mach-o/dyld.h>
|
||||||
|
#endif
|
||||||
|
|
||||||
void mods_size_enforce(struct Mods* mods) {
|
void mods_size_enforce(struct Mods* mods) {
|
||||||
for (int i = 0; i < mods->entryCount; i++) {
|
for (int i = 0; i < mods->entryCount; i++) {
|
||||||
struct Mod* mod = mods->entries[i];
|
struct Mod* mod = mods->entries[i];
|
||||||
|
|
@ -174,6 +178,12 @@ const char* path_to_executable(void) {
|
||||||
return NULL;
|
return NULL;
|
||||||
}
|
}
|
||||||
GetModuleFileName(hModule, exePath, SYS_MAX_PATH-1);
|
GetModuleFileName(hModule, exePath, SYS_MAX_PATH-1);
|
||||||
|
#elif defined(OSX_BUILD)
|
||||||
|
u32 bufsize = SYS_MAX_PATH-1;
|
||||||
|
if (!_NSGetExecutablePath(exePath, &bufsize)) {
|
||||||
|
LOG_ERROR("unable to retrieve absolute exe path!");
|
||||||
|
return NULL;
|
||||||
|
}
|
||||||
#else
|
#else
|
||||||
char procPath[SYS_MAX_PATH] = { 0 };
|
char procPath[SYS_MAX_PATH] = { 0 };
|
||||||
snprintf(procPath, SYS_MAX_PATH-1, "/proc/%d/exe", getpid());
|
snprintf(procPath, SYS_MAX_PATH-1, "/proc/%d/exe", getpid());
|
||||||
|
|
|
||||||
Loading…
Add table
Reference in a new issue