"vscode:/vscode.git/clone" did not exist on "211e63c763fdee55071f83f08dd36cbc07c9f285"
Commit 535710ec authored by Peter Eastman's avatar Peter Eastman
Browse files

Fixed a compilation error under Windows

parent 832b8a42
......@@ -229,11 +229,6 @@ private:
std::map<std::string, KernelFactory*> kernelFactories;
std::map<std::string, std::string> defaultProperties;
static std::vector<Platform*>& getPlatforms();
#ifdef WIN32
static std::vector<HMODULE>& getPlugins();
#else
static std::vector<void*>& getPlugins();
#endif
};
} // namespace OpenMM
......
......@@ -114,6 +114,18 @@ Kernel Platform::createKernel(const string& name, ContextImpl& context) const {
return Kernel(kernelFactories.find(name)->second->createKernelImpl(name, *this, context));
}
#ifdef WIN32
static vector<HMODULE>& getPlugins() {
static vector<HMODULE> plugins;
return plugins;
}
#else
static vector<void*>& getPlugins() {
static vector<void*> plugins;
return plugins;
}
#endif
vector<Platform*>& Platform::getPlatforms() {
if (getPlugins().size() > 0) {
// Initialize plugins before returning the list of platforms.
......@@ -154,18 +166,6 @@ vector<Platform*>& Platform::getPlatforms() {
return platforms;
}
#ifdef WIN32
vector<HMODULE>& Platform::getPlugins() {
static vector<HMODULE> plugins;
return plugins;
}
#else
vector<void*>& Platform::getPlugins() {
static vector<void*> plugins;
return plugins;
}
#endif
void Platform::registerPlatform(Platform* platform) {
getPlatforms().push_back(platform);
}
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment