summaryrefslogtreecommitdiff
path: root/numpy/core
diff options
context:
space:
mode:
authorCharles Harris <charlesr.harris@gmail.com>2012-02-05 12:55:20 -0700
committerCharles Harris <charlesr.harris@gmail.com>2012-02-05 13:08:32 -0700
commitf6a2c7ca3a090e0dc107b60b0a5771247a84e032 (patch)
treeb00ec64749bf2c088da747c80d958c184979e746 /numpy/core
parent9897d953895a0a2fc5cc9d8d8db2010958b0d7aa (diff)
downloadnumpy-f6a2c7ca3a090e0dc107b60b0a5771247a84e032.tar.gz
ENH: Add some needed macros to include files.
The unprefixed macros in interrupt.h were prefixed with NPY_, The unprefixed macros in interrupt.h were added to noprefix.h. The arrayobject.h file was fixed to work with the new interrupt.h. Some needed macros were added to npy_common.h.
Diffstat (limited to 'numpy/core')
-rw-r--r--numpy/core/include/numpy/arrayobject.h5
-rw-r--r--numpy/core/include/numpy/noprefix.h5
-rw-r--r--numpy/core/include/numpy/npy_common.h2
-rw-r--r--numpy/core/include/numpy/npy_interrupt.h18
4 files changed, 18 insertions, 12 deletions
diff --git a/numpy/core/include/numpy/arrayobject.h b/numpy/core/include/numpy/arrayobject.h
index f64d2a6c3..a84766f63 100644
--- a/numpy/core/include/numpy/arrayobject.h
+++ b/numpy/core/include/numpy/arrayobject.h
@@ -11,11 +11,12 @@
#ifndef Py_ARRAYOBJECT_H
#define Py_ARRAYOBJECT_H
+
#include "ndarrayobject.h"
+#include "npy_interrupt.h"
+
#ifdef NPY_NO_PREFIX
#include "noprefix.h"
#endif
-#include "npy_interrupt.h"
-
#endif
diff --git a/numpy/core/include/numpy/noprefix.h b/numpy/core/include/numpy/noprefix.h
index 6fcdd6f0e..b3e57480e 100644
--- a/numpy/core/include/numpy/noprefix.h
+++ b/numpy/core/include/numpy/noprefix.h
@@ -7,8 +7,13 @@
*/
#ifndef NPY_NO_PREFIX
#include "ndarrayobject.h"
+#include "npy_interrupt.h"
#endif
+#define SIGSETJMP NPY_SIGSETJMP
+#define SIGLONGJMP NPY_SIGLONGJMP
+#define SIGJMP_BUF NPY_SIGJMP_BUF
+
#define MAX_DIMS NPY_MAXDIMS
#define longlong npy_longlong
diff --git a/numpy/core/include/numpy/npy_common.h b/numpy/core/include/numpy/npy_common.h
index 34d84b06a..4f895e0a7 100644
--- a/numpy/core/include/numpy/npy_common.h
+++ b/numpy/core/include/numpy/npy_common.h
@@ -82,7 +82,7 @@ typedef Py_uintptr_t npy_uintp;
#define PyIntpArrType_Type PyLongArrType_Type
#define PyUIntpArrType_Type PyULongArrType_Type
#define NPY_MAX_INTP NPY_MAX_LONG
- #define NPY_MIN_INTP MIN_LONG
+ #define NPY_MIN_INTP NPY_MIN_LONG
#define NPY_MAX_UINTP NPY_MAX_ULONG
#define NPY_INTP_FMT "ld"
#elif defined(PY_LONG_LONG) && (NPY_SIZEOF_PY_INTPTR_T == NPY_SIZEOF_LONGLONG)
diff --git a/numpy/core/include/numpy/npy_interrupt.h b/numpy/core/include/numpy/npy_interrupt.h
index eb72fbaf0..f71fd689e 100644
--- a/numpy/core/include/numpy/npy_interrupt.h
+++ b/numpy/core/include/numpy/npy_interrupt.h
@@ -85,22 +85,22 @@ Interrupt handling does not work well with threads.
#ifndef sigsetjmp
-#define SIGSETJMP(arg1, arg2) setjmp(arg1)
-#define SIGLONGJMP(arg1, arg2) longjmp(arg1, arg2)
-#define SIGJMP_BUF jmp_buf
+#define NPY_SIGSETJMP(arg1, arg2) setjmp(arg1)
+#define NPY_SIGLONGJMP(arg1, arg2) longjmp(arg1, arg2)
+#define NPY_SIGJMP_BUF jmp_buf
#else
-#define SIGSETJMP(arg1, arg2) sigsetjmp(arg1, arg2)
-#define SIGLONGJMP(arg1, arg2) siglongjmp(arg1, arg2)
-#define SIGJMP_BUF sigjmp_buf
+#define NPY_SIGSETJMP(arg1, arg2) sigsetjmp(arg1, arg2)
+#define NPY_SIGLONGJMP(arg1, arg2) siglongjmp(arg1, arg2)
+#define NPY_SIGJMP_BUF sigjmp_buf
#endif
# define NPY_SIGINT_ON { \
PyOS_sighandler_t _npy_sig_save; \
_npy_sig_save = PyOS_setsig(SIGINT, _PyArray_SigintHandler); \
- if (SIGSETJMP(*((SIGJMP_BUF *)_PyArray_GetSigintBuf()), \
+ if (NPY_SIGSETJMP(*((NPY_SIGJMP_BUF *)_PyArray_GetSigintBuf()), \
1) == 0) { \
# define NPY_SIGINT_OFF } \
@@ -109,8 +109,8 @@ Interrupt handling does not work well with threads.
#else /* NPY_NO_SIGNAL */
-# define NPY_SIGINT_ON
-# define NPY_SIGINT_OFF
+#define NPY_SIGINT_ON
+#define NPY_SIGINT_OFF
#endif /* HAVE_SIGSETJMP */