Skip to content

Instantly share code, notes, and snippets.

@julik
Created June 22, 2009 18:11
Show Gist options
  • Save julik/134103 to your computer and use it in GitHub Desktop.
Save julik/134103 to your computer and use it in GitHub Desktop.
const char *pluginSignature = "my.super.expensive.plugin";
#ifdef APL
// Mac-specific: it IS possible to have plugin installed twice, once in the ACF folder
// and once in the X-System folder. Probably due to namespace mangling on OS X
// the system will NOT crash the app when the plugin gets loaded twice.
// Thus, we query the enabled plugins for the defined signatures
// and DO NOT activate should the other plugin already be plugged in
XPLM_API XPLMPluginID other_copy_id = XPLMFindPluginBySignature(pluginSignature);
if(-1 != other_copy_id) {
// Figure out where the other plugin came from
char pathToAnotherCopy[256];
XPLMGetPluginInfo(other_copy_id, NULL, pathToAnotherCopy, NULL, NULL);
XPLMDebugString("another copy already loaded from \n");
XPLMDebugString(pathToAnotherCopy);
return 0;
}
#endif
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment