summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--NEWS3
-rw-r--r--src/plugin.c2
-rw-r--r--src/util.c14
-rw-r--r--src/world.c2
4 files changed, 18 insertions, 3 deletions
diff --git a/NEWS b/NEWS
index 0663e4e..1bfec21 100644
--- a/NEWS
+++ b/NEWS
@@ -3,9 +3,10 @@ lilv (0.20.1) unstable;
* Tolerate passing NULL to lilv_state_restore()
* Fix a few minor/unlikely memory errors
* Configure based on compiler target OS for cross-compilation
+ * Windows fixes (thanks John Emmas)
* Minor documentation improvements
- -- David Robillard <d@drobilla.net> Mon, 17 Nov 2014 01:43:02 -0500
+ -- David Robillard <d@drobilla.net> Fri, 21 Nov 2014 20:31:50 -0500
lilv (0.20.0) stable;
diff --git a/src/plugin.c b/src/plugin.c
index 8729314..bf0843b 100644
--- a/src/plugin.c
+++ b/src/plugin.c
@@ -693,7 +693,7 @@ lilv_plugin_get_latency_port_index(const LilvPlugin* p)
} else if (des_port) {
return des_port->index;
} else {
- return UINT32_MAX;
+ return (uint32_t)-1;
}
}
diff --git a/src/util.c b/src/util.c
index b38e58a..76c5a9d 100644
--- a/src/util.c
+++ b/src/util.c
@@ -35,6 +35,17 @@
# include <io.h>
# define F_OK 0
# define mkdir(path, flags) _mkdir(path)
+# if (defined(_MSC_VER) && (_MSC_VER < 1500))
+/** Implement 'CreateSymbolicLink()' for MSVC 8 or earlier */
+BOOLEAN WINAPI
+CreateSymbolicLink(LPCTSTR linkpath, LPCTSTR targetpath, DWORD flags)
+{
+ typedef BOOLEAN (WINAPI* PFUNC)(LPCTSTR, LPCTSTR, DWORD);
+
+ PFUNC pfn = (PFUNC)GetProcAddress(GetModuleHandle(TEXT("kernel32.dll")), "CreateSymbolicLinkA");
+ return pfn ? pfn(linkpath, targetpath, flags) : 0;
+}
+# endif /* _MSC_VER < 1500 */
#else
# include <dirent.h>
# include <unistd.h>
@@ -429,6 +440,9 @@ lilv_symlink(const char* oldpath, const char* newpath)
if (strcmp(oldpath, newpath)) {
#ifdef _WIN32
ret = !CreateSymbolicLink(newpath, oldpath, 0);
+ if (ret) {
+ ret = !CreateHardLink(newpath, oldpath, 0);
+ }
#else
ret = symlink(oldpath, newpath);
#endif
diff --git a/src/world.c b/src/world.c
index bd926d9..10382c7 100644
--- a/src/world.c
+++ b/src/world.c
@@ -652,7 +652,7 @@ lilv_world_unload_file(LilvWorld* world, LilvNode* file)
{
ZixTreeIter* iter;
if (!zix_tree_find((ZixTree*)world->loaded_files, file, &iter)) {
- zix_tree_remove(world->loaded_files, iter);
+ zix_tree_remove((ZixTree*)world->loaded_files, iter);
return 0;
}
return 1;