You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@lucy.apache.org by nw...@apache.org on 2012/11/18 19:46:19 UTC

[lucy-commits] [1/23] git commit: refs/heads/c99-types - Define HAS_BOOL during compilation

Updated Branches:
  refs/heads/c99-types [created] 2c37b95ae


Define HAS_BOOL during compilation

Without HAS_BOOL, the Perl headers might redefine the 'bool' type
which causes all kinds of problems. This also means that we must
include "charmony.h" before any Perl headers now.


Project: http://git-wip-us.apache.org/repos/asf/lucy/repo
Commit: http://git-wip-us.apache.org/repos/asf/lucy/commit/2c37b95a
Tree: http://git-wip-us.apache.org/repos/asf/lucy/tree/2c37b95a
Diff: http://git-wip-us.apache.org/repos/asf/lucy/diff/2c37b95a

Branch: refs/heads/c99-types
Commit: 2c37b95ae107d417ab3c7393b805e4d184b169dc
Parents: 98bb68e
Author: Nick Wellnhofer <we...@aevum.de>
Authored: Sun Nov 18 18:53:33 2012 +0100
Committer: Nick Wellnhofer <we...@aevum.de>
Committed: Sun Nov 18 19:37:10 2012 +0100

----------------------------------------------------------------------
 .../compiler/perl/lib/Clownfish/CFC/Perl/Build.pm  |    2 ++
 clownfish/compiler/src/CFCPerl.c                   |    1 +
 2 files changed, 3 insertions(+), 0 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/lucy/blob/2c37b95a/clownfish/compiler/perl/lib/Clownfish/CFC/Perl/Build.pm
----------------------------------------------------------------------
diff --git a/clownfish/compiler/perl/lib/Clownfish/CFC/Perl/Build.pm b/clownfish/compiler/perl/lib/Clownfish/CFC/Perl/Build.pm
index b0fe049..4bfb0e1 100644
--- a/clownfish/compiler/perl/lib/Clownfish/CFC/Perl/Build.pm
+++ b/clownfish/compiler/perl/lib/Clownfish/CFC/Perl/Build.pm
@@ -70,6 +70,8 @@ sub new {
         # Redefine 'for' to fix broken 'for' scoping under MSVC6.
         push @$extra_ccflags, '-Dfor="if(0);else for"';
     }
+    # Define HAS_BOOL, so that the Perl headers don't redefine 'bool'.
+    push @$extra_ccflags, '-DHAS_BOOL';
     $self->extra_compiler_flags(@$extra_ccflags);
 
     # TODO: use Charmonizer to determine whether pthreads are userland.

http://git-wip-us.apache.org/repos/asf/lucy/blob/2c37b95a/clownfish/compiler/src/CFCPerl.c
----------------------------------------------------------------------
diff --git a/clownfish/compiler/src/CFCPerl.c b/clownfish/compiler/src/CFCPerl.c
index 814dbec..31a1a45 100644
--- a/clownfish/compiler/src/CFCPerl.c
+++ b/clownfish/compiler/src/CFCPerl.c
@@ -297,6 +297,7 @@ S_write_boot_c(CFCPerl *self) {
     const char pattern[] =
         "%s\n"
         "\n"
+        "#include \"charmony.h\"\n"
         "#include \"EXTERN.h\"\n"
         "#include \"perl.h\"\n"
         "#include \"XSUB.h\"\n"