summaryrefslogtreecommitdiff
path: root/pack.c
diff options
context:
space:
mode:
authormatz <matz@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>1999-02-09 06:08:24 +0000
committermatz <matz@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>1999-02-09 06:08:24 +0000
commit115eb4595cea72226ec8acd357e7c403e2c4b04a (patch)
treec050f1ee16f730fc7dbc89586e09b33a23196485 /pack.c
parent9b64dfe3b8f0343ebf97ae80d3a4ec3f4bd115b3 (diff)
990209
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/branches/ruby_1_3@394 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'pack.c')
-rw-r--r--pack.c16
1 files changed, 10 insertions, 6 deletions
diff --git a/pack.c b/pack.c
index 4f9efbe74a..f064cc4be6 100644
--- a/pack.c
+++ b/pack.c
@@ -14,6 +14,10 @@
#include <sys/types.h>
#include <ctype.h>
+#ifndef atof
+double strtod();
+#endif
+
#define define_swapx(x, xtype) \
static xtype \
TOKEN_PASTE(swap,x)(z) \
@@ -587,7 +591,7 @@ pack_pack(ary, fmt)
f = RFLOAT(from)->value;
break;
case T_STRING:
- f = atof(RSTRING(from)->ptr);
+ f = strtod(RSTRING(from)->ptr, 0);
default:
f = (float)NUM2INT(from);
break;
@@ -607,7 +611,7 @@ pack_pack(ary, fmt)
f = RFLOAT(from)->value;
break;
case T_STRING:
- f = atof(RSTRING(from)->ptr);
+ f = strtod(RSTRING(from)->ptr, 0);
default:
f = (float)NUM2INT(from);
break;
@@ -628,7 +632,7 @@ pack_pack(ary, fmt)
d = RFLOAT(from)->value;
break;
case T_STRING:
- d = atof(RSTRING(from)->ptr);
+ d = strtod(RSTRING(from)->ptr, 0);
default:
d = (double)NUM2INT(from);
break;
@@ -649,7 +653,7 @@ pack_pack(ary, fmt)
d = RFLOAT(from)->value;
break;
case T_STRING:
- d = atof(RSTRING(from)->ptr);
+ d = strtod(RSTRING(from)->ptr, 0);
default:
d = (double)NUM2INT(from);
break;
@@ -669,7 +673,7 @@ pack_pack(ary, fmt)
f = RFLOAT(from)->value;
break;
case T_STRING:
- f = atof(RSTRING(from)->ptr);
+ f = strtod(RSTRING(from)->ptr, 0);
default:
f = (float)NUM2INT(from);
break;
@@ -690,7 +694,7 @@ pack_pack(ary, fmt)
d = RFLOAT(from)->value;
break;
case T_STRING:
- d = atof(RSTRING(from)->ptr);
+ d = strtod(RSTRING(from)->ptr, 0);
default:
d = (double)NUM2INT(from);
break;