Ticket #6230: clang-math.patch
File clang-math.patch, 1.1 KB (added by , 14 years ago) |
---|
-
headers/posix/math.h
24 24 #define __HUGE_VAL_v 0x7ff0000000000000LL 25 25 #define __huge_val_t union { unsigned char __c[8]; long long __ll; double __d; } 26 26 #ifndef HUGE_VAL 27 #ifdef __clang__ 28 #define HUGE_VAL __builtin_huge_val() 29 #else 27 30 # define HUGE_VAL (((__huge_val_t) { __ll: __HUGE_VAL_v }).__d) 28 31 #endif 32 #endif 29 33 30 34 #define __HUGE_VALF_v 0x7f800000L 31 35 #define __huge_valf_t union { unsigned char __c[4]; long __l; float __f; } 36 #ifdef __clang__ 37 #define HUGE_VALF __builtin_huge_valf() 38 #else 32 39 #define HUGE_VALF (((__huge_valf_t) { __l: __HUGE_VALF_v }).__f) 40 #endif 33 41 34 42 /* TODO: define HUGE_VALL for long doubles */ 35 43 36 44 #define __NAN_VALF_v 0x7fc00000L 45 #ifdef __clang__ 46 #define NAN __builtin_nanf("") 47 #else 37 48 #define NAN (((__huge_valf_t) { __l: __NAN_VALF_v }).__f) 49 #endif 38 50 51 #ifdef __clang__ 52 #define INFINITY __builtin_inff() 53 #else 39 54 #define INFINITY HUGE_VALF 55 #endif 40 56 41 57 /* floating-point categories */ 42 58 #define FP_NAN 0