Skip to content

Commit

Permalink
Reformat exception.cpp
Browse files Browse the repository at this point in the history
  • Loading branch information
fpagliughi committed Feb 25, 2023
1 parent 772adc2 commit f3100f5
Showing 1 changed file with 10 additions and 10 deletions.
20 changes: 10 additions & 10 deletions src/exception.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
// --------------------------------------------------------------------------
// This file is part of the "sockpp" C++ socket library.
//
// Copyright (c) 2014-2017 Frank Pagliughi
// Copyright (c) 2014-2023 Frank Pagliughi
// All rights reserved.
//
// Redistribution and use in source and binary forms, with or without
Expand Down Expand Up @@ -64,29 +64,29 @@ std::string sys_error::error_str(int err)
FormatMessage(FORMAT_MESSAGE_FROM_SYSTEM | FORMAT_MESSAGE_IGNORE_INSERTS,
NULL, err, MAKELANGID(LANG_NEUTRAL, SUBLANG_DEFAULT),
buf, sizeof(buf), NULL);
#else
#ifdef _GNU_SOURCE
#else
#ifdef _GNU_SOURCE
#if !defined(__GLIBC__)
// use the XSI standard behavior.
// use the XSI standard behavior.
int e = strerror_r(err, buf, sizeof(buf));
auto s = strerror(e);
return s ? std::string(s) : std::string();
#else
// assume GNU exception
// assume GNU exception
auto s = strerror_r(err, buf, sizeof(buf));
return s ? std::string(s) : std::string();
#endif
#else
ignore_result(strerror_r(err, buf, sizeof(buf)));
#endif
#endif
#else
ignore_result(strerror_r(err, buf, sizeof(buf)));
#endif
#endif
return std::string(buf);
}

/////////////////////////////////////////////////////////////////////////////

getaddrinfo_error::getaddrinfo_error(int err, const string& hostname)
: runtime_error(gai_strerror(err)), error_(err), hostname_(hostname)
: runtime_error(gai_strerror(err)), error_(err), hostname_(hostname)
{
}

Expand Down

0 comments on commit f3100f5

Please sign in to comment.