aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorDavid Robillard <d@drobilla.net>2012-08-02 00:36:14 +0000
committerDavid Robillard <d@drobilla.net>2012-08-02 00:36:14 +0000
commitae52df4ba3f6fe7fb7488791e2bd6ce84fb68f9a (patch)
treeb40acf88d2088d642d7336f288fef73cb74550df
parent35e38f95feed56dab2e5b1b10a7939ab640e3163 (diff)
downloadjalv-ae52df4ba3f6fe7fb7488791e2bd6ce84fb68f9a.tar.gz
jalv-ae52df4ba3f6fe7fb7488791e2bd6ce84fb68f9a.tar.bz2
jalv-ae52df4ba3f6fe7fb7488791e2bd6ce84fb68f9a.zip
Fix compilation on Windows.
git-svn-id: http://svn.drobilla.net/lad/trunk/jalv@4590 a436a847-0d15-0410-975c-d299462d15a1
-rw-r--r--src/jalv.c9
-rw-r--r--src/zix/sem.h1
2 files changed, 10 insertions, 0 deletions
diff --git a/src/jalv.c b/src/jalv.c
index 3ce2266..be047f7 100644
--- a/src/jalv.c
+++ b/src/jalv.c
@@ -27,6 +27,10 @@
#include <sys/types.h>
#include <unistd.h>
+#ifdef _WIN32
+# include <io.h> /* for _mktemp */
+#endif
+
#include "jalv_config.h"
#include "jalv_internal.h"
@@ -757,9 +761,14 @@ main(int argc, char** argv)
host.urids.time_frame = symap_map(host.symap, LV2_TIME__frame);
host.urids.time_speed = symap_map(host.symap, LV2_TIME__speed);
+#ifdef _WIN32
+ host.temp_dir = jalv_strdup("jalvXXXXXX");
+ _mktemp(host.temp_dir);
+#else
char* template = jalv_strdup("/tmp/jalv-XXXXXX");
host.temp_dir = jalv_strjoin(mkdtemp(template), "/");
free(template);
+#endif
LV2_State_Make_Path make_path = { &host, jalv_make_path };
make_path_feature.data = &make_path;
diff --git a/src/zix/sem.h b/src/zix/sem.h
index 98117c8..72c7d8d 100644
--- a/src/zix/sem.h
+++ b/src/zix/sem.h
@@ -20,6 +20,7 @@
#ifdef __APPLE__
# include <mach/mach.h>
#elif defined(_WIN32)
+# include <limits.h>
# include <windows.h>
#else
# include <semaphore.h>