aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-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>