Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix headers #2888

Merged
merged 7 commits into from
Jan 6, 2013
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
11 changes: 0 additions & 11 deletions numpy/core/include/numpy/arrayobject.h
Original file line number Diff line number Diff line change
@@ -1,14 +1,3 @@

/* This expects the following variables to be defined (besides
the usual ones from pyconfig.h

SIZEOF_LONG_DOUBLE -- sizeof(long double) or sizeof(double) if no
long double is present on platform.
CHAR_BIT -- number of bits in a char (usually 8)
(should be in limits.h)

*/

#ifndef Py_ARRAYOBJECT_H
#define Py_ARRAYOBJECT_H

Expand Down
3 changes: 0 additions & 3 deletions numpy/core/include/numpy/ndarraytypes.h
Original file line number Diff line number Diff line change
@@ -1,9 +1,6 @@
#ifndef NDARRAYTYPES_H
#define NDARRAYTYPES_H

/* numpyconfig.h is auto-generated by the installer */
#include "numpyconfig.h"

#include "npy_common.h"
#include "npy_endian.h"
#include "npy_cpu.h"
Expand Down
14 changes: 7 additions & 7 deletions numpy/core/include/numpy/noprefix.h
Original file line number Diff line number Diff line change
Expand Up @@ -64,10 +64,13 @@
#define datetime npy_datetime
#define timedelta npy_timedelta

#define SIZEOF_INTP NPY_SIZEOF_INTP
#define SIZEOF_UINTP NPY_SIZEOF_UINTP
#define SIZEOF_DATETIME NPY_SIZEOF_DATETIME
#define SIZEOF_TIMEDELTA NPY_SIZEOF_TIMEDELTA
#define SIZEOF_LONGLONG NPY_SIZEOF_LONGLONG
#define SIZEOF_INTP NPY_SIZEOF_INTP
#define SIZEOF_UINTP NPY_SIZEOF_UINTP
#define SIZEOF_HALF NPY_SIZEOF_HALF
#define SIZEOF_LONGDOUBLE NPY_SIZEOF_LONGDOUBLE
#define SIZEOF_DATETIME NPY_SIZEOF_DATETIME
#define SIZEOF_TIMEDELTA NPY_SIZEOF_TIMEDELTA

#define LONGLONG_FMT NPY_LONGLONG_FMT
#define ULONGLONG_FMT NPY_ULONGLONG_FMT
Expand Down Expand Up @@ -113,9 +116,6 @@
#define MIN_TIMEDELTA NPY_MIN_TIMEDELTA
#define MAX_TIMEDELTA NPY_MAX_TIMEDELTA

#define SIZEOF_LONGDOUBLE NPY_SIZEOF_LONGDOUBLE
#define SIZEOF_LONGLONG NPY_SIZEOF_LONGLONG
#define SIZEOF_HALF NPY_SIZEOF_HALF
#define BITSOF_BOOL NPY_BITSOF_BOOL
#define BITSOF_CHAR NPY_BITSOF_CHAR
#define BITSOF_SHORT NPY_BITSOF_SHORT
Expand Down
15 changes: 9 additions & 6 deletions numpy/core/include/numpy/npy_common.h
Original file line number Diff line number Diff line change
Expand Up @@ -33,15 +33,22 @@ enum {
};

/*
* This is to typedef npy_intp to the appropriate pointer size for
* this platform. Py_intptr_t, Py_uintptr_t are defined in pyport.h.
* This is to typedef npy_intp to the appropriate pointer size for this
* platform. Py_intptr_t, Py_uintptr_t are defined in pyport.h.
*/
typedef Py_intptr_t npy_intp;
typedef Py_uintptr_t npy_uintp;

/*
* Define sizes that were not defined in numpyconfig.h.
*/
#define NPY_SIZEOF_CHAR 1
#define NPY_SIZEOF_BYTE 1
#define NPY_SIZEOF_DATETIME 8
#define NPY_SIZEOF_TIMEDELTA 8
#define NPY_SIZEOF_INTP NPY_SIZEOF_PY_INTPTR_T
#define NPY_SIZEOF_UINTP NPY_SIZEOF_PY_INTPTR_T
#define NPY_SIZEOF_HALF 2
#define NPY_SIZEOF_CFLOAT NPY_SIZEOF_COMPLEX_FLOAT
#define NPY_SIZEOF_CDOUBLE NPY_SIZEOF_COMPLEX_DOUBLE
#define NPY_SIZEOF_CLONGDOUBLE NPY_SIZEOF_COMPLEX_LONGDOUBLE
Expand Down Expand Up @@ -305,10 +312,6 @@ typedef struct { npy_longdouble real, imag; } npy_clongdouble;
#define NPY_MIN_LONG LONG_MIN
#define NPY_MAX_ULONG ULONG_MAX

#define NPY_SIZEOF_HALF 2
#define NPY_SIZEOF_DATETIME 8
#define NPY_SIZEOF_TIMEDELTA 8

#define NPY_BITSOF_BOOL (sizeof(npy_bool) * CHAR_BIT)
#define NPY_BITSOF_CHAR CHAR_BIT
#define NPY_BITSOF_BYTE (NPY_SIZEOF_BYTE * CHAR_BIT)
Expand Down
18 changes: 9 additions & 9 deletions numpy/core/include/numpy/numpyconfig.h
Original file line number Diff line number Diff line change
Expand Up @@ -9,16 +9,16 @@
* harcoded
*/
#ifdef __APPLE__
#undef NPY_SIZEOF_LONG
#undef NPY_SIZEOF_PY_INTPTR_T
#undef NPY_SIZEOF_LONG
#undef NPY_SIZEOF_PY_INTPTR_T

#ifdef __LP64__
#define NPY_SIZEOF_LONG 8
#define NPY_SIZEOF_PY_INTPTR_T 8
#else
#define NPY_SIZEOF_LONG 4
#define NPY_SIZEOF_PY_INTPTR_T 4
#endif
#ifdef __LP64__
#define NPY_SIZEOF_LONG 8
#define NPY_SIZEOF_PY_INTPTR_T 8
#else
#define NPY_SIZEOF_LONG 4
#define NPY_SIZEOF_PY_INTPTR_T 4
#endif
#endif

/**
Expand Down
20 changes: 2 additions & 18 deletions numpy/core/src/private/npy_config.h
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@
#define _NPY_NPY_CONFIG_H_

#include "config.h"
#include "_numpyconfig.h"

/* Disable broken MS math functions */
#if defined(_MSC_VER) || defined(__MINGW32_VERSION)
Expand All @@ -10,7 +11,7 @@
#endif

/* Safe to use ldexp and frexp for long double for MSVC builds */
#if (SIZEOF_LONG_DOUBLE == SIZEOF_DOUBLE) || defined(_MSC_VER)
#if (NPY_SIZEOF_LONGDOUBLE == NPY_SIZEOF_DOUBLE) || defined(_MSC_VER)
#ifdef HAVE_LDEXP
#define HAVE_LDEXPL 1
#endif
Expand All @@ -24,21 +25,4 @@
#undef HAVE_ATAN2
#endif

/*
* On Mac OS X, because there is only one configuration stage for all the archs
* in universal builds, any macro which depends on the arch needs to be
* harcoded
*/
#ifdef __APPLE__
#undef SIZEOF_LONG
#undef SIZEOF_PY_INTPTR_T

#ifdef __LP64__
#define SIZEOF_LONG 8
#define SIZEOF_PY_INTPTR_T 8
#else
#define SIZEOF_LONG 4
#define SIZEOF_PY_INTPTR_T 4
#endif
#endif
#endif