Skip to content

Commit 6187c21

Browse files
author
Felix Jones
committed
Wrapped string.c errno with ifndef macro for platforms that use inbuilt errno macro
1 parent 2b0dd1f commit 6187c21

File tree

1 file changed

+5
-3
lines changed

1 file changed

+5
-3
lines changed

src/string.c

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2750,7 +2750,7 @@ mrb_init_string(mrb_state *mrb)
27502750
mrb_define_method(mrb, s, "freeze", mrb_str_freeze, MRB_ARGS_NONE());
27512751
}
27522752

2753-
/*
2753+
/*
27542754
* Source code for the "strtod" library procedure.
27552755
*
27562756
* Copyright (c) 1988-1993 The Regents of the University of California.
@@ -2769,7 +2769,9 @@ mrb_init_string(mrb_state *mrb)
27692769

27702770
#include <ctype.h>
27712771
#include <errno.h>
2772+
#ifndef errno
27722773
extern int errno;
2774+
#endif
27732775

27742776
#ifndef __STDC__
27752777
# ifdef __GNUC__
@@ -2876,7 +2878,7 @@ mrb_float_read(const char *string, char **endPtr)
28762878
* If the mantissa has more than 18 digits, ignore the extras, since
28772879
* they can't affect the value anyway.
28782880
*/
2879-
2881+
28802882
pExp = p;
28812883
p -= mantSize;
28822884
if (decPt < 0) {
@@ -2954,7 +2956,7 @@ mrb_float_read(const char *string, char **endPtr)
29542956
* many powers of 2 of 10. Then combine the exponent with the
29552957
* fraction.
29562958
*/
2957-
2959+
29582960
if (exp < 0) {
29592961
expSign = TRUE;
29602962
exp = -exp;

0 commit comments

Comments
 (0)