diff options
Diffstat (limited to 'src/mesa/main')
-rw-r--r-- | src/mesa/main/imports.c | 12 | ||||
-rw-r--r-- | src/mesa/main/imports.h | 4 |
2 files changed, 9 insertions, 7 deletions
diff --git a/src/mesa/main/imports.c b/src/mesa/main/imports.c index 56e8195810..1ae0853364 100644 --- a/src/mesa/main/imports.c +++ b/src/mesa/main/imports.c @@ -795,18 +795,20 @@ _mesa_strdup( const char *s ) } } -/** Wrapper around strtod() */ -double -_mesa_strtod( const char *s, char **end ) +/** Wrapper around strtof() */ +float +_mesa_strtof( const char *s, char **end ) { #ifdef _GNU_SOURCE static locale_t loc = NULL; if (!loc) { loc = newlocale(LC_CTYPE_MASK, "C", NULL); } - return strtod_l(s, end, loc); + return strtof_l(s, end, loc); +#elif defined(_ISOC99_SOURCE) || (defined(_XOPEN_SOURCE) && _XOPEN_SOURCE >= 600) + return strtof(s, end); #else - return strtod(s, end); + return (float)strtod(s, end); #endif } diff --git a/src/mesa/main/imports.h b/src/mesa/main/imports.h index fb4a00eca7..d28f4ad125 100644 --- a/src/mesa/main/imports.h +++ b/src/mesa/main/imports.h @@ -575,8 +575,8 @@ _mesa_getenv( const char *var ); extern char * _mesa_strdup( const char *s ); -extern double -_mesa_strtod( const char *s, char **end ); +extern float +_mesa_strtof( const char *s, char **end ); extern unsigned int _mesa_str_checksum(const char *str); |