aboutsummaryrefslogtreecommitdiffstats
path: root/host/include/uhd/utils/safe_main.hpp
diff options
context:
space:
mode:
Diffstat (limited to 'host/include/uhd/utils/safe_main.hpp')
-rw-r--r--host/include/uhd/utils/safe_main.hpp25
1 files changed, 14 insertions, 11 deletions
diff --git a/host/include/uhd/utils/safe_main.hpp b/host/include/uhd/utils/safe_main.hpp
index 8261ad7d2..ca00a97dd 100644
--- a/host/include/uhd/utils/safe_main.hpp
+++ b/host/include/uhd/utils/safe_main.hpp
@@ -19,16 +19,19 @@
* \param _argc the declaration for argc
* \param _argv the declaration for argv
*/
-#define UHD_SAFE_MAIN(_argc, _argv) _main(int, char*[]); \
-int main(int argc, char *argv[]){ \
- try { \
- return _main(argc, argv); \
- } catch(const std::exception &e) { \
- std::cerr << "Error: " << e.what() << std::endl; \
- } catch(...) { \
- std::cerr << "Error: unknown exception" << std::endl; \
- } \
- return ~0; \
-} int _main(_argc, _argv)
+#define UHD_SAFE_MAIN(_argc, _argv) \
+ _main(int, char* []); \
+ int main(int argc, char* argv[]) \
+ { \
+ try { \
+ return _main(argc, argv); \
+ } catch (const std::exception& e) { \
+ std::cerr << "Error: " << e.what() << std::endl; \
+ } catch (...) { \
+ std::cerr << "Error: unknown exception" << std::endl; \
+ } \
+ return ~0; \
+ } \
+ int _main(_argc, _argv)
#endif /* INCLUDED_UHD_UTILS_SAFE_MAIN_HPP */