[Numpy-svn] r4218 - branches/cleanconfig/numpy/core

numpy-svn@scip... numpy-svn@scip...
Wed Oct 17 23:02:28 CDT 2007


Author: cdavid
Date: 2007-10-17 23:02:24 -0500 (Wed, 17 Oct 2007)
New Revision: 4218

Modified:
   branches/cleanconfig/numpy/core/setup.py
Log:
Add CHAR_BITS as a public symbol in numpyconfig header

Modified: branches/cleanconfig/numpy/core/setup.py
===================================================================
--- branches/cleanconfig/numpy/core/setup.py	2007-10-18 03:37:41 UTC (rev 4217)
+++ branches/cleanconfig/numpy/core/setup.py	2007-10-18 04:02:24 UTC (rev 4218)
@@ -435,6 +435,21 @@
     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);
 



More information about the Numpy-svn mailing list