summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDavid Cournapeau <cournape@gmail.com>2012-06-24 23:15:29 +0100
committerDavid Cournapeau <cournape@gmail.com>2012-06-24 23:25:08 +0100
commit465c2f44f0c19d2abe7b5d060c447f69526ca14c (patch)
tree06fe336d71734bb41fcc146cf8801bffcb0c1370
parent6bb3ef6b9737f9aae021f8905170eeb160f67d6f (diff)
downloadnumpy-465c2f44f0c19d2abe7b5d060c447f69526ca14c.tar.gz
BUG: fix separate compilation (with distutils only for now).
-rw-r--r--numpy/core/src/multiarray/_datetime.h6
-rw-r--r--numpy/core/src/multiarray/datetime_busdaycal.h5
-rw-r--r--numpy/core/src/umath/reduction.c10
3 files changed, 18 insertions, 3 deletions
diff --git a/numpy/core/src/multiarray/_datetime.h b/numpy/core/src/multiarray/_datetime.h
index b359a9f17..7ec3cd907 100644
--- a/numpy/core/src/multiarray/_datetime.h
+++ b/numpy/core/src/multiarray/_datetime.h
@@ -1,9 +1,13 @@
#ifndef _NPY_PRIVATE__DATETIME_H_
#define _NPY_PRIVATE__DATETIME_H_
+#ifdef NPY_ENABLE_SEPARATE_COMPILATION
+extern NPY_NO_EXPORT char *_datetime_strings[NPY_DATETIME_NUMUNITS];
+extern NPY_NO_EXPORT int _days_per_month_table[2][12];
+#else
NPY_NO_EXPORT char *_datetime_strings[NPY_DATETIME_NUMUNITS];
-
NPY_NO_EXPORT int _days_per_month_table[2][12];
+#endif
NPY_NO_EXPORT void
numpy_pydatetime_import();
diff --git a/numpy/core/src/multiarray/datetime_busdaycal.h b/numpy/core/src/multiarray/datetime_busdaycal.h
index 8401f38b6..5d7325733 100644
--- a/numpy/core/src/multiarray/datetime_busdaycal.h
+++ b/numpy/core/src/multiarray/datetime_busdaycal.h
@@ -26,7 +26,12 @@ typedef struct {
npy_bool weekmask[7];
} NpyBusDayCalendar;
+#ifdef NPY_ENABLE_SEPARATE_COMPILATION
+extern NPY_NO_EXPORT PyTypeObject NpyBusDayCalendar_Type;
+#else
NPY_NO_EXPORT PyTypeObject NpyBusDayCalendar_Type;
+#endif
+
/*
* Converts a Python input into a 7-element weekmask, where 0 means
diff --git a/numpy/core/src/umath/reduction.c b/numpy/core/src/umath/reduction.c
index be301e26d..2f0420610 100644
--- a/numpy/core/src/umath/reduction.c
+++ b/numpy/core/src/umath/reduction.c
@@ -6,12 +6,18 @@
*
* See LICENSE.txt for the license.
*/
+#define _UMATHMODULE
+#define NPY_NO_DEPRECATED_API NPY_API_VERSION
#define PY_SSIZE_T_CLEAN
#include <Python.h>
-#define NPY_NO_DEPRECATED_API NPY_API_VERSION
-#define _MULTIARRAYMODULE
+#include "npy_config.h"
+#ifdef ENABLE_SEPARATE_COMPILATION
+#define PY_ARRAY_UNIQUE_SYMBOL _npy_umathmodule_ARRAY_API
+#define NO_IMPORT_ARRAY
+#endif
+
#include <numpy/arrayobject.h>
#include "npy_config.h"