Repository: lucy-clownfish
Updated Branches:
  refs/heads/thread_safe_errors c9a86b0dc -> d33f93b96


C89 fixes for charmonizer.main


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

Branch: refs/heads/thread_safe_errors
Commit: 8abf8ed9e5219527d7f02d1a57214fde56829e63
Parents: c9a86b0
Author: Nick Wellnhofer <[email protected]>
Authored: Sat Dec 27 14:13:40 2014 +0100
Committer: Nick Wellnhofer <[email protected]>
Committed: Sat Dec 27 14:13:40 2014 +0100

----------------------------------------------------------------------
 runtime/common/charmonizer.c    | 21 +++++++++++----------
 runtime/common/charmonizer.main | 21 +++++++++++----------
 2 files changed, 22 insertions(+), 20 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/lucy-clownfish/blob/8abf8ed9/runtime/common/charmonizer.c
----------------------------------------------------------------------
diff --git a/runtime/common/charmonizer.c b/runtime/common/charmonizer.c
index 6875a38..8e2aeec 100644
--- a/runtime/common/charmonizer.c
+++ b/runtime/common/charmonizer.c
@@ -8258,6 +8258,16 @@ S_ends_with(const char *string, const char *postfix) {
 
 static int
 S_need_libpthread(chaz_CLI *cli) {
+    static const char source[] =
+        "#include <pthread.h>\n"
+        "\n"
+        "int main() {\n"
+        "    pthread_create(0, 0, 0, 0);\n"
+        "    pthread_key_create(0, 0);\n"
+        "    return 0;\n"
+        "}\n";
+    chaz_CFlags *temp_cflags;
+
     if (chaz_CLI_defined(cli, "disable-threads")
         || strcmp(chaz_CLI_strval(cli, "host"), "c") != 0
         || chaz_HeadCheck_check_header("windows.h")
@@ -8269,20 +8279,11 @@ S_need_libpthread(chaz_CLI *cli) {
         chaz_Util_die("pthread.h not found. Try --disable-threads.");
     }
 
-    static const char source[] =
-        "#include <pthread.h>\n"
-        "\n"
-        "int main() {\n"
-        "    pthread_create(0, 0, 0, 0);\n"
-        "    pthread_key_create(0, 0);\n"
-        "    return 0;\n"
-        "}\n";
-
     if (chaz_CC_test_link(source)) {
         return 0;
     }
 
-    chaz_CFlags *temp_cflags = chaz_CC_get_temp_cflags();
+    temp_cflags = chaz_CC_get_temp_cflags();
     chaz_CFlags_add_external_library(temp_cflags, "pthread");
     if (!chaz_CC_test_link(source)) {
         chaz_Util_die("Can't link with libpthread. Try --disable-threads.");

http://git-wip-us.apache.org/repos/asf/lucy-clownfish/blob/8abf8ed9/runtime/common/charmonizer.main
----------------------------------------------------------------------
diff --git a/runtime/common/charmonizer.main b/runtime/common/charmonizer.main
index 83981af..207b607 100644
--- a/runtime/common/charmonizer.main
+++ b/runtime/common/charmonizer.main
@@ -560,6 +560,16 @@ S_ends_with(const char *string, const char *postfix) {
 
 static int
 S_need_libpthread(chaz_CLI *cli) {
+    static const char source[] =
+        "#include <pthread.h>\n"
+        "\n"
+        "int main() {\n"
+        "    pthread_create(0, 0, 0, 0);\n"
+        "    pthread_key_create(0, 0);\n"
+        "    return 0;\n"
+        "}\n";
+    chaz_CFlags *temp_cflags;
+
     if (chaz_CLI_defined(cli, "disable-threads")
         || strcmp(chaz_CLI_strval(cli, "host"), "c") != 0
         || chaz_HeadCheck_check_header("windows.h")
@@ -571,20 +581,11 @@ S_need_libpthread(chaz_CLI *cli) {
         chaz_Util_die("pthread.h not found. Try --disable-threads.");
     }
 
-    static const char source[] =
-        "#include <pthread.h>\n"
-        "\n"
-        "int main() {\n"
-        "    pthread_create(0, 0, 0, 0);\n"
-        "    pthread_key_create(0, 0);\n"
-        "    return 0;\n"
-        "}\n";
-
     if (chaz_CC_test_link(source)) {
         return 0;
     }
 
-    chaz_CFlags *temp_cflags = chaz_CC_get_temp_cflags();
+    temp_cflags = chaz_CC_get_temp_cflags();
     chaz_CFlags_add_external_library(temp_cflags, "pthread");
     if (!chaz_CC_test_link(source)) {
         chaz_Util_die("Can't link with libpthread. Try --disable-threads.");

Reply via email to