summaryrefslogtreecommitdiffstats
path: root/src/mesa/main/imports.c
diff options
context:
space:
mode:
authorMarcin BaczyƄski <[email protected]>2010-03-13 14:26:45 +0100
committerIan Romanick <[email protected]>2010-03-15 08:38:24 -0700
commit346298c7658f2ec8b105e5e53101637af232724f (patch)
tree986b382e8be6eba02eb2fa213fad1efd1782fa8b /src/mesa/main/imports.c
parent63af29bfbe265318bcf5be69e420de361b900321 (diff)
Replace _mesa_strtod with _mesa_strtof.
Reviewed-by: Ian Romanick <[email protected]>
Diffstat (limited to 'src/mesa/main/imports.c')
-rw-r--r--src/mesa/main/imports.c12
1 files changed, 7 insertions, 5 deletions
diff --git a/src/mesa/main/imports.c b/src/mesa/main/imports.c
index 56e8195810e..1ae08533648 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
}