[llvm-commits] Adding a portable strerror*() wrapper, llvm::sys::StrError()
Chris Lattner
clattner at apple.com
Tue Jun 30 21:30:12 PDT 2009
On Jun 29, 2009, at 10:52 AM, Jeffrey Yasskin wrote:
> My oprofile patch calls some functions that report errors through
> errno, and since strerror_r changes its behavior depending on
> GNU_SOURCE and other #defines, I figured it would be nice to have a
> portable wrapper in llvm/System/Errno.h. I included the windows
> version, strerror_s, even though I can't test it.
>
> This won't do quite the right thing on cmake builds--although it will
> run successfully--since cmake doesn't define HAVE_STRERROR*.
>
> I wasn't sure quite what to do with MakeErrStr. I'd be perfectly happy
> with that as the interface in Errno.h, but it does different things on
> Windows and Unix, and I didn't want a public function to be ambiguous
> like that.
Seems pretty reasonable for me. If you think it's ok, please commit.
Please commit any autoconf regenerations as a separate (second) patch
though.
-Chris
More information about the llvm-commits
mailing list