diff options
author | David Cournapeau <cournape@gmail.com> | 2007-12-18 09:57:21 +0000 |
---|---|---|
committer | David Cournapeau <cournape@gmail.com> | 2007-12-18 09:57:21 +0000 |
commit | 359978d8be718aac42bc0369e67fbe8a0a26eac3 (patch) | |
tree | b2a38f585753013bf1cce94b75aac1bca93860e6 /numpy/core/setup.py | |
parent | 4035e4212a47f962fe026cbd01cc715774f4a3d6 (diff) | |
download | numpy-359978d8be718aac42bc0369e67fbe8a0a26eac3.tar.gz |
Add CHAR_BITS as a public symbol in numpyconfig header
Diffstat (limited to 'numpy/core/setup.py')
-rw-r--r-- | numpy/core/setup.py | 15 |
1 files changed, 15 insertions, 0 deletions
diff --git a/numpy/core/setup.py b/numpy/core/setup.py index e676b8e8a..9c4725e41 100644 --- a/numpy/core/setup.py +++ b/numpy/core/setup.py @@ -435,6 +435,21 @@ int main() testcode.append(tmpcode % ('NPY_SIZEOF_LONGLONG', 'SIZEOF_LONG_LONG', 'NPY_SIZEOF_PY_LONG_LONG', 'SIZEOF_PY_LONG_LONG')) + testcode.append(r""" +#ifndef CHAR_BIT + { + unsigned char var = 2; + int i = 0; + while (var >= 2) { + var = var << 1; + i++; + } + fprintf(f,"#define CHAR_BIT %d\n", i+1); + } +#else + fprintf(f, "/* #define CHAR_BIT %d */\n", CHAR_BIT); +#endif""") + testcode.append(""" fclose(f); |