lucy-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From nwelln...@apache.org
Subject [lucy-commits] [1/6] git commit: Define HAS_BOOL in source, not via compiler flags
Date Tue, 22 Apr 2014 20:59:07 GMT
Repository: lucy-clownfish
Updated Branches:
  refs/heads/master 3e5e15e58 -> b7d53da9b


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/48457069
Tree: http://git-wip-us.apache.org/repos/asf/lucy-clownfish/tree/48457069
Diff: http://git-wip-us.apache.org/repos/asf/lucy-clownfish/diff/48457069

Branch: refs/heads/master
Commit: 4845706904f1cbe6e64814a644b06a0d57ca18e2
Parents: f42f56e
Author: Nick Wellnhofer <wellnhofer@aevum.de>
Authored: Sun Feb 16 22:12:19 2014 +0100
Committer: Nick Wellnhofer <wellnhofer@aevum.de>
Committed: Tue Apr 22 21:15:44 2014 +0200

----------------------------------------------------------------------
 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/48457069/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 938da21..e632bc8 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/48457069/compiler/src/CFCPerl.c
----------------------------------------------------------------------
diff --git a/compiler/src/CFCPerl.c b/compiler/src/CFCPerl.c
index fe2bc3a..02fb96b 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/48457069/runtime/common/charmonizer.c
----------------------------------------------------------------------
diff --git a/runtime/common/charmonizer.c b/runtime/common/charmonizer.c
index d0a6bc4..0608f15 100644
--- a/runtime/common/charmonizer.c
+++ b/runtime/common/charmonizer.c
@@ -7079,16 +7079,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/48457069/runtime/common/charmonizer.main
----------------------------------------------------------------------
diff --git a/runtime/common/charmonizer.main b/runtime/common/charmonizer.main
index e6b35a7..3babc4a 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/48457069/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