summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorDavid Robillard <d@drobilla.net>2012-04-06 21:16:03 +0000
committerDavid Robillard <d@drobilla.net>2012-04-06 21:16:03 +0000
commit807b92ca7157d0de52a010ca23e6587e5ac4b641 (patch)
tree20e282bb01fe06df782bb72831d52dff70462134
parenta8f6cb4e48371ace96a462134b72798020bdfee5 (diff)
downloadlilv-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.c9
-rw-r--r--test/lilv_test.c2
-rw-r--r--wscript3
3 files changed, 8 insertions, 6 deletions
diff --git a/src/util.c b/src/util.c
index a3109f7..789f5a6 100644
--- a/src/util.c
+++ b/src/util.c
@@ -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))
diff --git a/wscript b/wscript
index e6d759f..21d0fff 100644
--- a/wscript
+++ b/wscript
@@ -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: