From 0d362fb0230bae970d52a223b8111787f166e597 Mon Sep 17 00:00:00 2001 From: tresf Date: Thu, 2 Nov 2017 16:47:12 -0400 Subject: [PATCH 1/4] Use List::MoreUtils instead of List::Util --- makestub.pl | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/makestub.pl b/makestub.pl index 3c34190..d631408 100755 --- a/makestub.pl +++ b/makestub.pl @@ -1,6 +1,6 @@ #!/usr/bin/perl -w -use List::Util qw(any); +use List::MoreUtils qw(any); use XML::Parser; $xml_line = 1; From 11a125cc11222d53a70614056526708830713639 Mon Sep 17 00:00:00 2001 From: tresf Date: Thu, 2 Nov 2017 14:59:40 -0400 Subject: [PATCH 2/4] Windows compat fixes --- makestub.pl | 6 +++--- util/blo.c | 21 +++++++++++++++++---- 2 files changed, 20 insertions(+), 7 deletions(-) diff --git a/makestub.pl b/makestub.pl index d631408..897f9be 100755 --- a/makestub.pl +++ b/makestub.pl @@ -68,7 +68,7 @@ print < \#include -\#ifndef WIN32 +\#ifndef _WIN32 \#include "config.h" \#endif @@ -85,7 +85,7 @@ \#include "ladspa.h" -\#ifdef WIN32 +\#ifdef _WIN32 \#define _WINDOWS_DLL_EXPORT_ __declspec(dllexport) int bIsFirstTime = 1; static void __attribute__((constructor)) swh_init(); // forward declaration @@ -123,7 +123,7 @@ _WINDOWS_DLL_EXPORT_ const LADSPA_Descriptor *ladspa_descriptor(unsigned long index) { -\#ifdef WIN32 +\#ifdef _WIN32 if (bIsFirstTime) { swh_init(); bIsFirstTime = 0; diff --git a/util/blo.c b/util/blo.c index 45c786d..64361f8 100644 --- a/util/blo.c +++ b/util/blo.c @@ -20,7 +20,9 @@ #include #include #include +#ifndef _WIN32 #include +#endif #include "blo.h" @@ -42,10 +44,13 @@ blo_h_tables *blo_h_tables_new(int table_size) float table_size_f = table_size; float max; unsigned int table_count = 0; - unsigned int i, h; + int i; + unsigned int h; size_t all_tables_size = sizeof(float) * (table_size + BLO_TABLE_WR) * (BLO_N_HARMONICS - 1) * 2; +#ifndef _WIN32 int shm_fd; +#endif char shm_path[128]; this = malloc(sizeof(blo_h_tables)); @@ -56,6 +61,7 @@ blo_h_tables *blo_h_tables_new(int table_size) snprintf(shm_path, 128, "/blo-1-%dx%dx%d.tbl", BLO_N_WAVES, BLO_N_HARMONICS, table_size + BLO_TABLE_WR); +#ifndef _WIN32 if ((shm_fd = shm_open(shm_path, O_RDONLY, 0)) > 0) { /* There is an existing SHM segment that matches what we want */ @@ -119,12 +125,15 @@ blo_h_tables *blo_h_tables_new(int table_size) return this; } else if ((shm_fd = shm_open(shm_path, O_CREAT | O_RDWR, 0644)) > 0) { /* There is no existing SHM segment, but we can make one */ - ftruncate(shm_fd, all_tables_size); + int err = ftruncate(shm_fd, all_tables_size); - all_tables = mmap(0, all_tables_size, PROT_READ | PROT_WRITE, - MAP_SHARED, shm_fd, 0); + if (!err) { + all_tables = mmap(0, all_tables_size, PROT_READ | PROT_WRITE, + MAP_SHARED, shm_fd, 0); + } close(shm_fd); } +#endif /* Fallback case, can't map a SHM segment, just malloc it and suffer */ if (!all_tables) { @@ -224,7 +233,9 @@ blo_h_tables *blo_h_tables_new(int table_size) } } +#ifndef _WIN32 msync(all_tables, all_tables_size, MS_ASYNC); +#endif return this; } @@ -232,7 +243,9 @@ blo_h_tables *blo_h_tables_new(int table_size) void blo_h_tables_free(blo_h_tables *tables) { if (tables->store_type == BLO_MMAP) { +#ifndef _WIN32 munmap(tables->alloc_space, tables->alloc_size); +#endif } else { free(tables->alloc_space); } From 37e32ae68c54a527c4a9876ee1cd0d46a67dc81c Mon Sep 17 00:00:00 2001 From: Tres Finocchiaro Date: Thu, 2 Nov 2017 14:50:38 -0400 Subject: [PATCH 3/4] Allow older versions of gettext Gettext 0.18.3 works just fine and lowers the requirements for older build systems. @hartwork FYI, partially reverts 01c7745. Tested on Ubuntu 14.04. --- configure.ac | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/configure.ac b/configure.ac index ffe847e..40357ef 100644 --- a/configure.ac +++ b/configure.ac @@ -55,7 +55,7 @@ AM_PROG_CC_C_O AC_REQUIRE_CPP ALL_LINGUAS="en_GB" AM_GNU_GETTEXT([external]) -AM_GNU_GETTEXT_VERSION([0.19.3]) +AM_GNU_GETTEXT_VERSION([0.18.3]) AC_C_BIGENDIAN LIBS="$LIBS -lm" From b9c02ddf987a1be725e740febcbf466efb014dfa Mon Sep 17 00:00:00 2001 From: tresf Date: Thu, 2 Nov 2017 23:52:40 -0400 Subject: [PATCH 4/4] Add Travis-CI job --- .travis.yml | 15 +++++++++++++++ 1 file changed, 15 insertions(+) create mode 100644 .travis.yml diff --git a/.travis.yml b/.travis.yml new file mode 100644 index 0000000..132f5e6 --- /dev/null +++ b/.travis.yml @@ -0,0 +1,15 @@ +language: c +compiler: gcc +dist: trusty +sudo: required +matrix: + include: + - os: linux +install: + - sudo apt-get install automake autopoint libxml2-utils perl libxml-perl liblist-moreutils-perl fftw3-dev +script: + - autoreconf -i + - ./configure + - make + - make install prefix=$HOME/dist + - cd $HOME/dist/lib/ladspa/ && echo -e "Found $(ls *.so |wc -l) files\n-------" && ls *.so