Skip to content

Commit

Permalink
Export jl_strtod_c/jl_strtof_c from src/
Browse files Browse the repository at this point in the history
  • Loading branch information
quinnj committed Oct 20, 2015
1 parent 7066004 commit 316da80
Show file tree
Hide file tree
Showing 4 changed files with 12 additions and 12 deletions.
6 changes: 3 additions & 3 deletions src/builtins.c
Original file line number Diff line number Diff line change
Expand Up @@ -831,7 +831,7 @@ DLLEXPORT jl_nullable_float64_t jl_try_substrtod(char *str, size_t offset, size_
bstr = newstr;
pend = bstr+len;
}
double out = strtod_c(bstr, &p);
double out = jl_strtod_c(bstr, &p);

if (errno==ERANGE && (out==0 || out==HUGE_VAL || out==-HUGE_VAL)) {
err = 1;
Expand Down Expand Up @@ -884,9 +884,9 @@ DLLEXPORT jl_nullable_float32_t jl_try_substrtof(char *str, size_t offset, size_
pend = bstr+len;
}
#if defined(_OS_WINDOWS_) && !defined(_COMPILER_MINGW_)
float out = (float)strtod_c(bstr, &p);
float out = (float)jl_strtod_c(bstr, &p);
#else
float out = strtof_c(bstr, &p);
float out = jl_strtof_c(bstr, &p);
#endif

if (errno==ERANGE && (out==0 || out==HUGE_VALF || out==-HUGE_VALF)) {
Expand Down
4 changes: 2 additions & 2 deletions src/flisp/read.c
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@ int isnumtok_base(char *tok, value_t *pval, int base)
return 0;
if (!((tok[0]=='0' && tok[1]=='x') || (base >= 15)) &&
strpbrk(tok, ".eEpP")) {
d = strtod_c(tok, &end);
d = jl_strtod_c(tok, &end);
if (*end == '\0') {
if (pval) *pval = mk_double(d);
return 1;
Expand All @@ -55,7 +55,7 @@ int isnumtok_base(char *tok, value_t *pval, int base)
// hexadecimal float literals
else if (((tok[0]=='0' && tok[1]=='x') || (base == 16)) &&
strpbrk(tok, "pP")) {
d = strtod_c(tok, &end);
d = jl_strtod_c(tok, &end);
if (*end == '\0') {
if (pval) *pval = mk_double(d);
return 1;
Expand Down
10 changes: 5 additions & 5 deletions src/support/strtod.c
Original file line number Diff line number Diff line change
Expand Up @@ -28,12 +28,12 @@ locale_t get_c_locale()
return c_locale;
}

double strtod_c(const char *nptr, char **endptr)
DLLEXPORT double jl_strtod_c(const char *nptr, char **endptr)
{
return strtod_l(nptr, endptr, get_c_locale());
}

float strtof_c(const char *nptr, char **endptr)
DLLEXPORT float jl_strtof_c(const char *nptr, char **endptr)
{
return strtof_l(nptr, endptr, get_c_locale());
}
Expand Down Expand Up @@ -98,7 +98,7 @@ double parse_inf_or_nan(const char *p, char **endptr)
}


double strtod_c(const char *nptr, char **endptr)
DLLEXPORT double jl_strtod_c(const char *nptr, char **endptr)
{
char *fail_pos;
double val;
Expand Down Expand Up @@ -285,9 +285,9 @@ double strtod_c(const char *nptr, char **endptr)
}


float strtof_c(const char *nptr, char **endptr)
DLLEXPORT float jl_strtof_c(const char *nptr, char **endptr)
{
return (float) strtod_c(nptr, endptr);
return (float) jl_strtod_c(nptr, endptr);
}

#endif
Expand Down
4 changes: 2 additions & 2 deletions src/support/strtod.h
Original file line number Diff line number Diff line change
Expand Up @@ -7,8 +7,8 @@
extern "C" {
#endif

double strtod_c(const char *nptr, char **endptr);
float strtof_c(const char *nptr, char **endptr);
DLLEXPORT double jl_strtod_c(const char *nptr, char **endptr);
DLLEXPORT float jl_strtof_c(const char *nptr, char **endptr);

#ifdef __cplusplus
}
Expand Down

0 comments on commit 316da80

Please sign in to comment.