Mercurial > pub > dyncall > dyncall
comparison 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 |
comparison
equal
deleted
inserted
replaced
317:3df50603afa9 | 318:3124f4c4f293 |
---|---|
32 # include <io.h> | 32 # include <io.h> |
33 # define F_OK 0 | 33 # define F_OK 0 |
34 #else | 34 #else |
35 # include <unistd.h> | 35 # include <unistd.h> |
36 #endif | 36 #endif |
37 #include <libgen.h> | 37 |
38 #if defined(DC_WINDOWS) | |
39 char* dirname(char* path) | |
40 { | |
41 static const char dot[] = "."; | |
42 char* p = strrchr(path, '\\'); | |
43 if(p) | |
44 *p = '\0'; | |
45 else | |
46 path = (char*)dot; | |
47 return path; | |
48 } | |
49 #else | |
50 # include <libgen.h> | |
51 #endif | |
38 | 52 |
39 | 53 |
40 int strlen_utf8(const char *s) | 54 int strlen_utf8(const char *s) |
41 { | 55 { |
42 int i=0, j=0; | 56 int i=0, j=0; |