Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit b239626

Browse files
committed
Merge pull request #2042 from bfroehle/py_array_unique_symbol
Ensure that PY_ARRAY_UNIQUE_SYMBOL is uniquely defined for each extension
2 parents 8ea183b + 40bbb9b commit b239626

File tree

1 file changed

+5
-1
lines changed

1 file changed

+5
-1
lines changed

setupext.py

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -648,8 +648,12 @@ def check(self):
648648
def add_flags(self, ext):
649649
import numpy
650650

651+
# Ensure that PY_ARRAY_UNIQUE_SYMBOL is uniquely defined for
652+
# each extension
653+
array_api_name = 'MPL_' + ext.name.replace('.', '_') + '_ARRAY_API'
654+
651655
ext.include_dirs.append(numpy.get_include())
652-
ext.define_macros.append(('PY_ARRAY_UNIQUE_SYMBOL', 'MPL_ARRAY_API'))
656+
ext.define_macros.append(('PY_ARRAY_UNIQUE_SYMBOL', array_api_name))
653657

654658

655659
class CXX(SetupPackage):

0 commit comments

Comments
 (0)