diff options
author | David Robillard <d@drobilla.net> | 2012-04-06 21:16:03 +0000 |
---|---|---|
committer | David Robillard <d@drobilla.net> | 2012-04-06 21:16:03 +0000 |
commit | 807b92ca7157d0de52a010ca23e6587e5ac4b641 (patch) | |
tree | 20e282bb01fe06df782bb72831d52dff70462134 | |
parent | a8f6cb4e48371ace96a462134b72798020bdfee5 (diff) | |
download | lilv-807b92ca7157d0de52a010ca23e6587e5ac4b641.tar.gz lilv-807b92ca7157d0de52a010ca23e6587e5ac4b641.tar.bz2 lilv-807b92ca7157d0de52a010ca23e6587e5ac4b641.zip |
Fix compilation on Windows.
git-svn-id: http://svn.drobilla.net/lad/trunk/lilv@4150 a436a847-0d15-0410-975c-d299462d15a1
-rw-r--r-- | src/util.c | 9 | ||||
-rw-r--r-- | test/lilv_test.c | 2 | ||||
-rw-r--r-- | wscript | 3 |
3 files changed, 8 insertions, 6 deletions
@@ -28,7 +28,9 @@ #include <stdlib.h> #include <string.h> -#ifdef _MSC_VER +#ifdef _WIN32 +# define _WIN32_WINNT 0x0600 /* for CreateSymbolicLink */ +# include <windows.h> # include <direct.h> # include <io.h> # define F_OK 0 @@ -345,7 +347,6 @@ lilv_size_mtime(const char* path, off_t* size, time_t* time) struct stat buf; if (stat(path, &buf)) { LILV_ERRORF("stat(%s) (%s)\n", path, strerror(errno)); - *size = *time = 0; } if (size) { @@ -370,8 +371,8 @@ update_latest(const char* path, const char* name, void* data) char* entry_path = lilv_path_join(path, name); unsigned num; if (sscanf(entry_path, latest->pattern, &num) == 1) { - off_t entry_size; - time_t entry_time; + off_t entry_size = 0; + time_t entry_time = 0; lilv_size_mtime(entry_path, &entry_size, &entry_time); if (entry_size == latest->orig_size && entry_time >= latest->time) { free(latest->latest); diff --git a/test/lilv_test.c b/test/lilv_test.c index c1da9ba..ea22771 100644 --- a/test/lilv_test.c +++ b/test/lilv_test.c @@ -28,7 +28,7 @@ #include <string.h> #include <sys/stat.h> -#ifdef _MSC_VER +#ifdef _WIN32 # include <direct.h> # define mkdir(path, flags) _mkdir(path) # define setenv(n, v, r) SetEnvironmentVariable((n), (v)) @@ -193,8 +193,9 @@ def build(bld): lib = ['dl'] libflags = ['-fvisibility=hidden'] defines = [] + if sys.platform == 'win32': + lib = [] if bld.env['MSVC_COMPILER']: - lib = [] libflags = [] defines = ['snprintf=_snprintf'] elif sys.platform.find('bsd') > 0: |