From 466f1af9eb0e745fe26851cb0b381e4b533a420c Mon Sep 17 00:00:00 2001 From: "Stephen D. Huston" Date: Wed, 21 Oct 2009 01:36:16 +0000 Subject: Add ability to load modules from something other than a .so file; allows loading .dll files on Windows, for example. The proper suffix is gleaned from cmake; if on autoconf assume .so. git-svn-id: https://svn.apache.org/repos/asf/qpid/trunk/qpid@827865 13f79535-47bb-0310-9956-ffa450edef68 --- cpp/src/qpid/Modules.cpp | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) (limited to 'cpp/src/qpid/Modules.cpp') diff --git a/cpp/src/qpid/Modules.cpp b/cpp/src/qpid/Modules.cpp index 78afbb23ad..7230630818 100644 --- a/cpp/src/qpid/Modules.cpp +++ b/cpp/src/qpid/Modules.cpp @@ -19,6 +19,7 @@ * */ +#include "config.h" #include "qpid/Modules.h" #include "qpid/Exception.h" #include "qpid/log/Statement.h" @@ -67,10 +68,17 @@ void loadModuleDir (std::string dirname, bool isDefault) } fs::directory_iterator endItr; + // CMake sets QPID_MODULE_SUFFIX; Autoconf doesn't, so assume Linux .so +#if defined (QPID_MODULE_SUFFIX) + std::string suffix(QPID_MODULE_SUFFIX); +#else + std::string suffix(".so"); +#endif for (fs::directory_iterator itr (dirPath); itr != endItr; ++itr) { if (!fs::is_directory(*itr) && - itr->string().find (".so") == itr->string().length() - 3) + itr->string().find (suffix) == + itr->string().length() - suffix.length()) tryShlib (itr->string().data(), true); } } -- cgit v1.2.1