From 97a1c3c55874ef48ea591146ee16fdb0c76a730f Mon Sep 17 00:00:00 2001 From: David Robillard Date: Fri, 3 Aug 2012 17:56:44 +0000 Subject: Fix compilation with MSVC. --- lv2/lv2plug.in/ns/ext/atom/atom-test.c | 4 ++-- lv2/lv2plug.in/ns/ext/log/log.h | 2 +- wscript | 5 ++++- 3 files changed, 7 insertions(+), 4 deletions(-) diff --git a/lv2/lv2plug.in/ns/ext/atom/atom-test.c b/lv2/lv2plug.in/ns/ext/atom/atom-test.c index 8fcf751..67396d9 100644 --- a/lv2/lv2plug.in/ns/ext/atom/atom-test.c +++ b/lv2/lv2plug.in/ns/ext/atom/atom-test.c @@ -176,7 +176,7 @@ main() LV2_Atom_String* string = (LV2_Atom_String*)lv2_atom_forge_deref( &forge, lv2_atom_forge_string( &forge, "hello", strlen("hello"))); - char* sbody = LV2_ATOM_BODY(string); + char* sbody = (char*)LV2_ATOM_BODY(string); if (strcmp(sbody, "hello")) { return test_fail("%s != \"hello\"\n", sbody); } @@ -187,7 +187,7 @@ main() &forge, lv2_atom_forge_literal( &forge, "bonjour", strlen("bonjour"), 0, urid_map(NULL, "http://lexvo.org/id/term/fr"))); - char* lbody = LV2_ATOM_CONTENTS(LV2_Atom_Literal, literal); + char* lbody = (char*)LV2_ATOM_CONTENTS(LV2_Atom_Literal, literal); if (strcmp(lbody, "bonjour")) { return test_fail("%s != \"bonjour\"\n", lbody); } diff --git a/lv2/lv2plug.in/ns/ext/log/log.h b/lv2/lv2plug.in/ns/ext/log/log.h index 8521ea8..2279fa3 100644 --- a/lv2/lv2plug.in/ns/ext/log/log.h +++ b/lv2/lv2plug.in/ns/ext/log/log.h @@ -44,7 +44,7 @@ extern "C" { /** Allow type checking of printf-like functions. */ # define LV2_LOG_FUNC(fmt, arg1) __attribute__((format(printf, fmt, arg1))) #else -# define LV2_LOG_FUNC +# define LV2_LOG_FUNC(fmt, arg1) #endif /** diff --git a/wscript b/wscript index 18381a9..9254b95 100644 --- a/wscript +++ b/wscript @@ -54,7 +54,10 @@ def configure(conf): autowaf.configure(conf) autowaf.set_recursive() - conf.env.append_unique('CFLAGS', '-std=c99') + if conf.env['MSVC_COMPILER']: + conf.env.append_unique('CFLAGS', ['-TP', '-MD']) + else: + conf.env.append_unique('CFLAGS', '-std=c99') conf.env['BUILD_TESTS'] = Options.options.build_tests conf.env['BUILD_PLUGINS'] = not Options.options.no_plugins -- cgit v1.2.1