summaryrefslogtreecommitdiff
path: root/doc/source/reference/c-api.array.rst
diff options
context:
space:
mode:
authorHans Meine <hans_meine@gmx.net>2014-03-16 11:23:37 +0100
committerHans Meine <hans_meine@gmx.net>2014-03-16 11:23:37 +0100
commit2f38c8e5e86c360aaae5b7e461bb8e27a2520977 (patch)
treea0b97d233bb324ad4156c3be746073ca2825f6b3 /doc/source/reference/c-api.array.rst
parentddd02d50e8cd06d84deecd3b2943813be20b91b8 (diff)
downloadnumpy-2f38c8e5e86c360aaae5b7e461bb8e27a2520977.tar.gz
DOC: suggest definition of unique symbol in .h
I find it much more convenient to define the PY_ARRAY_UNIQUE_SYMBOL in a header file #included by all files of the extension (than to repeat its definition in each and every file).
Diffstat (limited to 'doc/source/reference/c-api.array.rst')
-rw-r--r--doc/source/reference/c-api.array.rst6
1 files changed, 5 insertions, 1 deletions
diff --git a/doc/source/reference/c-api.array.rst b/doc/source/reference/c-api.array.rst
index 3ce49cb85..2ce43b2be 100644
--- a/doc/source/reference/c-api.array.rst
+++ b/doc/source/reference/c-api.array.rst
@@ -2899,10 +2899,14 @@ the C-API is needed then some additional steps must be taken.
.. code-block:: c
- #define PY_ARRAY_UNIQUE_SYMBOL cool_ARRAY_API
#define NO_IMPORT_ARRAY
+ #define PY_ARRAY_UNIQUE_SYMBOL cool_ARRAY_API
#include numpy/arrayobject.h
+ You can also put the common two last lines into an extension-local
+ header file as long as you make sure that NO_IMPORT_ARRAY is
+ #defined before #including that file.
+
Checking the API Version
^^^^^^^^^^^^^^^^^^^^^^^^