michael@0: // michael@0: // Copyright (c) 2010 The ANGLE Project Authors. All rights reserved. michael@0: // Use of this source code is governed by a BSD-style license that can be michael@0: // found in the LICENSE file. michael@0: // michael@0: michael@0: #include michael@0: #include michael@0: michael@0: #include "util.h" michael@0: michael@0: #ifdef _MSC_VER michael@0: #include michael@0: #else michael@0: #include michael@0: #endif michael@0: michael@0: double atof_dot(const char *str) michael@0: { michael@0: #ifdef _MSC_VER michael@0: _locale_t l = _create_locale(LC_NUMERIC, "C"); michael@0: double result = _atof_l(str, l); michael@0: _free_locale(l); michael@0: return result; michael@0: #else michael@0: double result; michael@0: std::istringstream s(str); michael@0: std::locale l("C"); michael@0: s.imbue(l); michael@0: s >> result; michael@0: return result; michael@0: #endif michael@0: }