summaryrefslogtreecommitdiff
path: root/numpy/core/SConscript
diff options
context:
space:
mode:
authorDavid Cournapeau <cournape@gmail.com>2009-11-04 14:27:21 +0000
committerDavid Cournapeau <cournape@gmail.com>2009-11-04 14:27:21 +0000
commitc4c82f9bc623e4ccb4505f1a2789a9673ba3d8e6 (patch)
tree051a2ceb2df1b951b34671853880b82c9a568d4f /numpy/core/SConscript
parent67957e2ed9825f647076295935ab9f28d1557a8a (diff)
downloadnumpy-c4c82f9bc623e4ccb4505f1a2789a9673ba3d8e6.tar.gz
ENH: check for complex struct sizes.
Diffstat (limited to 'numpy/core/SConscript')
-rw-r--r--numpy/core/SConscript13
1 files changed, 12 insertions, 1 deletions
diff --git a/numpy/core/SConscript b/numpy/core/SConscript
index 8c21b4653..0fa61d2ba 100644
--- a/numpy/core/SConscript
+++ b/numpy/core/SConscript
@@ -84,9 +84,20 @@ def check_type(type, include = None):
else:
numpyconfig_sym.append(('SIZEOF_%s' % type.upper(), 0))
-for type in ('short', 'int', 'long', 'float', 'double', 'long double'):
+for type in ('short', 'int', 'long'):
check_type(type)
+for type in ('float', 'double', 'long double'):
+ sz = config.CheckTypeSize(type)
+ numpyconfig_sym.append(('SIZEOF_%s' % type2def(type), str(sz)))
+
+ # Compute size of corresponding complex type: used to check that our
+ # definition is binary compatible with C99 complex type (check done at
+ # build time in npy_common.h)
+ complex_def = "struct {%s __x; %s __y;}" % (type, type)
+ sz = config.CheckTypeSize(complex_def)
+ numpyconfig_sym.append(('SIZEOF_COMPLEX_%s' % type2def(type), str(sz)))
+
for type in ('Py_intptr_t',):
check_type(type, include = "#include <Python.h>\n")