summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--numpy/core/setup.py8
-rw-r--r--numpy/core/src/arraytypes.inc.src4
2 files changed, 11 insertions, 1 deletions
diff --git a/numpy/core/setup.py b/numpy/core/setup.py
index c2f0e39e0..78611b5e1 100644
--- a/numpy/core/setup.py
+++ b/numpy/core/setup.py
@@ -1,6 +1,7 @@
import imp
import os
+import sys
from os.path import join
from glob import glob
from distutils.dep_util import newer,newer_group
@@ -71,7 +72,12 @@ def configuration(parent_package='',top_path=None):
moredefs.append('HAVE_ISNAN')
if config_cmd.check_func('isinf', **kws_args):
moredefs.append('HAVE_ISINF')
-
+
+ if sys.version[:3] < '2.4':
+ kws_args['headers'].append('stdlib.h')
+ if config_cmd.check_func('strtod', **kws_args):
+ moredefs.append(('PyOS_ascii_strtod', 'strtod'))
+
if moredefs:
target_f = open(target,'a')
for d in moredefs:
diff --git a/numpy/core/src/arraytypes.inc.src b/numpy/core/src/arraytypes.inc.src
index cde60003a..a973a9dac 100644
--- a/numpy/core/src/arraytypes.inc.src
+++ b/numpy/core/src/arraytypes.inc.src
@@ -775,6 +775,7 @@ static int
#fname=FLOAT,DOUBLE,LONGDOUBLE#
#type=float,double,longdouble#
*/
+#if (PY_VERSION_HEX >= 0x02040000) || defined(PyOS_ascii_strtod)
static int
@fname@_fromstr(char *str, @type@ *ip, char **endptr, void *ignore)
{
@@ -784,6 +785,9 @@ static int
*ip = (@type@) result;
return 0;
}
+#else
+#define @fname@_fromstr NULL
+#endif
/**end repeat**/