diff options
-rw-r--r-- | NEWS | 3 | ||||
-rw-r--r-- | src/jalv.c | 14 | ||||
-rw-r--r-- | wscript | 28 |
3 files changed, 33 insertions, 12 deletions
@@ -6,13 +6,14 @@ jalv (1.6.7) unstable; * Build Qt interface as C++14 * Change no-menu short option to m to avoid clash with jack-name * Clean up and modernize code + * Fix MSVC build * Fix crash when running jalv without arguments * Fix outdated man pages * Flush stdout after printing control values in console interface * Remove Gtkmm interface * Remove Qt4 support - -- David Robillard <d@drobilla.net> Fri, 27 May 2022 23:19:48 +0000 + -- David Robillard <d@drobilla.net> Mon, 30 May 2022 19:42:05 +0000 jalv (1.6.6) stable; @@ -15,7 +15,8 @@ */ #define _POSIX_C_SOURCE 200809L // for mkdtemp -#define _DARWIN_C_SOURCE // for mkdtemp on OSX +#define _XOPEN_SOURCE 600 // for S_IFMT and S_IFDIF +#define _DARWIN_C_SOURCE // for mkdtemp on Darwin #include "jalv_config.h" #include "jalv_internal.h" @@ -57,8 +58,6 @@ #ifdef _WIN32 # include <io.h> // for _mktemp # define snprintf _snprintf -#else -# include <unistd.h> #endif #include <assert.h> @@ -645,8 +644,8 @@ jalv_run(Jalv* jalv, uint32_t nframes) // Check if it's time to send updates to the UI jalv->event_delta_t += nframes; - bool send_ui_updates = false; - float update_frames = jalv->sample_rate / jalv->ui_update_hz; + bool send_ui_updates = false; + uint32_t update_frames = (uint32_t)(jalv->sample_rate / jalv->ui_update_hz); if (jalv->has_ui && (jalv->event_delta_t > update_frames)) { send_ui_updates = true; jalv->event_delta_t = 0; @@ -1000,7 +999,7 @@ jalv_open(Jalv* const jalv, int* argc, char*** argv) if (jalv->opts.load) { struct stat info; stat(jalv->opts.load, &info); - if (S_ISDIR(info.st_mode)) { + if ((info.st_mode & S_IFMT) == S_IFDIR) { char* path = jalv_strjoin(jalv->opts.load, "/state.ttl"); state = lilv_state_new_from_file(jalv->world, &jalv->map, NULL, path); free(path); @@ -1207,7 +1206,8 @@ jalv_open(Jalv* const jalv, int* argc, char*** argv) &static_features[2], &static_features[3], NULL}; - jalv->feature_list = calloc(1, sizeof(features)); + + jalv->feature_list = (const LV2_Feature**)calloc(1, sizeof(features)); if (!jalv->feature_list) { fprintf(stderr, "Failed to allocate feature list\n"); jalv_close(jalv); @@ -196,6 +196,18 @@ def configure(conf): defines = ['_POSIX_C_SOURCE=200809L'] + conf.env.PTHREAD_CFLAGS = [] + conf.env.PTHREAD_LINKFLAGS = [] + if conf.env.DEST_OS != 'win32': + if conf.check(cflags=['-pthread'], mandatory=False): + conf.env.PTHREAD_CFLAGS = ['-pthread'] + if conf.check(linkflags=['-pthread'], mandatory=False): + if not (conf.env.DEST_OS == 'darwin' + and conf.env.CXX_NAME == 'clang'): + conf.env.PTHREAD_LINKFLAGS += ['-pthread'] + elif conf.check(linkflags=['-lpthread'], mandatory=False): + conf.env.PTHREAD_LINKFLAGS += ['-lpthread'] + conf.check_function('c', 'isatty', header_name = 'unistd.h', defines = defines, @@ -263,6 +275,8 @@ def build(bld): obj = bld(features = 'c cshlib', source = source + ' src/jalv_console.c', target = 'jalv', + cflags = bld.env.PTHREAD_CFLAGS, + linkflags = bld.env.PTHREAD_LINKFLAGS, defines = ['ZIX_INTERNAL'], includes = ['.', 'src'], lib = ['pthread'], @@ -276,9 +290,10 @@ def build(bld): obj = bld(features = 'c cprogram', source = source + ' src/jalv_console.c', target = 'jalv', + cflags = bld.env.PTHREAD_CFLAGS, + linkflags = bld.env.PTHREAD_LINKFLAGS, defines = ['ZIX_INTERNAL'], includes = ['.', 'src'], - lib = ['pthread'], uselib = libs, install_path = '${BINDIR}') @@ -287,9 +302,11 @@ def build(bld): obj = bld(features = 'c cprogram', source = source + ' src/jalv_gtk.c', target = 'jalv.gtk', + cflags = bld.env.PTHREAD_CFLAGS, + linkflags = bld.env.PTHREAD_LINKFLAGS, defines = ['ZIX_INTERNAL'], includes = ['.', 'src'], - lib = ['pthread', 'm'], + lib = ['m'], uselib = libs + ' GTK2', install_path = '${BINDIR}') @@ -298,9 +315,11 @@ def build(bld): obj = bld(features = 'c cprogram', source = source + ' src/jalv_gtk.c', target = 'jalv.gtk3', + cflags = bld.env.PTHREAD_CFLAGS, + linkflags = bld.env.PTHREAD_LINKFLAGS, defines = ['ZIX_INTERNAL'], includes = ['.', 'src'], - lib = ['pthread', 'm'], + lib = ['m'], uselib = libs + ' GTK3', install_path = '${BINDIR}') @@ -321,9 +340,10 @@ def build(bld): obj = bld(features = 'c cxx cxxprogram', source = source + ' src/jalv_qt.cpp', target = 'jalv.qt5', + cflags = bld.env.PTHREAD_CFLAGS, + linkflags = bld.env.PTHREAD_LINKFLAGS, defines = ['ZIX_INTERNAL'], includes = ['.', 'src'], - lib = ['pthread'], uselib = libs + ' QT5', install_path = '${BINDIR}', cxxflags = ['-fPIC']) |