From 61377c582e0f2675baa5f5e6e30a35d1a4164b33 Mon Sep 17 00:00:00 2001 From: Karen Arutyunov Date: Mon, 1 May 2017 16:08:43 +0300 Subject: Add hxx extension for headers and lib prefix for library dir --- butl/win32-utility.cxx | 54 -------------------------------------------------- 1 file changed, 54 deletions(-) delete mode 100644 butl/win32-utility.cxx (limited to 'butl/win32-utility.cxx') diff --git a/butl/win32-utility.cxx b/butl/win32-utility.cxx deleted file mode 100644 index 10b1947..0000000 --- a/butl/win32-utility.cxx +++ /dev/null @@ -1,54 +0,0 @@ -// file : butl/win32-utility.cxx -*- C++ -*- -// copyright : Copyright (c) 2014-2017 Code Synthesis Ltd -// license : MIT; see accompanying LICENSE file - -#include - -// Note that while we exclude it from the buildfile-based builds, we still -// need these guards for build2 bootstrap. -// -#ifdef _WIN32 - -#include // unique_ptr - -using namespace std; - -namespace butl -{ - namespace win32 - { - struct msg_deleter - { - void operator() (char* p) const {LocalFree (p);} - }; - - string - error_msg (DWORD code) - { - char* msg; - if (!FormatMessageA ( - FORMAT_MESSAGE_ALLOCATE_BUFFER | - FORMAT_MESSAGE_FROM_SYSTEM | - FORMAT_MESSAGE_IGNORE_INSERTS | - FORMAT_MESSAGE_MAX_WIDTH_MASK, - 0, - code, - MAKELANGID (LANG_NEUTRAL, SUBLANG_DEFAULT), - (char*)&msg, - 0, - 0)) - return "unknown error code " + to_string (code); - - unique_ptr m (msg); - return msg; - } - - string - last_error_msg () - { - return error_msg (GetLastError ()); - } - } -} - -#endif // _WIN32 -- cgit v1.1