commit | 406e96e44eb6a792a12ed0a1532bc672c5663635 | [log] [tgz] |
---|---|---|
author | Jan Kundrát <jan.kundrat@cesnet.cz> | Sat Dec 11 19:37:33 2021 +0100 |
committer | Michal Vasko <mvasko@cesnet.cz> | Thu Dec 16 12:12:03 2021 +0100 |
tree | 3d08e94e1cf128dab31affe4c0dec68ec4ef4dde | |
parent | f0bd0b63ea5145a42686eab5acb26efbf1bcb11c [diff] [blame] |
MSVC: compat: dirname() from <libgen.h>
diff --git a/compat/compat.c b/compat/compat.c index ea8eb03..6763413 100644 --- a/compat/compat.c +++ b/compat/compat.c
@@ -289,3 +289,18 @@ #error No localtime_r() implementation for this platform is available. #endif #endif + +#ifndef HAVE_DIRNAME +#ifdef _WIN32 +#include <shlwapi.h> +char * +dirname(char *path) +{ + PathRemoveFileSpecA(path); + return path; +} + +#else +#error No dirname() implementation for this platform is available. +#endif +#endif