From 06ccf8c3eb72ef6aa1d7eca54434870cd35ef451 Mon Sep 17 00:00:00 2001 From: David Robillard Date: Tue, 10 Jul 2018 21:50:48 +0200 Subject: Fix Windows/MSVC build --- src/lilv_internal.h | 5 ++++- src/util.c | 4 +++- 2 files changed, 7 insertions(+), 2 deletions(-) (limited to 'src') 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 # include +# include # 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 # 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 # include -- cgit v1.2.1