aboutsummaryrefslogtreecommitdiff
path: root/lib/compat/w32_perror.c
diff options
context:
space:
mode:
authorDavid Oberhollenzer <david.oberhollenzer@sigma-star.at>2023-01-31 11:21:30 +0100
committerDavid Oberhollenzer <david.oberhollenzer@sigma-star.at>2023-01-31 13:51:49 +0100
commitcdccc69c62579b0c13b35fad0728079652b8f3c9 (patch)
tree9fa54c710f73c5e08a9c8466e7a712eb63ee07ac /lib/compat/w32_perror.c
parent2182129c8f359c4fa1390eaba7a65b595ccd4182 (diff)
Move library source into src sub-directory
Signed-off-by: David Oberhollenzer <david.oberhollenzer@sigma-star.at>
Diffstat (limited to 'lib/compat/w32_perror.c')
-rw-r--r--lib/compat/w32_perror.c33
1 files changed, 0 insertions, 33 deletions
diff --git a/lib/compat/w32_perror.c b/lib/compat/w32_perror.c
deleted file mode 100644
index 8c84191..0000000
--- a/lib/compat/w32_perror.c
+++ /dev/null
@@ -1,33 +0,0 @@
-/* SPDX-License-Identifier: GPL-3.0-or-later */
-/*
- * w32_perror.c
- *
- * Copyright (C) 2019 David Oberhollenzer <goliath@infraroot.at>
- */
-#include "config.h"
-#include "compat.h"
-
-#include <stdio.h>
-
-#ifdef _WIN32
-#define WIN32_LEAN_AND_MEAN
-#include <windows.h>
-
-void w32_perror(const char *str)
-{
- DWORD nStatus = GetLastError();
- LPVOID msg = NULL;
-
- FormatMessageA(FORMAT_MESSAGE_ALLOCATE_BUFFER |
- FORMAT_MESSAGE_FROM_SYSTEM |
- FORMAT_MESSAGE_IGNORE_INSERTS,
- NULL, nStatus,
- MAKELANGID(LANG_NEUTRAL, SUBLANG_DEFAULT),
- (LPTSTR)&msg, 0, NULL);
-
- fprintf(stderr, "%s: %s\n", str, (const char *)msg);
-
- if (msg != NULL)
- LocalFree(msg);
-}
-#endif