summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--plugins/example/main.cpp18
1 files changed, 17 insertions, 1 deletions
diff --git a/plugins/example/main.cpp b/plugins/example/main.cpp
index 8c51548..9df4c81 100644
--- a/plugins/example/main.cpp
+++ b/plugins/example/main.cpp
@@ -39,19 +39,31 @@ PLUGININFO pluginInfo =
0x00010101 //version 0.1.1.1
};
+#ifdef _WIN32
+extern "C" __declspec(dllexport) PLUGININFO* set_plugin_info()
+#else
extern "C" PLUGININFO* set_plugin_info()
+#endif
{
return &pluginInfo; //necessary, our plugin info for core can recognize us
}
-extern "C" int load(PLUGINLINK *link) //basic initialisation, registering new functions, do other basic initialisation, you can create infinite loop, or other code which use many time here, only fast basic initialisation
+#ifdef _WIN32
+extern "C" __declspec(dllexport) int load(PLUGINLINK *link) //basic initialisation, registering new functions, do other basic initialisation, you can create infinite loop, or other code which use many time here, only fast basic initialisation
+#else
+extern "C" int load(PLUGINLINK *link)
+#endif
{
pluginLink = link; //necessary
//some basic initialisation code
return 0; //all ok, retrun 0
}
+#ifdef _WIN32
+extern "C" __declspec(dllexport) int on_modules_loaded() //load main code from here, all services from other plugins must be avaible here
+#else
extern "C" int on_modules_loaded() //load main code from here, all services from other plugins must be avaible here
+#endif
{
wxApp::SetInstance(new wxPluginForEvilCore()); //create instance, i think here is right place, not in load where we do only basic initialisation
#ifdef _WIN32
@@ -68,7 +80,11 @@ extern "C" int on_modules_loaded() //load main code from here, all services from
return 0;
}
+#ifdef _win32
+extern "C" __declspec(dllexport) int unload()
+#else
extern "C" int unload()
+#endif
{
//do some cleanup on exit
wxEntryCleanup(); //call it before, or after other cleanup