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 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" diff --git a/makestub.pl b/makestub.pl index 3c34190..897f9be 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; @@ -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); }