Use XPLM native path on MacOS

This commit is contained in:
Roland Winklmeier
2018-02-22 16:32:25 +01:00
committed by Klaus Basan
parent 4db0b83310
commit e64e7feb28
2 changed files with 9 additions and 1 deletions

View File

@@ -36,6 +36,11 @@ XSwiftBus::CPlugin *g_plugin;
PLUGIN_API int XPluginStart(char *o_name, char *o_sig, char *o_desc)
{
#if APL
// https://developer.x-plane.com/2014/12/mac-plugin-developers-you-should-be-using-native-paths/
XPLMEnableFeature("XPLM_USE_NATIVE_PATHS",1);
#endif
std::strcpy(o_name, "XSwiftBus");
std::strcpy(o_sig, "org.swift-project.xswiftbus");
std::strcpy(o_desc, "Allows swift to connect to X-Plane via D-Bus IPC");

View File

@@ -32,7 +32,10 @@ namespace XSwiftBus
char xplanePath[512];
XPLMGetSystemPath(xplanePath);
#ifdef Q_OS_MAC
HFS2PosixPath(xplanePath, xplanePath, sizeof(xplanePath));
if (XPLMIsFeatureEnabled("XPLM_USE_NATIVE_PATHS") == 0)
{
HFS2PosixPath(xplanePath, xplanePath, sizeof(xplanePath));
}
g_sep = "/";
#else
g_sep = XPLMGetDirectorySeparator();