blob: dc69f39060d2051f3a2006595f30600fec2e7f77 [file] [log] [blame]
daniel@transgaming.com91ed1492010-10-29 03:11:43 +00001//
2// Copyright (c) 2002-2010 The ANGLE Project Authors. All rights reserved.
3// Use of this source code is governed by a BSD-style license that can be
4// found in the LICENSE file.
5//
6
7#ifndef COMPILER_UTIL_H
8#define COMPILER_UTIL_H
9
Zhenyao Mof1d723c2013-09-23 14:57:07 -040010// atof_clamp is like atof but
11// 1. it forces C locale, i.e. forcing '.' as decimal point.
12// 2. it clamps the value to -FLT_MAX or FLT_MAX if overflow happens.
13// Return false if overflow happens.
14extern bool atof_clamp(const char *str, float *value);
daniel@transgaming.com91ed1492010-10-29 03:11:43 +000015
Zhenyao Mof1d723c2013-09-23 14:57:07 -040016// If overflow happens, clamp the value to INT_MIN or INT_MAX.
17// Return false if overflow happens.
18extern bool atoi_clamp(const char *str, int *value);
daniel@transgaming.com91ed1492010-10-29 03:11:43 +000019
20#endif // COMPILER_UTIL_H