annotate src/default-octave-1-inttypes.patch @ 4159:c190f2cae988

update patches for default-octave * src/default-octave-1-inttypes.patch: New file. Temporary patch until this issue is fixed in Octave sources. * src/default-octave-1-fixes.patch: Delete obsolete patch. * src/mingw-default-octave-1-msys-fixes.patch: Likewise.
author John W. Eaton <jwe@octave.org>
date Sat, 18 Jun 2016 18:49:15 -0400
parents
children
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
4159
c190f2cae988 update patches for default-octave
John W. Eaton <jwe@octave.org>
parents:
diff changeset
1 diff -ur octave-4.1.0+.orig/liboctave/util/oct-inttypes.cc octave-4.1.0+/liboctave/util/oct-inttypes.cc
c190f2cae988 update patches for default-octave
John W. Eaton <jwe@octave.org>
parents:
diff changeset
2 --- octave-4.1.0+.orig/liboctave/util/oct-inttypes.cc 2016-06-17 14:01:56.000000000 -0400
c190f2cae988 update patches for default-octave
John W. Eaton <jwe@octave.org>
parents:
diff changeset
3 +++ octave-4.1.0+/liboctave/util/oct-inttypes.cc 2016-06-17 19:52:03.943017663 -0400
c190f2cae988 update patches for default-octave
John W. Eaton <jwe@octave.org>
parents:
diff changeset
4 @@ -105,7 +105,31 @@
c190f2cae988 update patches for default-octave
John W. Eaton <jwe@octave.org>
parents:
diff changeset
5
c190f2cae988 update patches for default-octave
John W. Eaton <jwe@octave.org>
parents:
diff changeset
6 #if defined (OCTAVE_ENSURE_LONG_DOUBLE_OPERATIONS_ARE_NOT_TRUNCATED)
c190f2cae988 update patches for default-octave
John W. Eaton <jwe@octave.org>
parents:
diff changeset
7
c190f2cae988 update patches for default-octave
John W. Eaton <jwe@octave.org>
parents:
diff changeset
8 -#define DEFINE_OCTAVE_LONG_DOUBLE_CMP_OP_TEMPLATES(T) \
c190f2cae988 update patches for default-octave
John W. Eaton <jwe@octave.org>
parents:
diff changeset
9 +typedef unsigned short fpucw_t; /* glibc calls this fpu_control_t */
c190f2cae988 update patches for default-octave
John W. Eaton <jwe@octave.org>
parents:
diff changeset
10 +
c190f2cae988 update patches for default-octave
John W. Eaton <jwe@octave.org>
parents:
diff changeset
11 +# define FPU_PC_MASK 0x0300
c190f2cae988 update patches for default-octave
John W. Eaton <jwe@octave.org>
parents:
diff changeset
12 +# define FPU_PC_DOUBLE 0x200 /* glibc calls this _FPU_DOUBLE */
c190f2cae988 update patches for default-octave
John W. Eaton <jwe@octave.org>
parents:
diff changeset
13 +# define FPU_PC_EXTENDED 0x300 /* glibc calls this _FPU_EXTENDED */
c190f2cae988 update patches for default-octave
John W. Eaton <jwe@octave.org>
parents:
diff changeset
14 +
c190f2cae988 update patches for default-octave
John W. Eaton <jwe@octave.org>
parents:
diff changeset
15 +# define GET_FPUCW() \
c190f2cae988 update patches for default-octave
John W. Eaton <jwe@octave.org>
parents:
diff changeset
16 + ({ fpucw_t _cw; \
c190f2cae988 update patches for default-octave
John W. Eaton <jwe@octave.org>
parents:
diff changeset
17 + __asm__ __volatile__ ("fnstcw %0" : "=m" (*&_cw)); \
c190f2cae988 update patches for default-octave
John W. Eaton <jwe@octave.org>
parents:
diff changeset
18 + _cw; \
c190f2cae988 update patches for default-octave
John W. Eaton <jwe@octave.org>
parents:
diff changeset
19 + })
c190f2cae988 update patches for default-octave
John W. Eaton <jwe@octave.org>
parents:
diff changeset
20 +# define SET_FPUCW(word) \
c190f2cae988 update patches for default-octave
John W. Eaton <jwe@octave.org>
parents:
diff changeset
21 + (void)({ fpucw_t _ncw = (word); \
c190f2cae988 update patches for default-octave
John W. Eaton <jwe@octave.org>
parents:
diff changeset
22 + __asm__ __volatile__ ("fldcw %0" : : "m" (*&_ncw)); \
c190f2cae988 update patches for default-octave
John W. Eaton <jwe@octave.org>
parents:
diff changeset
23 + })
c190f2cae988 update patches for default-octave
John W. Eaton <jwe@octave.org>
parents:
diff changeset
24 +
c190f2cae988 update patches for default-octave
John W. Eaton <jwe@octave.org>
parents:
diff changeset
25 +# define DECL_LONG_DOUBLE_ROUNDING \
c190f2cae988 update patches for default-octave
John W. Eaton <jwe@octave.org>
parents:
diff changeset
26 + fpucw_t oldcw;
c190f2cae988 update patches for default-octave
John W. Eaton <jwe@octave.org>
parents:
diff changeset
27 +# define BEGIN_LONG_DOUBLE_ROUNDING() \
c190f2cae988 update patches for default-octave
John W. Eaton <jwe@octave.org>
parents:
diff changeset
28 + (void)(oldcw = GET_FPUCW (), \
c190f2cae988 update patches for default-octave
John W. Eaton <jwe@octave.org>
parents:
diff changeset
29 + SET_FPUCW ((oldcw & ~FPU_PC_MASK) | FPU_PC_EXTENDED))
c190f2cae988 update patches for default-octave
John W. Eaton <jwe@octave.org>
parents:
diff changeset
30 +# define END_LONG_DOUBLE_ROUNDING() \
c190f2cae988 update patches for default-octave
John W. Eaton <jwe@octave.org>
parents:
diff changeset
31 + SET_FPUCW (oldcw)
c190f2cae988 update patches for default-octave
John W. Eaton <jwe@octave.org>
parents:
diff changeset
32 +
c190f2cae988 update patches for default-octave
John W. Eaton <jwe@octave.org>
parents:
diff changeset
33 +#define DEFINE_OCTAVE_LONG_DOUBLE_CMP_OP_TEMPLATES(T) \
c190f2cae988 update patches for default-octave
John W. Eaton <jwe@octave.org>
parents:
diff changeset
34 template <typename xop> \
c190f2cae988 update patches for default-octave
John W. Eaton <jwe@octave.org>
parents:
diff changeset
35 bool \
c190f2cae988 update patches for default-octave
John W. Eaton <jwe@octave.org>
parents:
diff changeset
36 octave_int_cmp_op::external_mop (double x, T y) \