1 //===-- Definitions of common types from the C standard. ------------------===// 2 // 3 // Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions. 4 // See https://llvm.org/LICENSE.txt for license information. 5 // SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception 6 // 7 //===----------------------------------------------------------------------===// 8 9 // This header file does not have a header guard. It is internal to LLVM libc 10 // and intended to be used to pick specific definitions without polluting the 11 // public headers with unnecessary definitions. 12 13 #undef __LLVM_LIBC_FLOAT_T 14 #undef __LLVM_LIBC_DOUBLE_T 15 16 #if !defined(__FLT_EVAL_METHOD__) || __FLT_EVAL_METHOD__ == 0 17 #define __LLVM_LIBC_FLOAT_T float 18 #define __LLVM_LIBC_DOUBLE_T double 19 #elif __FLT_EVAL_METHOD__ == 1 20 #define __LLVM_LIBC_FLOAT_T double 21 #define __LLVM_LIBC_DOUBLE_T double 22 #elif __FLT_EVAL_METHOD__ == 2 23 #define __LLVM_LIBC_FLOAT_T long double 24 #define __LLVM_LIBC_DOUBLE_T long double 25 #else 26 #error "Unsupported __FLT_EVAL_METHOD__ value." 27 #endif 28 29 #if defined(__need_float_t) && !defined(__llvm_libc_float_t_defined) 30 typedef __LLVM_LIBC_FLOAT_T float_t; 31 #define __llvm_libc_float_t_defined 32 #endif // __need_float_t 33 34 #if defined(__need_double_t) && !defined(__llvm_libc_double_t_defined) 35 typedef __LLVM_LIBC_DOUBLE_T double_t; 36 #define __llvm_libc_double_t_defined 37 #endif // __need_double_t 38