mirror of
https://github.com/panda3d/panda3d.git
synced 2025-10-03 10:22:45 -04:00
Allow loading 64-bit Panda from 32-bit plug-in on Mac OS X
This commit is contained in:
parent
b7840fed06
commit
d337573504
@ -45,6 +45,10 @@
|
|||||||
#include <dirent.h>
|
#include <dirent.h>
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
#ifdef __APPLE__
|
||||||
|
#include <sys/sysctl.h>
|
||||||
|
#endif
|
||||||
|
|
||||||
#include <stdio.h>
|
#include <stdio.h>
|
||||||
|
|
||||||
static ofstream logfile;
|
static ofstream logfile;
|
||||||
@ -230,9 +234,29 @@ initialize(int api_version, const string &contents_filename,
|
|||||||
_supported_platforms.push_back("win_i386");
|
_supported_platforms.push_back("win_i386");
|
||||||
_supported_platforms.push_back("win32");
|
_supported_platforms.push_back("win32");
|
||||||
}
|
}
|
||||||
|
#elif defined(__APPLE__)
|
||||||
|
if (_platform == "osx_amd64") {
|
||||||
|
_supported_platforms.push_back("osx_amd64");
|
||||||
|
_supported_platforms.push_back("osx_i386");
|
||||||
|
|
||||||
|
} else if (_platform == "osx_i386") {
|
||||||
|
// This is a 32-bit process, but determine if the underlying OS
|
||||||
|
// supports 64-bit.
|
||||||
|
|
||||||
|
int mib[2] = { CTL_HW, HW_MACHINE };
|
||||||
|
char machine[512];
|
||||||
|
size_t len = 511;
|
||||||
|
if (sysctl(mib, 2, (void *)machine, &len, NULL, 0) == 0) {
|
||||||
|
if (strcmp(machine, "x86_64") == 0) {
|
||||||
|
_supported_platforms.push_back("osx_amd64");
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
_supported_platforms.push_back("osx_i386");
|
||||||
|
}
|
||||||
#endif // _WIN32
|
#endif // _WIN32
|
||||||
|
|
||||||
// TODO: OSX, Linux multiplatform support. Just add the
|
// TODO: Linux multiplatform support. Just add the
|
||||||
// appropriate platform strings to _supported_platforms.
|
// appropriate platform strings to _supported_platforms.
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user