1 //===- Win32/Win32.h - Common Win32 Include File ----------------*- C++ -*-===//
3 // The LLVM Compiler Infrastructure
5 // This file was developed by Reid Spencer and is distributed under the
6 // University of Illinois Open Source License. See LICENSE.TXT for details.
8 //===----------------------------------------------------------------------===//
10 // This file defines things specific to Unix implementations.
12 //===----------------------------------------------------------------------===//
14 //===----------------------------------------------------------------------===//
15 //=== WARNING: Implementation here must contain only generic UNIX code that
16 //=== is guaranteed to work on all UNIX variants.
17 //===----------------------------------------------------------------------===//
19 #include "llvm/Config/config.h" // Get autoconf configuration settings
24 inline void ThrowError(const std::string& msg) {
26 FormatMessage(FORMAT_MESSAGE_ALLOCATE_BUFFER|FORMAT_MESSAGE_FROM_SYSTEM,
27 NULL, GetLastError(), 0, (LPSTR)&buffer, 1, NULL);
34 inline void ThrowErrno(const std::string& prefix) {
35 ThrowError(prefix + ": " + strerror(errno));