diff options
author | Nicholas Corgan <nick.corgan@ettus.com> | 2014-04-08 14:07:53 -0700 |
---|---|---|
committer | Nicholas Corgan <nick.corgan@ettus.com> | 2014-04-08 14:07:53 -0700 |
commit | 47bf17b50a305228cfd07ff6fbaff3ac4a30e811 (patch) | |
tree | c0a182133f4f88240659b529ea06428e0e2359c8 /host/lib | |
parent | 56f709cf98c7bcc00df11bc3166d8450249ec6f3 (diff) | |
parent | 0df60b7c92a84dcaf73cc22bcc488a8f3047f549 (diff) | |
download | uhd-47bf17b50a305228cfd07ff6fbaff3ac4a30e811.tar.gz uhd-47bf17b50a305228cfd07ff6fbaff3ac4a30e811.tar.bz2 uhd-47bf17b50a305228cfd07ff6fbaff3ac4a30e811.zip |
Merge branch 'maint'
Diffstat (limited to 'host/lib')
-rw-r--r-- | host/lib/transport/nirio/nifpga_lvbitx.cpp | 16 |
1 files changed, 16 insertions, 0 deletions
diff --git a/host/lib/transport/nirio/nifpga_lvbitx.cpp b/host/lib/transport/nirio/nifpga_lvbitx.cpp index 289a44d4a..b87d87a8d 100644 --- a/host/lib/transport/nirio/nifpga_lvbitx.cpp +++ b/host/lib/transport/nirio/nifpga_lvbitx.cpp @@ -16,6 +16,7 @@ // #include <uhd/transport/nirio/nifpga_lvbitx.h> +#include <cstdlib> #include <string> #include <iostream> #include <fstream> @@ -109,6 +110,21 @@ std::string nifpga_lvbitx::_get_fpga_images_dir(const std::string search_paths) std::vector<std::string> search_path_vtr; boost::split(search_path_vtr, search_paths, boost::is_any_of(",")); + // + // Add the value of the UHD_IMAGES_DIR environment variable to the list of + // directories searched for a LVBITX image. + // + char* uhd_images_dir; +#ifdef UHD_PLATFORM_WIN32 + size_t len; + errno_t err = _dupenv_s(&uhd_images_dir, &len, "UHD_IMAGES_DIR"); + if(not err and uhd_images_dir != NULL) search_path_vtr.push_back(std::string(uhd_images_dir)); + free(uhd_images_dir); +#else + uhd_images_dir = getenv("UHD_IMAGES_DIR"); + if(uhd_images_dir != NULL) search_path_vtr.push_back(std::string(uhd_images_dir)); +#endif + std::string lvbitx_dir; //Traverse through the list of search paths. Priority: lexical BOOST_FOREACH(std::string& search_path, search_path_vtr) { |