S , 2011-10-08 21:13 +0100, Chris Morley rakstīja: > On 08/10/2011 20:02, My Th wrote: > > I have no idea how Windows dll loading works, but the code I touched > > should be above the platform specific bits. I used the same semantics as > > the old code had, only moved it to a place trough which goes all code > > paths of the library which touch plugins. > > > > It might be that the changes could be implemented in other place which > > would shrink the patch size, but I don't know the OB code that well, so > > I went for the most straightforward solution. > > Could a single line > static int n = LoadAllPlugins(); > in the function OBPlugin::PluginMap() replace all the other calls? > The local static variable n would be initialized once on first use, but > not subsequently used. > > I'm impressed that you took the trouble to understand the OBPlugin code. > In the hybrid systems Cygwin and Mingw32 the plugins were originally not > being loaded. Tim Vandermeersch made some changes which fixed this, but > it would be helpful, if you are interested, in explaining how they work. > (The OBPlugin code is a bit obscure; I can understand why macros are > considered evil, http://www.parashift.com/c++-faq-lite )
It could, but it leads to very bad errors later (if I remember correctly, there was an error in src/ops/loader.cpp which I couldn't figure out). That is the reason why I put those calls just before OBPlugin::PluginMap() is called. It might be that I made some mistake then, but I would need to look into that again. Yes, macros are evil :) And I actually avoided completely understanding how they work by putting those calls before those macros come into a play. That's why it was the most straightforward solution. If that code is understood completely, then there might be a better solution. Then probably also the semantics of the code would change a bit. Reinis ------------------------------------------------------------------------------ All of the data generated in your IT infrastructure is seriously valuable. Why? It contains a definitive record of application performance, security threats, fraudulent activity, and more. Splunk takes this data and makes sense of it. IT sense. And common sense. http://p.sf.net/sfu/splunk-d2dcopy2 _______________________________________________ OpenBabel-Devel mailing list OpenBabel-Devel@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/openbabel-devel