blob: 61442be3b13228d61e6bf853c98e101164c514c9 [file] [log] [blame]
John Bauman89401822014-05-06 15:04:28 -04001//
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
10#ifdef __cplusplus
11extern "C" {
12#endif
13
Alexis Hetu3ef0c0a2015-06-09 11:37:45 -040014// atof_clamp is like atof but
15// 1. it forces C locale, i.e. forcing '.' as decimal point.
16// 2. it clamps the value to -FLT_MAX or FLT_MAX if overflow happens.
17// Return false if overflow happens.
18bool atof_clamp(const char *str, float *value);
19
20// If overflow happens, clamp the value to INT_MIN or INT_MAX.
21// Return false if overflow happens.
22bool atoi_clamp(const char *str, int *value);
John Bauman89401822014-05-06 15:04:28 -040023
24#ifdef __cplusplus
25} // end extern "C"
26#endif
27
28#endif // COMPILER_UTIL_H