diff options
author | David Robillard <d@drobilla.net> | 2012-08-02 00:26:38 +0000 |
---|---|---|
committer | David Robillard <d@drobilla.net> | 2012-08-02 00:26:38 +0000 |
commit | 29fc0c801e72a115639eabbd7373b993a25f4e79 (patch) | |
tree | 0e0af293447f2bb71fa2d00e0185d9da0eadda05 /src | |
parent | 3ddfa2d12e95d927f9ccdce1df93b93922bfa221 (diff) | |
download | blop.lv2-29fc0c801e72a115639eabbd7373b993a25f4e79.tar.gz blop.lv2-29fc0c801e72a115639eabbd7373b993a25f4e79.tar.bz2 blop.lv2-29fc0c801e72a115639eabbd7373b993a25f4e79.zip |
Fix compilation in MinGW.
git-svn-id: http://svn.drobilla.net/lad/trunk/plugins/blop.lv2@4588 a436a847-0d15-0410-975c-d299462d15a1
Diffstat (limited to 'src')
-rw-r--r-- | src/include/interpolate.h | 1 | ||||
-rw-r--r-- | src/include/wavedata.h | 1 | ||||
-rw-r--r-- | src/include/wdatutil.h | 8 | ||||
-rw-r--r-- | src/wavedata.c | 14 | ||||
-rw-r--r-- | src/wavegen.c | 19 | ||||
-rw-r--r-- | src/wdatutil.c | 7 |
6 files changed, 21 insertions, 29 deletions
diff --git a/src/include/interpolate.h b/src/include/interpolate.h index 304a817..237008c 100644 --- a/src/include/interpolate.h +++ b/src/include/interpolate.h @@ -1,7 +1,6 @@ #ifndef blop_interpolate_h #define blop_interpolate_h -#include "lv2/lv2plug.in/ns/lv2core/lv2.h" #include "blop_config.h" #include "math_func.h" diff --git a/src/include/wavedata.h b/src/include/wavedata.h index 9d24823..97b2986 100644 --- a/src/include/wavedata.h +++ b/src/include/wavedata.h @@ -20,7 +20,6 @@ #ifndef blop_wavedata_h #define blop_wavedata_h -#include "lv2/lv2plug.in/ns/lv2core/lv2.h" #include "blop_config.h" #include "math_func.h" #include "interpolate.h" diff --git a/src/include/wdatutil.h b/src/include/wdatutil.h index a084c7a..b87b637 100644 --- a/src/include/wdatutil.h +++ b/src/include/wdatutil.h @@ -21,7 +21,7 @@ #define blop_wdatutil_h #include <stdio.h> -#include "lv2/lv2plug.in/ns/lv2core/lv2.h" +#include <stdint.h> #include "math_func.h" #include "wavedata.h" @@ -130,9 +130,9 @@ void wavedata_generate_tables(Wavedata* w, * Returns: 0 on success * -1 otherwise ******************************************************************************/ -int wavedata_write(Wavedata* w, - FILE* wdat_fp, - char* prefix); +int wavedata_write(Wavedata* w, + FILE* wdat_fp, + const char* prefix); #ifdef __cplusplus } /* extern "C" { */ diff --git a/src/wavedata.c b/src/wavedata.c index 24d4c36..e574903 100644 --- a/src/wavedata.c +++ b/src/wavedata.c @@ -17,10 +17,6 @@ along with this software. If not, see <http://www.gnu.org/licenses/>. */ -#include <sys/types.h> -#include <sys/stat.h> -#include <dirent.h> -#include <dlfcn.h> #include <string.h> #include <stdlib.h> #include <stdio.h> @@ -28,6 +24,16 @@ #include "blop_config.h" #include "wavedata.h" +#ifdef _WIN32 +# include <windows.h> +# define dlopen(path, flags) LoadLibrary(path) +# define dlclose(lib) FreeLibrary((HMODULE)lib) +# define dlsym(lib, sym) GetProcAddress((HMODULE)lib, sym) +# define snprintf _snprintf +#else +# include <dlfcn.h> +#endif + int wavedata_load(Wavedata* w, const char* bundle_path, diff --git a/src/wavegen.c b/src/wavegen.c index 53c5db1..c722e04 100644 --- a/src/wavegen.c +++ b/src/wavegen.c @@ -17,13 +17,10 @@ along with this software. If not, see <http://www.gnu.org/licenses/>. */ -#define _POSIX_C_SOURCE 200809L // strdup - #include <stdlib.h> #include <stdio.h> #include <string.h> #include <getopt.h> -#include "lv2/lv2plug.in/ns/lv2core/lv2.h" #include "wdatutil.h" #include "wavedata.h" #include "common.h" @@ -99,9 +96,9 @@ main(int argc, long first_note = -1; long note_step = -1; long min_table_size = -1; - char* filename = NULL; + const char* filename = NULL; FILE* file; - char* prefix = NULL; + const char* prefix = NULL; float gibbs = 0.0f; int quiet = 0; int test = 0; @@ -154,10 +151,10 @@ main(int argc, min_table_size = (long)atoi(optarg); break; case 'o': - filename = strdup(optarg); + filename = optarg; break; case 'p': - prefix = strdup(optarg); + prefix = optarg; break; case 'g': gibbs = atof(optarg); @@ -307,14 +304,6 @@ main(int argc, } } - if (filename) { - free(filename); - } - - if (prefix) { - free(prefix); - } - wavedata_cleanup(w); return 0; diff --git a/src/wdatutil.c b/src/wdatutil.c index 636981b..122feec 100644 --- a/src/wdatutil.c +++ b/src/wdatutil.c @@ -20,7 +20,6 @@ #include <string.h> #include <stdio.h> #include <stdlib.h> -#include "lv2/lv2plug.in/ns/lv2core/lv2.h" #include "common.h" #include "math_func.h" #include "wavedata.h" @@ -243,9 +242,9 @@ wavedata_generate_tables(Wavedata* w, } int -wavedata_write(Wavedata* w, - FILE* wdat_fp, - char* data_name) +wavedata_write(Wavedata* w, + FILE* wdat_fp, + const char* data_name) { Wavetable* t = 0; unsigned long table_count; |