summaryrefslogtreecommitdiffhomepage
path: root/src/string.c
diff options
context:
space:
mode:
authorFelix Jones <[email protected]>2016-12-07 12:46:47 +0000
committerFelix Jones <[email protected]>2016-12-07 12:46:47 +0000
commit6187c21bd96d120c4e58ebeae83749ab9f56a16c (patch)
tree7331e95516795a004d9469ac5b2c69c4352734de /src/string.c
parent2b0dd1f48194e59ff839ec97d0fde7df76f325ea (diff)
downloadmruby-6187c21bd96d120c4e58ebeae83749ab9f56a16c.tar.gz
mruby-6187c21bd96d120c4e58ebeae83749ab9f56a16c.zip
Wrapped string.c errno with ifndef macro for platforms that use inbuilt errno macro
Diffstat (limited to 'src/string.c')
-rw-r--r--src/string.c8
1 files changed, 5 insertions, 3 deletions
diff --git a/src/string.c b/src/string.c
index 4f722b273..4189d84d0 100644
--- a/src/string.c
+++ b/src/string.c
@@ -2750,7 +2750,7 @@ mrb_init_string(mrb_state *mrb)
mrb_define_method(mrb, s, "freeze", mrb_str_freeze, MRB_ARGS_NONE());
}
-/*
+/*
* Source code for the "strtod" library procedure.
*
* Copyright (c) 1988-1993 The Regents of the University of California.
@@ -2769,7 +2769,9 @@ mrb_init_string(mrb_state *mrb)
#include <ctype.h>
#include <errno.h>
+#ifndef errno
extern int errno;
+#endif
#ifndef __STDC__
# ifdef __GNUC__
@@ -2876,7 +2878,7 @@ mrb_float_read(const char *string, char **endPtr)
* If the mantissa has more than 18 digits, ignore the extras, since
* they can't affect the value anyway.
*/
-
+
pExp = p;
p -= mantSize;
if (decPt < 0) {
@@ -2954,7 +2956,7 @@ mrb_float_read(const char *string, char **endPtr)
* many powers of 2 of 10. Then combine the exponent with the
* fraction.
*/
-
+
if (exp < 0) {
expSign = TRUE;
exp = -exp;