From c6aa245978d4b436b190fc32446ac6f9edff147d Mon Sep 17 00:00:00 2001 From: gerald Date: Sun, 9 Mar 2014 23:34:47 +0000 Subject: Fix the build with newer compilers (such as GCC 4.7). PR: 187395, 182136 Submitted by: Christoph Moench-Tegeder Approved by: maintainer (Jason Bacon ) --- ...-src-cpp-x10-utils-concurrent-AtomicReference.h | 11 +++++ ...ch-x10.runtime-src-cpp-x10aux-basic_functions.h | 54 ++++++++++++++++++++++ ...patch-x10.runtime-src-cpp-x10aux-string_utils.h | 27 +++++++++++ 3 files changed, 92 insertions(+) create mode 100644 lang/x10/files/patch-x10.runtime-src-cpp-x10-utils-concurrent-AtomicReference.h create mode 100644 lang/x10/files/patch-x10.runtime-src-cpp-x10aux-basic_functions.h create mode 100644 lang/x10/files/patch-x10.runtime-src-cpp-x10aux-string_utils.h (limited to 'lang') diff --git a/lang/x10/files/patch-x10.runtime-src-cpp-x10-utils-concurrent-AtomicReference.h b/lang/x10/files/patch-x10.runtime-src-cpp-x10-utils-concurrent-AtomicReference.h new file mode 100644 index 000000000000..c0f434d47548 --- /dev/null +++ b/lang/x10/files/patch-x10.runtime-src-cpp-x10-utils-concurrent-AtomicReference.h @@ -0,0 +1,11 @@ +--- ../x10.runtime/src-cpp/x10/util/concurrent/AtomicReference.h.orig 2014-03-09 15:50:47.000000000 +0100 ++++ ../x10.runtime/src-cpp/x10/util/concurrent/AtomicReference.h 2014-03-09 15:51:15.000000000 +0100 +@@ -15,6 +15,7 @@ + #include + #include + #include ++#include + #include + #include + + diff --git a/lang/x10/files/patch-x10.runtime-src-cpp-x10aux-basic_functions.h b/lang/x10/files/patch-x10.runtime-src-cpp-x10aux-basic_functions.h new file mode 100644 index 000000000000..dc90f7119387 --- /dev/null +++ b/lang/x10/files/patch-x10.runtime-src-cpp-x10aux-basic_functions.h @@ -0,0 +1,54 @@ +--- ../x10.runtime/src-cpp/x10aux/basic_functions.h.orig 2014-03-09 14:42:17.000000000 +0100 ++++ ../x10.runtime/src-cpp/x10aux/basic_functions.h 2014-03-09 15:44:47.000000000 +0100 +@@ -31,6 +31,27 @@ + + namespace x10aux { + ++ /* prototypes */ ++ inline x10_boolean struct_equals(const x10_double x, const x10_double y); ++ inline x10_boolean struct_equals(const x10_float x, const x10_float y); ++ inline x10_boolean struct_equals(const x10_long x, const x10_long y); ++ inline x10_boolean struct_equals(const x10_int x, const x10_int y); ++ inline x10_boolean struct_equals(const x10_short x, const x10_short y); ++ inline x10_boolean struct_equals(const x10_byte x, const x10_byte y); ++ inline x10_boolean struct_equals(const x10_ulong x, const x10_ulong y); ++ inline x10_boolean struct_equals(const x10_uint x, const x10_uint y); ++ inline x10_boolean struct_equals(const x10_ushort x, const x10_ushort y); ++ inline x10_boolean struct_equals(const x10_ubyte x, const x10_ubyte y); ++ inline x10_boolean struct_equals(const x10_char x, const x10_char y); ++ inline x10_boolean struct_equals(const x10_boolean x, const x10_boolean y); ++ template inline x10_boolean struct_equals(T x, U y); ++ template inline x10_boolean struct_equals(captured_ref_lval x, U y); ++ template inline x10_boolean struct_equals(T x, captured_ref_lval y); ++ template inline x10_boolean struct_equals(captured_ref_lval x, captured_ref_lval y); ++ template inline x10_boolean struct_equals(captured_struct_lval x, U y); ++ template inline x10_boolean struct_equals(T x, captured_struct_lval y); ++ template inline x10_boolean struct_equals(captured_struct_lval x, captured_struct_lval y); ++ + /******* type_name ********/ + + template inline ref type_name(ref x) { +@@ -362,6 +383,23 @@ + + ref to_string(x10_char v); + ++ /* ++ * Wrapers around to_string to translate null to "null" ++ */ ++ template ref safe_to_string(ref v) { ++ if (v.isNull()) return string_utils::lit("null"); ++ return to_string(v); ++ } ++ template ref safe_to_string(captured_ref_lval v) { ++ return safe_to_string(*v); ++ } ++ template ref safe_to_string(captured_struct_lval v) { ++ return to_string(*v); ++ } ++ template ref safe_to_string(T v) { ++ return to_string(v); ++ } ++ + + /******* zeroValue ********/ + template struct Zero { diff --git a/lang/x10/files/patch-x10.runtime-src-cpp-x10aux-string_utils.h b/lang/x10/files/patch-x10.runtime-src-cpp-x10aux-string_utils.h new file mode 100644 index 000000000000..76874958f1d4 --- /dev/null +++ b/lang/x10/files/patch-x10.runtime-src-cpp-x10aux-string_utils.h @@ -0,0 +1,27 @@ +--- ../x10.runtime/src-cpp/x10aux/string_utils.h.orig 2014-03-09 14:42:24.000000000 +0100 ++++ ../x10.runtime/src-cpp/x10aux/string_utils.h 2014-03-09 14:45:00.000000000 +0100 +@@ -38,23 +38,6 @@ + char *strdup(const char*); + char *strndup(const char*, x10_int len); + } +- +- /* +- * Wrapers around to_string to translate null to "null" +- */ +- template ref safe_to_string(ref v) { +- if (v.isNull()) return string_utils::lit("null"); +- return to_string(v); +- } +- template ref safe_to_string(captured_ref_lval v) { +- return safe_to_string(*v); +- } +- template ref safe_to_string(captured_struct_lval v) { +- return to_string(*v); +- } +- template ref safe_to_string(T v) { +- return to_string(v); +- } + } + + + -- cgit