Provide the ThrowErrno utility.
authorReid Spencer <rspencer@reidspencer.com>
Mon, 15 Nov 2004 17:21:57 +0000 (17:21 +0000)
committerReid Spencer <rspencer@reidspencer.com>
Mon, 15 Nov 2004 17:21:57 +0000 (17:21 +0000)
Patch contributed by Morten Ofstad

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@17827 91177308-0d34-0410-b5e6-96231b3b80d8

lib/System/Win32/Win32.h

index fb2c7e96fdf4bae0ec7e6ecc4871a1da40d091aa..ab6b3c2b4984b53c0312bff9476678868120152e 100644 (file)
@@ -31,3 +31,6 @@ inline void ThrowError(const std::string& msg) {
   throw s;
 }
 
+inline void ThrowErrno(const std::string& prefix) {
+    ThrowError(prefix + ": " + strerror(errno));
+}