src/hb-common.cc: Fix build on older Visual Studio
authorChun-wei Fan <fanchunwei@src.gnome.org>
Fri, 24 Feb 2017 09:58:25 +0000 (17:58 +0800)
committerKhaled Hosny <khaledhosny@eglug.org>
Wed, 22 Mar 2017 21:03:49 +0000 (23:03 +0200)
Visual Studio only supported strtof() from Visual Studio 2013 onwards, so
use strtod() instead to do the operation, which should do the same thing,
sans going to a double, not a float.

src/hb-common.cc

index 64e77d4..4c1a9a8 100644 (file)
@@ -667,7 +667,11 @@ parse_float (const char **pp, const char *end, float *pv)
   float v;
 
   errno = 0;
+#if defined (_MSC_VER) && (_MSC_VER < 1800)
+  v = strtod (p, &pend);
+#else
   v = strtof (p, &pend);
+#endif
   if (errno || p == pend)
     return false;