GNU Radio 3.6.5 C++ API

gr_uhd_common.h

Go to the documentation of this file.
00001 /*
00002  * Copyright 2012 Free Software Foundation, Inc.
00003  *
00004  * This file is part of GNU Radio
00005  *
00006  * GNU Radio is free software; you can redistribute it and/or modify
00007  * it under the terms of the GNU General Public License as published by
00008  * the Free Software Foundation; either version 3, or (at your option)
00009  * any later version.
00010  *
00011  * GNU Radio is distributed in the hope that it will be useful,
00012  * but WITHOUT ANY WARRANTY; without even the implied warranty of
00013  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
00014  * GNU General Public License for more details.
00015  *
00016  * You should have received a copy of the GNU General Public License
00017  * along with GNU Radio; see the file COPYING.  If not, write to
00018  * the Free Software Foundation, Inc., 51 Franklin Street,
00019  * Boston, MA 02110-1301, USA.
00020  */
00021 
00022 #ifndef INCLUDED_GR_UHD_COMMON_H
00023 #define INCLUDED_GR_UHD_COMMON_H
00024 
00025 #include <uhd/version.hpp>
00026 #include <boost/format.hpp>
00027 #include <stdexcept>
00028 
00029 static inline void gr_uhd_check_abi(void){
00030     #ifdef UHD_VERSION_ABI_STRING
00031     if (std::string(UHD_VERSION_ABI_STRING) == uhd::get_abi_string()) return;
00032     throw std::runtime_error(str(boost::format(
00033         "\nGR-UHD detected ABI compatibility mismatch with UHD library.\n"
00034         "GR-UHD was build against ABI: %s,\n"
00035         "but UHD library reports ABI: %s\n"
00036         "Suggestion: install an ABI compatible version of UHD,\n"
00037         "or rebuild GR-UHD component against this ABI version.\n"
00038     ) % UHD_VERSION_ABI_STRING % uhd::get_abi_string()));
00039     #endif
00040 }
00041 
00042 #endif /* INCLUDED_GR_UHD_COMMON_H */