diff options
Diffstat (limited to '')
-rw-r--r-- | crypto/compat/getprogname_windows.c | 13 |
1 files changed, 13 insertions, 0 deletions
diff --git a/crypto/compat/getprogname_windows.c b/crypto/compat/getprogname_windows.c new file mode 100644 index 0000000..eb04ec0 --- /dev/null +++ b/crypto/compat/getprogname_windows.c | |||
@@ -0,0 +1,13 @@ | |||
1 | #include <stdlib.h> | ||
2 | |||
3 | #include <windows.h> | ||
4 | |||
5 | const char * | ||
6 | getprogname(void) | ||
7 | { | ||
8 | static char progname[MAX_PATH + 1]; | ||
9 | DWORD length = GetModuleFileName(NULL, progname, sizeof (progname) - 1); | ||
10 | if (length < 0) | ||
11 | return "?"; | ||
12 | return progname; | ||
13 | } | ||