Ticket #48622: patch-rollup.diff
File patch-rollup.diff, 5.2 KB (added by Schamschula (Marius Schamschula), 9 years ago) |
---|
-
new file liboctave/operators/libcxx-fix.h
diff -ur a/liboctave/operators/libcxx-fix.h b/liboctave/operators/libcxx-fix.h
- + 1 #ifndef _LIBCPP_VERSION 2 #error "for libc++ only" 3 #endif 4 5 namespace libcxx_fix { 6 7 using std::is_integral; 8 using std::is_same; 9 using std::enable_if; 10 11 template <class _Tp, class _Tn = void> 12 struct numeric_type 13 { 14 typedef void type; 15 static const bool value = false; 16 }; 17 18 template <class _Tp> 19 struct numeric_type<_Tp, typename enable_if<is_integral<_Tp>::value || 20 is_same<_Tp, double>::value>::type> 21 { 22 typedef double type; 23 static const bool value = true; 24 }; 25 26 template <class _Tp> 27 struct numeric_type<_Tp, typename enable_if<is_same<_Tp, long double>::value || 28 is_same<_Tp, float>::value>::type> 29 { 30 typedef _Tp type; 31 static const bool value = true; 32 }; 33 34 template <> 35 struct numeric_type<void, void> 36 { 37 static const bool value = true; 38 }; 39 40 template <class _A1, class _A2, 41 bool = numeric_type<_A1>::value && 42 numeric_type<_A2>::value> 43 class promote 44 {}; 45 46 template <class _A1, class _A2> 47 class promote<_A1, _A2, true> 48 { 49 private: 50 typedef typename numeric_type<_A1>::type __type1; 51 typedef typename numeric_type<_A2>::type __type2; 52 public: 53 typedef decltype(__type1() + __type2()) type; 54 }; 55 56 template <class _A1, class _A2> 57 inline _LIBCPP_INLINE_VISIBILITY 58 typename promote<_A1, _A2>::type 59 pow(_A1 __x, _A2 __y) _NOEXCEPT 60 { 61 typedef typename promote<_A1, _A2>::type __result_type; 62 #if _LIBCPP_STD_VER > 11 63 static_assert((!(is_same<_A1, __result_type>::value && 64 is_same<_A2, __result_type>::value)), ""); 65 #endif 66 return ::pow(static_cast<__result_type>(__x), static_cast<__result_type>(__y)); 67 } 68 69 } -
libinterp/corefcn/comment-list.h
diff -ur a/libinterp/corefcn/comment-list.h b/libinterp/corefcn/comment-list.h
25 25 26 26 #include <string> 27 27 28 #include <base-list.h>28 #include "base-list.h" 29 29 30 30 extern std::string get_comment_text (void); 31 31 -
libinterp/corefcn/oct.h
diff -ur a/libinterp/corefcn/oct.h b/libinterp/corefcn/oct.h
28 28 // config.h needs to be first because it includes #defines that can */ 29 29 // affect other header files. 30 30 31 #include <config.h>31 #include "config.h" 32 32 33 33 #include "Matrix.h" 34 34 -
libinterp/octave-value/ov-classdef.cc
diff -ur a/libinterp/octave-value/ov-classdef.cc b/libinterp/octave-value/ov-classdef.cc
1937 1937 return true; 1938 1938 } 1939 1939 1940 void cdef_object_scalar::mark_as_constructed (const cdef_class& cls) 1941 { 1942 ctor_list.erase (cls); 1943 } 1944 1940 1945 handle_cdef_object::~handle_cdef_object (void) 1941 1946 { 1942 1947 #if DEBUG_TRACE -
libinterp/octave-value/ov-classdef.h
diff -ur a/libinterp/octave-value/ov-classdef.h b/libinterp/octave-value/ov-classdef.h
438 438 439 439 void mark_as_constructed (void) { ctor_list.clear (); } 440 440 441 void mark_as_constructed (const cdef_class& cls) { ctor_list.erase (cls); }441 void mark_as_constructed (const cdef_class& cls); 442 442 443 443 bool is_constructed (void) const { return ctor_list.empty (); } 444 444 -
liboctave/Makefile.in
diff -ur a/liboctave/Makefile.in b/liboctave/Makefile.in
3864 3864 operators/Sparse-diag-op-defs.h \ 3865 3865 operators/Sparse-op-decls.h \ 3866 3866 operators/Sparse-op-defs.h \ 3867 operators/Sparse-perm-op-defs.h 3867 operators/Sparse-perm-op-defs.h \ 3868 operators/libcxx-fix.h 3868 3869 3869 3870 OPERATORS_SRC = 3870 3871 OP_SRCDIR = $(abs_top_srcdir)/liboctave/operators -
liboctave/operators/module.mk
diff -ur a/liboctave/operators/module.mk b/liboctave/operators/module.mk
35 35 operators/Sparse-diag-op-defs.h \ 36 36 operators/Sparse-op-decls.h \ 37 37 operators/Sparse-op-defs.h \ 38 operators/Sparse-perm-op-defs.h 38 operators/Sparse-perm-op-defs.h \ 39 operators/libcxx-fix.h 39 40 40 41 ## There are no distributed source files in this directory 41 42 OPERATORS_SRC = -
liboctave/operators/mx-inlines.cc
diff -ur a/liboctave/operators/mx-inlines.cc b/liboctave/operators/mx-inlines.cc
307 307 308 308 // Let the compiler decide which pow to use, whichever best matches the 309 309 // arguments provided. 310 #if defined(_LIBCPP_VERSION) && (_LIBCPP_VERSION >= 1101) 311 // Workaround http://llvm.org/bugs/show_bug.cgi?id=21083 312 #include "libcxx-fix.h" 313 using libcxx_fix::pow; 314 #else 310 315 using std::pow; 316 #endif 311 317 DEFMXMAPPER2X (mx_inline_pow, pow) 312 318 313 319 // Arbitrary function appliers. The function is a template parameter to enable