lucy-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From nwelln...@apache.org
Subject [2/7] git commit: Regenerate charmonizer.c for MinGW
Date Wed, 23 Jul 2014 11:52:25 GMT
Regenerate charmonizer.c for MinGW


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

Branch: refs/heads/master
Commit: 7bd8f8f5cfbf53f4988414fb0561684bad3dfce8
Parents: f44a56c
Author: Nick Wellnhofer <wellnhofer@aevum.de>
Authored: Mon Jul 21 22:34:16 2014 +0200
Committer: Nick Wellnhofer <wellnhofer@aevum.de>
Committed: Mon Jul 21 22:34:16 2014 +0200

----------------------------------------------------------------------
 compiler/common/charmonizer.c | 14 +++++++++++++-
 runtime/common/charmonizer.c  | 14 +++++++++++++-
 2 files changed, 26 insertions(+), 2 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/lucy-clownfish/blob/7bd8f8f5/compiler/common/charmonizer.c
----------------------------------------------------------------------
diff --git a/compiler/common/charmonizer.c b/compiler/common/charmonizer.c
index 8a667db..d3e4e8a 100644
--- a/compiler/common/charmonizer.c
+++ b/compiler/common/charmonizer.c
@@ -6887,7 +6887,19 @@ chaz_SymbolVisibility_run(void) {
         if (chaz_CC_test_compile(code_buf)) {
             can_control_visibility = true;
             chaz_ConfWriter_add_def("EXPORT", export_win);
-            chaz_ConfWriter_add_def("IMPORT", "__declspec(dllimport)");
+            if (chaz_CC_gcc_version_num()) {
+                /*
+                 * Under MinGW, symbols with dllimport storage class aren't
+                 * constant. If a global variable is initialized to such a
+                 * symbol, an "initializer element is not constant" error
+                 * results. Omitting dllimport works, but has a small
+                 * performance penalty.
+                 */
+                chaz_ConfWriter_add_def("IMPORT", NULL);
+            }
+            else {
+                chaz_ConfWriter_add_def("IMPORT", "__declspec(dllimport)");
+            }
         }
     }
 

http://git-wip-us.apache.org/repos/asf/lucy-clownfish/blob/7bd8f8f5/runtime/common/charmonizer.c
----------------------------------------------------------------------
diff --git a/runtime/common/charmonizer.c b/runtime/common/charmonizer.c
index d44c2fe..e16cb36 100644
--- a/runtime/common/charmonizer.c
+++ b/runtime/common/charmonizer.c
@@ -6887,7 +6887,19 @@ chaz_SymbolVisibility_run(void) {
         if (chaz_CC_test_compile(code_buf)) {
             can_control_visibility = true;
             chaz_ConfWriter_add_def("EXPORT", export_win);
-            chaz_ConfWriter_add_def("IMPORT", "__declspec(dllimport)");
+            if (chaz_CC_gcc_version_num()) {
+                /*
+                 * Under MinGW, symbols with dllimport storage class aren't
+                 * constant. If a global variable is initialized to such a
+                 * symbol, an "initializer element is not constant" error
+                 * results. Omitting dllimport works, but has a small
+                 * performance penalty.
+                 */
+                chaz_ConfWriter_add_def("IMPORT", NULL);
+            }
+            else {
+                chaz_ConfWriter_add_def("IMPORT", "__declspec(dllimport)");
+            }
         }
     }
 


Mime
View raw message