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 // 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. 14 extern bool atof_clamp(const char *str, float *value); 15 16 // If overflow happens, clamp the value to INT_MIN or INT_MAX. 17 // Return false if overflow happens. 18 extern bool atoi_clamp(const char *str, int *value); 19 20 #endif // COMPILER_UTIL_H 21