~jtaylor/ubuntu/precise/python-numpy/multiarch-fix-818867

« back to all changes in this revision

Viewing changes to .pc/changeset_r8511.diff/numpy/core/src/private/npy_fpmath.h

  • Committer: Bazaar Package Importer
  • Author(s): Sandro Tosi
  • Date: 2010-10-07 10:19:13 UTC
  • mfrom: (7.1.5 sid)
  • Revision ID: james.westby@ubuntu.com-20101007101913-8b1kmt8ho4upcl9s
Tags: 1:1.4.1-5
* debian/patches/10_use_local_python.org_object.inv_sphinx.diff
  - fixed small typo in description
* debian/patches/changeset_r8364.diff
  - fix memory corruption (double free); thanks to Joseph Barillari for the
    report and to Michael Gilbert for pushing resolution; Closes: #581058

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
#ifndef _NPY_NPY_FPMATH_H_
 
2
#define _NPY_NPY_FPMATH_H_
 
3
 
 
4
#include "npy_config.h"
 
5
 
 
6
#include "numpy/npy_os.h"
 
7
#include "numpy/npy_cpu.h"
 
8
#include "numpy/npy_common.h"
 
9
 
 
10
#ifdef NPY_OS_DARWIN
 
11
    /* This hardcoded logic is fragile, but universal builds makes it
 
12
     * difficult to detect arch-specific features */
 
13
 
 
14
    /* MAC OS X < 10.4 and gcc < 4 does not support proper long double, and
 
15
     * is the same as double on those platforms */
 
16
    #if NPY_BITSOF_LONGDOUBLE == NPY_BITSOF_DOUBLE
 
17
        /* This assumes that FPU and ALU have the same endianness */
 
18
        #if NPY_BYTE_ORDER == NPY_LITTLE_ENDIAN
 
19
            #define HAVE_LDOUBLE_IEEE_DOUBLE_LE
 
20
        #elif NPY_BYTE_ORDER == NPY_BIG_ENDIAN
 
21
            #define HAVE_LDOUBLE_IEEE_DOUBLE_BE
 
22
        #else
 
23
            #error Endianness undefined ?
 
24
        #endif
 
25
    #else
 
26
        #if defined(NPY_CPU_X86)
 
27
            #define HAVE_LDOUBLE_INTEL_EXTENDED_12_BYTES_LE
 
28
        #elif defined(NPY_CPU_AMD64)
 
29
            #define HAVE_LDOUBLE_INTEL_EXTENDED_16_BYTES_LE
 
30
        #elif defined(NPY_CPU_PPC) || defined(NPY_CPU_PPC64)
 
31
            #define HAVE_LDOUBLE_IEEE_DOUBLE_16_BYTES_BE
 
32
        #endif
 
33
    #endif
 
34
#endif
 
35
 
 
36
#if !(defined(HAVE_LDOUBLE_IEEE_QUAD_BE) || \
 
37
      defined(HAVE_LDOUBLE_IEEE_QUAD_LE) || \
 
38
      defined(HAVE_LDOUBLE_IEEE_DOUBLE_LE) || \
 
39
      defined(HAVE_LDOUBLE_IEEE_DOUBLE_BE) || \
 
40
      defined(HAVE_LDOUBLE_IEEE_DOUBLE_16_BYTES_BE) || \
 
41
      defined(HAVE_LDOUBLE_INTEL_EXTENDED_16_BYTES_LE) || \
 
42
      defined(HAVE_LDOUBLE_INTEL_EXTENDED_12_BYTES_LE))
 
43
    #error No long double representation defined
 
44
#endif
 
45
 
 
46
#endif