windows_throw_failed.cpp 555 B

12345678910111213141516171819202122232425
  1. //
  2. // $Id$
  3. //
  4. #include<__vic/windows/throw_last_error.h>
  5. #include<__vic/error.h>
  6. #include<cstring>
  7. #include<string>
  8. namespace __vic { namespace windows {
  9. //----------------------------------------------------------------------------
  10. void throw_failed(const char *who)
  11. {
  12. size_t who_len = std::strlen(who);
  13. std::string msg;
  14. msg.reserve(who_len + 7);
  15. msg.append(who, who_len);
  16. msg.append(" failed", 7);
  17. throw exception(msg.c_str());
  18. }
  19. //----------------------------------------------------------------------------
  20. }} // namespace