Restore lost HAS_BOOL flag, fixing MSVC build. Our core source files don't need -DHAS_BOOL, but files such as perl/xs/Lucy/Document/Doc.c which "fill in" functions left incomplete by the core and pound-include the Perl headers need it.
Project: http://git-wip-us.apache.org/repos/asf/lucy/repo Commit: http://git-wip-us.apache.org/repos/asf/lucy/commit/5dc5b8bb Tree: http://git-wip-us.apache.org/repos/asf/lucy/tree/5dc5b8bb Diff: http://git-wip-us.apache.org/repos/asf/lucy/diff/5dc5b8bb Branch: refs/heads/master Commit: 5dc5b8bb463f3a135dc73e10e9a28a5b1bc1af4e Parents: b6e98ef Author: Marvin Humphrey <[email protected]> Authored: Thu Dec 13 19:39:21 2012 -0800 Committer: Marvin Humphrey <[email protected]> Committed: Wed Jan 2 12:10:12 2013 -0800 ---------------------------------------------------------------------- clownfish/runtime/common/charmonizer.c | 10 ++++++++++ clownfish/runtime/common/charmonizer.main | 10 ++++++++++ common/charmonizer.c | 10 ++++++++++ common/charmonizer.main | 10 ++++++++++ 4 files changed, 40 insertions(+), 0 deletions(-) ---------------------------------------------------------------------- http://git-wip-us.apache.org/repos/asf/lucy/blob/5dc5b8bb/clownfish/runtime/common/charmonizer.c ---------------------------------------------------------------------- diff --git a/clownfish/runtime/common/charmonizer.c b/clownfish/runtime/common/charmonizer.c index 2426098..94b0696 100644 --- a/clownfish/runtime/common/charmonizer.c +++ b/clownfish/runtime/common/charmonizer.c @@ -4896,6 +4896,16 @@ S_add_compiler_flags(struct chaz_CLIArgs *args) { /* Redefine 'for' to fix broken 'for' scoping under MSVC6. */ chaz_CC_add_extra_cflags("-Dfor=\"if(0);else for\""); + + /* When compiling for Perl bindings, define HAS_BOOL so that the Perl + * headers don't redefine 'bool' in conflict with C++. + * + * TODO: Compile all files that #include Perl headers separately and + * remove this directive. + */ + if (args->charmony_pm) { + chaz_CC_add_extra_cflags("-DHAS_BOOL"); + } } } http://git-wip-us.apache.org/repos/asf/lucy/blob/5dc5b8bb/clownfish/runtime/common/charmonizer.main ---------------------------------------------------------------------- diff --git a/clownfish/runtime/common/charmonizer.main b/clownfish/runtime/common/charmonizer.main index 56c83a0..cb3649c 100644 --- a/clownfish/runtime/common/charmonizer.main +++ b/clownfish/runtime/common/charmonizer.main @@ -66,6 +66,16 @@ S_add_compiler_flags(struct chaz_CLIArgs *args) { /* Redefine 'for' to fix broken 'for' scoping under MSVC6. */ chaz_CC_add_extra_cflags("-Dfor=\"if(0);else for\""); + + /* When compiling for Perl bindings, define HAS_BOOL so that the Perl + * headers don't redefine 'bool' in conflict with C++. + * + * TODO: Compile all files that #include Perl headers separately and + * remove this directive. + */ + if (args->charmony_pm) { + chaz_CC_add_extra_cflags("-DHAS_BOOL"); + } } } http://git-wip-us.apache.org/repos/asf/lucy/blob/5dc5b8bb/common/charmonizer.c ---------------------------------------------------------------------- diff --git a/common/charmonizer.c b/common/charmonizer.c index ca984d3..f1b212e 100644 --- a/common/charmonizer.c +++ b/common/charmonizer.c @@ -4895,6 +4895,16 @@ S_add_compiler_flags(struct chaz_CLIArgs *args) { /* Redefine 'for' to fix broken 'for' scoping under MSVC6. */ chaz_CC_add_extra_cflags("-Dfor=\"if(0);else for\""); + + /* When compiling for Perl bindings, define HAS_BOOL so that the Perl + * headers don't redefine 'bool' in conflict with C++. + * + * TODO: Compile all files that #include Perl headers separately and + * remove this directive. + */ + if (args->charmony_pm) { + chaz_CC_add_extra_cflags("-DHAS_BOOL"); + } } } http://git-wip-us.apache.org/repos/asf/lucy/blob/5dc5b8bb/common/charmonizer.main ---------------------------------------------------------------------- diff --git a/common/charmonizer.main b/common/charmonizer.main index c8a6d24..0ce07e7 100644 --- a/common/charmonizer.main +++ b/common/charmonizer.main @@ -65,6 +65,16 @@ S_add_compiler_flags(struct chaz_CLIArgs *args) { /* Redefine 'for' to fix broken 'for' scoping under MSVC6. */ chaz_CC_add_extra_cflags("-Dfor=\"if(0);else for\""); + + /* When compiling for Perl bindings, define HAS_BOOL so that the Perl + * headers don't redefine 'bool' in conflict with C++. + * + * TODO: Compile all files that #include Perl headers separately and + * remove this directive. + */ + if (args->charmony_pm) { + chaz_CC_add_extra_cflags("-DHAS_BOOL"); + } } }
