summaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorDavid Robillard <d@drobilla.net>2018-07-10 21:50:48 +0200
committerDavid Robillard <d@drobilla.net>2018-07-10 21:50:48 +0200
commit06ccf8c3eb72ef6aa1d7eca54434870cd35ef451 (patch)
treef55a845b64255f204b17d6fd94ebc04cc26f96a1 /src
parentcea8fb3e487e0c2605061e3bf772db0455fba6bb (diff)
downloadlilv-06ccf8c3eb72ef6aa1d7eca54434870cd35ef451.tar.gz
lilv-06ccf8c3eb72ef6aa1d7eca54434870cd35ef451.tar.bz2
lilv-06ccf8c3eb72ef6aa1d7eca54434870cd35ef451.zip
Fix Windows/MSVC build
Diffstat (limited to 'src')
-rw-r--r--src/lilv_internal.h5
-rw-r--r--src/util.c4
2 files changed, 7 insertions, 2 deletions
diff --git a/src/lilv_internal.h b/src/lilv_internal.h
index cedc33e..15d2716 100644
--- a/src/lilv_internal.h
+++ b/src/lilv_internal.h
@@ -29,13 +29,16 @@ extern "C" {
#ifdef _WIN32
# include <windows.h>
# include <direct.h>
+# include <stdio.h>
# define dlopen(path, flags) LoadLibrary(path)
# define dlclose(lib) FreeLibrary((HMODULE)lib)
# define unlink(path) _unlink(path)
# define rmdir(path) _rmdir(path)
# ifdef _MSC_VER
# define __func__ __FUNCTION__
-# define snprintf _snprintf
+# ifndef snprintf
+# define snprintf _snprintf
+# endif
# endif
#ifndef INFINITY
# define INFINITY DBL_MAX + DBL_MAX
diff --git a/src/util.c b/src/util.c
index b600586..9e791b4 100644
--- a/src/util.c
+++ b/src/util.c
@@ -39,8 +39,9 @@
# include <io.h>
# define F_OK 0
# define mkdir(path, flags) _mkdir(path)
+# if defined(_MSC_VER) && _MSC_VER <= 1400
/** Implement 'CreateSymbolicLink()' for MSVC 8 or earlier */
-BOOLEAN WINAPI
+extern "C" BOOLEAN WINAPI
CreateSymbolicLink(LPCTSTR linkpath, LPCTSTR targetpath, DWORD flags)
{
typedef BOOLEAN (WINAPI* PFUNC)(LPCTSTR, LPCTSTR, DWORD);
@@ -49,6 +50,7 @@ CreateSymbolicLink(LPCTSTR linkpath, LPCTSTR targetpath, DWORD flags)
"CreateSymbolicLinkA");
return pfn ? pfn(linkpath, targetpath, flags) : 0;
}
+# endif
#else
# include <dirent.h>
# include <limits.h>