aboutsummaryrefslogtreecommitdiffstats
path: root/host/lib/utils/load_modules.cpp
diff options
context:
space:
mode:
authorJosh Blum <josh@joshknows.com>2011-02-21 19:03:13 -0800
committerJosh Blum <josh@joshknows.com>2011-02-21 19:03:13 -0800
commita8bb5ec900d8f2d3d2f274a921d19b564c668323 (patch)
treea3f87f539a8ff641cd6580c0ea28d38adcd0b057 /host/lib/utils/load_modules.cpp
parenta7f9529f77700309dbaaa6250f6bd775bab7a70d (diff)
downloaduhd-a8bb5ec900d8f2d3d2f274a921d19b564c668323.tar.gz
uhd-a8bb5ec900d8f2d3d2f274a921d19b564c668323.tar.bz2
uhd-a8bb5ec900d8f2d3d2f274a921d19b564c668323.zip
uhd: replace header checks in cmake files with more robust compile checks for features
implemented different ifdefs in the cpp files
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