diff options
author | Chris Dyer <cdyer@cs.cmu.edu> | 2010-12-13 16:18:34 -0500 |
---|---|---|
committer | Chris Dyer <cdyer@cs.cmu.edu> | 2010-12-13 16:18:34 -0500 |
commit | be98f29f51350c24136c191f01af3fbfe340ef78 (patch) | |
tree | 2e104152110ca76b527147458050a41934e031f2 /klm/util/exception.cc | |
parent | 063c0623aaf5dad8d02e5eae5793c123cd7fc3fe (diff) |
new version of kenlm
Diffstat (limited to 'klm/util/exception.cc')
-rw-r--r-- | klm/util/exception.cc | 5 |
1 files changed, 5 insertions, 0 deletions
diff --git a/klm/util/exception.cc b/klm/util/exception.cc index dd337a76..de6dd43c 100644 --- a/klm/util/exception.cc +++ b/klm/util/exception.cc @@ -24,7 +24,12 @@ const char *HandleStrerror(const char *ret, const char *buf) { ErrnoException::ErrnoException() throw() : errno_(errno) { char buf[200]; buf[0] = 0; +#ifdef sun + const char *add = strerror(errno); +#else const char *add = HandleStrerror(strerror_r(errno, buf, 200), buf); +#endif + if (add) { *this << add << ' '; } |