lucy-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From nwelln...@apache.org
Subject [lucy-commits] [4/6] git commit: Define HAS_BOOL in source, not via compiler flags
Date Sun, 16 Feb 2014 23:20:05 GMT
Define HAS_BOOL in source, not via compiler flags


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

Branch: refs/heads/cflags
Commit: 3371dd14c1deb347a30695945d5bf57916e0c4d9
Parents: 9904253
Author: Nick Wellnhofer <wellnhofer@aevum.de>
Authored: Sun Feb 16 22:12:19 2014 +0100
Committer: Nick Wellnhofer <wellnhofer@aevum.de>
Committed: Mon Feb 17 00:18:42 2014 +0100

----------------------------------------------------------------------
 compiler/perl/lib/Clownfish/CFC/Perl/Build.pm |  5 -----
 compiler/src/CFCPerl.c                        |  4 ++++
 runtime/common/charmonizer.c                  | 10 ----------
 runtime/common/charmonizer.main               | 10 ----------
 runtime/perl/xs/XSBind.h                      |  2 ++
 5 files changed, 6 insertions(+), 25 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/lucy-clownfish/blob/3371dd14/compiler/perl/lib/Clownfish/CFC/Perl/Build.pm
----------------------------------------------------------------------
diff --git a/compiler/perl/lib/Clownfish/CFC/Perl/Build.pm b/compiler/perl/lib/Clownfish/CFC/Perl/Build.pm
index eef8621..1811bbd 100644
--- a/compiler/perl/lib/Clownfish/CFC/Perl/Build.pm
+++ b/compiler/perl/lib/Clownfish/CFC/Perl/Build.pm
@@ -58,11 +58,6 @@ my $BUILDLIB_DIR = 'buildlib';
 sub new {
     my $self = shift->SUPER::new( @_ );
 
-    # Define HAS_BOOL, so that the Perl headers don't redefine 'bool'.
-    my $extra_ccflags = $self->extra_compiler_flags;
-    push @$extra_ccflags, '-DHAS_BOOL';
-    $self->extra_compiler_flags(@$extra_ccflags);
-
     # TODO: use Charmonizer to determine whether pthreads are userland.
     if ( $Config{osname} =~ /openbsd/i && $Config{usethreads} ) {
         my $extra_ldflags = $self->extra_linker_flags;

http://git-wip-us.apache.org/repos/asf/lucy-clownfish/blob/3371dd14/compiler/src/CFCPerl.c
----------------------------------------------------------------------
diff --git a/compiler/src/CFCPerl.c b/compiler/src/CFCPerl.c
index 2c873f5..7c3c639 100644
--- a/compiler/src/CFCPerl.c
+++ b/compiler/src/CFCPerl.c
@@ -270,9 +270,13 @@ S_write_boot_c(CFCPerl *self) {
         "%s\n"
         "\n"
         "#include \"cfish_parcel.h\"\n"
+        "\n"
+        "/* Avoid conflicts with Clownfish bool type. */\n"
+        "#define HAS_BOOL\n"
         "#include \"EXTERN.h\"\n"
         "#include \"perl.h\"\n"
         "#include \"XSUB.h\"\n"
+        "\n"
         "#include \"boot.h\"\n"
         "#include \"Clownfish/String.h\"\n"
         "#include \"Clownfish/VTable.h\"\n"

http://git-wip-us.apache.org/repos/asf/lucy-clownfish/blob/3371dd14/runtime/common/charmonizer.c
----------------------------------------------------------------------
diff --git a/runtime/common/charmonizer.c b/runtime/common/charmonizer.c
index 24fbedb..382cbe2 100644
--- a/runtime/common/charmonizer.c
+++ b/runtime/common/charmonizer.c
@@ -7075,16 +7075,6 @@ S_add_compiler_flags(struct chaz_CLIArgs *args) {
         }
     }
 
-    /* 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_CFlags_add_define(extra_cflags, "HAS_BOOL", NULL);
-    }
-
     chaz_CFlags_add_define(extra_cflags, "CFP_CFISH", NULL);
     chaz_CFlags_add_define(extra_cflags, "CFP_TESTCFISH", NULL);
 }

http://git-wip-us.apache.org/repos/asf/lucy-clownfish/blob/3371dd14/runtime/common/charmonizer.main
----------------------------------------------------------------------
diff --git a/runtime/common/charmonizer.main b/runtime/common/charmonizer.main
index 5db08b1..1cba2c5 100644
--- a/runtime/common/charmonizer.main
+++ b/runtime/common/charmonizer.main
@@ -81,16 +81,6 @@ S_add_compiler_flags(struct chaz_CLIArgs *args) {
         }
     }
 
-    /* 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_CFlags_add_define(extra_cflags, "HAS_BOOL", NULL);
-    }
-
     chaz_CFlags_add_define(extra_cflags, "CFP_CFISH", NULL);
     chaz_CFlags_add_define(extra_cflags, "CFP_TESTCFISH", NULL);
 }

http://git-wip-us.apache.org/repos/asf/lucy-clownfish/blob/3371dd14/runtime/perl/xs/XSBind.h
----------------------------------------------------------------------
diff --git a/runtime/perl/xs/XSBind.h b/runtime/perl/xs/XSBind.h
index e37058c..5df36f9 100644
--- a/runtime/perl/xs/XSBind.h
+++ b/runtime/perl/xs/XSBind.h
@@ -29,6 +29,8 @@
 #include "Clownfish/VArray.h"
 #include "Clownfish/VTable.h"
 
+/* Avoid conflicts with Clownfish bool type. */
+#define HAS_BOOL
 #include "EXTERN.h"
 #include "perl.h"
 #include "XSUB.h"


Mime
View raw message