From e49f2a9d6c8649d5114adb3bdb3088394f677040 Mon Sep 17 00:00:00 2001 From: jiri Date: Wed, 17 Dec 2008 15:34:25 +0000 Subject: [PATCH] *** empty log message *** --- laerror.cc | 8 ++------ laerror.h | 11 ++++++++++- 2 files changed, 12 insertions(+), 7 deletions(-) diff --git a/laerror.cc b/laerror.cc index c61d74b..5d3e0b7 100644 --- a/laerror.cc +++ b/laerror.cc @@ -30,6 +30,7 @@ #include "traceback.h" #endif + void laerror(const char *s1) { std::cerr << "LA:ERROR - "; @@ -41,12 +42,7 @@ void laerror(const char *s1) } if(errno) perror("system error"); -#ifdef USE_TRACEBACK - traceback(1); - exit(1); -#else - throw LAerror(s1); //traceback possible via sigtraceback, but BFD library might fail for -O3 code on some machines and source lines would not be available -#endif +throw LAerror(s1); } //stub for f77 blas called from strassen routine diff --git a/laerror.h b/laerror.h index de9a2fa..208f2c1 100644 --- a/laerror.h +++ b/laerror.h @@ -18,14 +18,23 @@ #ifndef _LAERROR_H_ #define _LAERROR_H_ +#include + //exception class for laerror class LAerror { - const char *msg; public: + const char *msg; LAerror(const char *s) {msg=s;}; }; extern void laerror(const char *); +inline std::ostream & operator<<(std::ostream &s, const LAerror &x) +{ +s << x.msg; +return s; +} + + #endif