diff options
author | David Robillard <d@drobilla.net> | 2018-07-10 21:50:48 +0200 |
---|---|---|
committer | David Robillard <d@drobilla.net> | 2018-07-10 21:50:48 +0200 |
commit | 06ccf8c3eb72ef6aa1d7eca54434870cd35ef451 (patch) | |
tree | f55a845b64255f204b17d6fd94ebc04cc26f96a1 /src | |
parent | cea8fb3e487e0c2605061e3bf772db0455fba6bb (diff) | |
download | lilv-06ccf8c3eb72ef6aa1d7eca54434870cd35ef451.tar.gz lilv-06ccf8c3eb72ef6aa1d7eca54434870cd35ef451.tar.bz2 lilv-06ccf8c3eb72ef6aa1d7eca54434870cd35ef451.zip |
Fix Windows/MSVC build
Diffstat (limited to 'src')
-rw-r--r-- | src/lilv_internal.h | 5 | ||||
-rw-r--r-- | src/util.c | 4 |
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 @@ -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> |