aboutsummaryrefslogtreecommitdiffstats
path: root/host/lib/utils/load_modules.cpp
diff options
context:
space:
mode:
authorJosh Blum <josh@joshknows.com>2011-02-22 12:11:41 -0800
committerJosh Blum <josh@joshknows.com>2011-02-22 12:11:41 -0800
commit8ce6a4853e9e0ef3e18bc30ea00b27ec3a069652 (patch)
tree8b3630a57a9366c414a672a73e47091797dff566 /host/lib/utils/load_modules.cpp
parent3261b89eeb96a6b87bc35c86be3faf78aee569b0 (diff)
parent9eb19bd9a006c47060b9d0913d2f9d4a49751275 (diff)
downloaduhd-8ce6a4853e9e0ef3e18bc30ea00b27ec3a069652.tar.gz
uhd-8ce6a4853e9e0ef3e18bc30ea00b27ec3a069652.tar.bz2
uhd-8ce6a4853e9e0ef3e18bc30ea00b27ec3a069652.zip
Merge branch 'usrp2_fw_clock_cleanup' into usrp2_dual_dsp
Diffstat (limited to 'host/lib/utils/load_modules.cpp')
-rw-r--r--host/lib/utils/load_modules.cpp14
1 files changed, 7 insertions, 7 deletions
diff --git a/host/lib/utils/load_modules.cpp b/host/lib/utils/load_modules.cpp
index 623d31eb6..fa9b22438 100644
--- a/host/lib/utils/load_modules.cpp
+++ b/host/lib/utils/load_modules.cpp
@@ -29,9 +29,8 @@ namespace fs = boost::filesystem;
/***********************************************************************
* Module Load Function
**********************************************************************/
-#if defined(HAVE_DLFCN_H)
+#ifdef HAVE_DLOPEN
#include <dlfcn.h>
-
static void load_module(const std::string &file_name){
if (dlopen(file_name.c_str(), RTLD_LAZY) == NULL){
throw std::runtime_error(str(
@@ -39,10 +38,11 @@ static void load_module(const std::string &file_name){
));
}
}
+#endif /* HAVE_DLOPEN */
-#elif defined(HAVE_WINDOWS_H)
-#include <windows.h>
+#ifdef HAVE_LOAD_LIBRARY
+#include <windows.h>
static void load_module(const std::string &file_name){
if (LoadLibrary(file_name.c_str()) == NULL){
throw std::runtime_error(str(
@@ -50,16 +50,16 @@ static void load_module(const std::string &file_name){
));
}
}
+#endif /* HAVE_LOAD_LIBRARY */
-#else
+#ifdef HAVE_LOAD_MODULES_DUMMY
static void load_module(const std::string &file_name){
throw std::runtime_error(str(
boost::format("Module loading not supported: Cannot load \"%s\"") % file_name
));
}
-
-#endif
+#endif /* HAVE_LOAD_MODULES_DUMMY */
/***********************************************************************
* Load Modules