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

Skip to content

Commit 3818675

Browse files
committed
Enable the use of c99 macros in c++
1 parent 0c0b5df commit 3818675

File tree

1 file changed

+5
-0
lines changed

1 file changed

+5
-0
lines changed

setupext.py

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -898,6 +898,11 @@ def add_flags(self, ext):
898898
ext.define_macros.append(('NPY_NO_DEPRECATED_API',
899899
'NPY_1_7_API_VERSION'))
900900

901+
# Allow the numpy NPY_INTP_FMT macro to be used in C++.
902+
# On gcc this translates to PRIdPTR which needs
903+
# __STDC_FORMAT_MACROS to be usable in c++
904+
ext.define_macros.append(('__STDC_FORMAT_MACROS', 1))
905+
901906
def get_setup_requires(self):
902907
return ['numpy>=1.6']
903908

0 commit comments

Comments
 (0)