John Bauman | 8940182 | 2014-05-06 15:04:28 -0400 | [diff] [blame] | 1 | // |
| 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 |
| 11 | extern "C" { |
| 12 | #endif |
| 13 | |
Alexis Hetu | 3ef0c0a | 2015-06-09 11:37:45 -0400 | [diff] [blame^] | 14 | // 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. |
| 18 | bool 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. |
| 22 | bool atoi_clamp(const char *str, int *value); |
John Bauman | 8940182 | 2014-05-06 15:04:28 -0400 | [diff] [blame] | 23 | |
| 24 | #ifdef __cplusplus |
| 25 | } // end extern "C" |
| 26 | #endif |
| 27 | |
| 28 | #endif // COMPILER_UTIL_H |