diff options
author | Hans Meine <hans_meine@gmx.net> | 2014-03-16 11:23:37 +0100 |
---|---|---|
committer | Hans Meine <hans_meine@gmx.net> | 2014-03-16 11:23:37 +0100 |
commit | 2f38c8e5e86c360aaae5b7e461bb8e27a2520977 (patch) | |
tree | a0b97d233bb324ad4156c3be746073ca2825f6b3 /doc/source/reference/c-api.array.rst | |
parent | ddd02d50e8cd06d84deecd3b2943813be20b91b8 (diff) | |
download | numpy-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.rst | 6 |
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 ^^^^^^^^^^^^^^^^^^^^^^^^ |