summaryrefslogtreecommitdiff
path: root/src/mongo/util/errno_util.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'src/mongo/util/errno_util.cpp')
-rw-r--r--src/mongo/util/errno_util.cpp18
1 files changed, 18 insertions, 0 deletions
diff --git a/src/mongo/util/errno_util.cpp b/src/mongo/util/errno_util.cpp
index 6e75b4b511a..73aac860c8e 100644
--- a/src/mongo/util/errno_util.cpp
+++ b/src/mongo/util/errno_util.cpp
@@ -27,16 +27,34 @@
* it in the license file.
*/
+#include "mongo/platform/basic.h"
+
#include "mongo/util/errno_util.h"
#include <cerrno>
#include <fmt/format.h>
#include <system_error>
+#ifdef _WIN32
+#include <errhandlingapi.h>
+#include <winsock2.h>
+#endif
+
namespace mongo {
using namespace fmt::literals;
+#ifdef _WIN32
+namespace errno_util_win32_detail {
+int gle() {
+ return GetLastError();
+}
+int wsaGle() {
+ return WSAGetLastError();
+}
+} // namespace errno_util_win32_detail
+#endif
+
std::string errorMessage(std::error_code ec) {
std::string r = ec.message();
bool vague = false;