Fix for compiling as C code

git-svn-id: https://swig.svn.sourceforge.net/svnroot/swig/trunk@12245 626c5289-ae23-0410-ae9c-e8d60b6d4f22
This commit is contained in:
William S Fulton 2010-10-03 16:58:51 +00:00
parent c7b4336a6c
commit 22dd2292ca
1 changed files with 2 additions and 1 deletions

View File

@ -311,8 +311,9 @@ SWIG_AsVal_dec(double)(SV *obj, double *val)
const char *nptr = SvPV_nolen(obj);
if (nptr) {
char *endptr;
double v;
errno = 0;
double v = strtod(nptr, &endptr);
v = strtod(nptr, &endptr);
if (errno == ERANGE) {
errno = 0;
return SWIG_OverflowError;