Mercurial > pub > dyncall > dyncall
diff test/dynload_plain/dynload_plain.c @ 318:3124f4c4f293
- dynload_plain test code build fix for windows
author | Tassilo Philipp |
---|---|
date | Wed, 13 Nov 2019 01:21:02 +0100 |
parents | b2e4e23d9953 |
children | dd5d03483314 |
line wrap: on
line diff
--- a/test/dynload_plain/dynload_plain.c Tue Nov 12 21:16:58 2019 +0100 +++ b/test/dynload_plain/dynload_plain.c Wed Nov 13 01:21:02 2019 +0100 @@ -34,7 +34,21 @@ #else # include <unistd.h> #endif -#include <libgen.h> + +#if defined(DC_WINDOWS) +char* dirname(char* path) +{ + static const char dot[] = "."; + char* p = strrchr(path, '\\'); + if(p) + *p = '\0'; + else + path = (char*)dot; + return path; +} +#else +# include <libgen.h> +#endif int strlen_utf8(const char *s)