diff options
author | David Cournapeau <cournape@gmail.com> | 2008-08-06 00:11:22 +0000 |
---|---|---|
committer | David Cournapeau <cournape@gmail.com> | 2008-08-06 00:11:22 +0000 |
commit | 64423fdb18e8edec4d9a3bf24a305d4a3dbaa336 (patch) | |
tree | 1ac54ba912712e25e6846fb7bef342599b2e95ec /numpy | |
parent | 127d6ed3644fa236cefe1fbf5bffa38ed1993211 (diff) | |
download | numpy-64423fdb18e8edec4d9a3bf24a305d4a3dbaa336.tar.gz |
Always define __STDC_FORMAT_MACROS for C++ support of PRIdPTR.
Diffstat (limited to 'numpy')
-rw-r--r-- | numpy/core/include/numpy/numpyconfig.h.in | 6 | ||||
-rw-r--r-- | numpy/core/setup.py | 7 |
2 files changed, 13 insertions, 0 deletions
diff --git a/numpy/core/include/numpy/numpyconfig.h.in b/numpy/core/include/numpy/numpyconfig.h.in index 573c4f73e..bdebf7078 100644 --- a/numpy/core/include/numpy/numpyconfig.h.in +++ b/numpy/core/include/numpy/numpyconfig.h.in @@ -16,3 +16,9 @@ @DEFINE_NPY_SIZEOF_PY_LONG_LONG@ #define NPY_USE_C99_FORMATS @USE_C99_FORMATS@ + +/* Ugly, but we can't test this in a proper manner without requiring a C++ + * compiler at the configuration stage of numpy ? */ +#ifndef __STDC_FORMAT_MACROS + #define __STDC_FORMAT_MACROS 1 +#endif diff --git a/numpy/core/setup.py b/numpy/core/setup.py index b390c8f91..1f4f23d82 100644 --- a/numpy/core/setup.py +++ b/numpy/core/setup.py @@ -204,6 +204,13 @@ def configuration(parent_package='',top_path=None): target_f.write('#define %s\n' % (d)) else: target_f.write('#define %s %s\n' % (d[0],d[1])) + + # Define __STDC_FORMAT_MACROS + target_f.write(""" +#ifndef __STDC_FORMAT_MACROS +#define __STDC_FORMAT_MACROS 1 +#endif +""") target_f.close() # Dump the numpyconfig.h header to stdout |