mirror of
https://github.com/radareorg/radare2.git
synced 2025-03-04 04:17:25 +00:00
GetLongPathName is not available on mingw32, resolve it dynamically
This commit is contained in:
parent
eec5aff085
commit
e646979ad9
@ -9,6 +9,7 @@
|
||||
#include <sys/stat.h>
|
||||
#include <unistd.h>
|
||||
#include <fcntl.h>
|
||||
#include <r_lib.h>
|
||||
#if __UNIX__
|
||||
#include <sys/mman.h>
|
||||
#endif
|
||||
@ -873,8 +874,11 @@ R_API char *r_file_tmpdir() {
|
||||
path = strdup ("C:\\WINDOWS\\Temp\\");
|
||||
}
|
||||
} else {
|
||||
// Windows XP sometimes returns short path name
|
||||
GetLongPathName (tmpdir, tmpdir, sizeof (tmpdir));
|
||||
void (*glpn)(TCHAR *, TCHAR *, size_t) = (void*)r_lib_dl_sym (NULL, "GetLongPathName");
|
||||
if (glpn) {
|
||||
// Windows XP sometimes returns short path name
|
||||
glpn (tmpdir, tmpdir, sizeof (tmpdir));
|
||||
}
|
||||
path = strdup (tmpdir);
|
||||
}
|
||||
#elif __ANDROID__
|
||||
|
Loading…
x
Reference in New Issue
Block a user