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
     5namespace libcxx_fix {
     6
     7using std::is_integral;
     8using std::is_same;
     9using std::enable_if;
     10
     11template <class _Tp, class _Tn = void>
     12struct numeric_type
     13{
     14    typedef void type;
     15    static const bool value = false;
     16};
     17
     18template <class _Tp>
     19struct 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
     26template <class _Tp>
     27struct 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
     34template <>
     35struct numeric_type<void, void>
     36{
     37    static const bool value = true;
     38};
     39
     40template <class _A1, class _A2,
     41          bool = numeric_type<_A1>::value &&
     42                 numeric_type<_A2>::value>
     43class promote
     44{};
     45
     46template <class _A1, class _A2>
     47class promote<_A1, _A2, true>
     48{
     49private:
     50    typedef typename numeric_type<_A1>::type __type1;
     51    typedef typename numeric_type<_A2>::type __type2;
     52public:
     53    typedef decltype(__type1() + __type2()) type;
     54};
     55
     56template <class _A1, class _A2>
     57inline _LIBCPP_INLINE_VISIBILITY
     58typename promote<_A1, _A2>::type
     59pow(_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
     
    2525
    2626#include <string>
    2727
    28 #include <base-list.h>
     28#include "base-list.h"
    2929
    3030extern std::string get_comment_text (void);
    3131
  • libinterp/corefcn/oct.h

    diff -ur a/libinterp/corefcn/oct.h b/libinterp/corefcn/oct.h
     
    2828// config.h needs to be first because it includes #defines that can */
    2929// affect other header files.
    3030
    31 #include <config.h>
     31#include "config.h"
    3232
    3333#include "Matrix.h"
    3434
  • libinterp/octave-value/ov-classdef.cc

    diff -ur a/libinterp/octave-value/ov-classdef.cc b/libinterp/octave-value/ov-classdef.cc
     
    19371937  return true;
    19381938}
    19391939
     1940void cdef_object_scalar::mark_as_constructed (const cdef_class& cls)
     1941{
     1942  ctor_list.erase (cls);
     1943}
     1944
    19401945handle_cdef_object::~handle_cdef_object (void)
    19411946{
    19421947#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
     
    438438
    439439  void mark_as_constructed (void) { ctor_list.clear (); }
    440440
    441   void mark_as_constructed (const cdef_class& cls) { ctor_list.erase (cls); }
     441  void mark_as_constructed (const cdef_class& cls);
    442442
    443443  bool is_constructed (void) const { return ctor_list.empty (); }
    444444
  • liboctave/Makefile.in

    diff -ur a/liboctave/Makefile.in b/liboctave/Makefile.in
     
    38643864  operators/Sparse-diag-op-defs.h \
    38653865  operators/Sparse-op-decls.h \
    38663866  operators/Sparse-op-defs.h \
    3867   operators/Sparse-perm-op-defs.h
     3867  operators/Sparse-perm-op-defs.h \
     3868  operators/libcxx-fix.h
    38683869
    38693870OPERATORS_SRC =
    38703871OP_SRCDIR = $(abs_top_srcdir)/liboctave/operators
  • liboctave/operators/module.mk

    diff -ur a/liboctave/operators/module.mk b/liboctave/operators/module.mk
     
    3535  operators/Sparse-diag-op-defs.h \
    3636  operators/Sparse-op-decls.h \
    3737  operators/Sparse-op-defs.h \
    38   operators/Sparse-perm-op-defs.h
     38  operators/Sparse-perm-op-defs.h \
     39  operators/libcxx-fix.h
    3940
    4041## There are no distributed source files in this directory
    4142OPERATORS_SRC =
  • liboctave/operators/mx-inlines.cc

    diff -ur a/liboctave/operators/mx-inlines.cc b/liboctave/operators/mx-inlines.cc
     
    307307
    308308// Let the compiler decide which pow to use, whichever best matches the
    309309// 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"
     313using libcxx_fix::pow;
     314#else
    310315using std::pow;
     316#endif
    311317DEFMXMAPPER2X (mx_inline_pow, pow)
    312318
    313319// Arbitrary function appliers. The function is a template parameter to enable