Home | History | Annotate | Download | only in include
      1 /*
      2  * Copyright 2013, The Android Open Source Project
      3  *
      4  * Licensed under the Apache License, Version 2.0 (the "License");
      5  * you may not use this file except in compliance with the License.
      6  * You may obtain a copy of the License at
      7  *
      8  *     http://www.apache.org/licenses/LICENSE-2.0
      9  *
     10  * Unless required by applicable law or agreed to in writing, software
     11  * distributed under the License is distributed on an "AS IS" BASIS,
     12  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
     13  * See the License for the specific language governing permissions and
     14  * limitations under the License.
     15  */
     16 
     17 #ifndef _FENV_PORTABLE_H_
     18 #define _FENV_PORTABLE_H_
     19 
     20 #include <sys/types.h>
     21 
     22 #ifdef __LP64__
     23 typedef struct {
     24   unsigned char a[28];  // x86_64 largest size
     25 } fenv_t_portable;
     26 typedef __uint32_t fexcept_t_portable;
     27 #endif
     28 
     29 /* Exception flags. */
     30 #define FE_INVALID_PORTABLE    0x01
     31 #define FE_DIVBYZERO_PORTABLE  0x02
     32 #define FE_OVERFLOW_PORTABLE   0x04
     33 #define FE_UNDERFLOW_PORTABLE  0x08
     34 #define FE_INEXACT_PORTABLE    0x10
     35 #define FE_ALL_EXCEPT_PORTABLE (FE_DIVBYZERO_PORTABLE | FE_INEXACT_PORTABLE | FE_INVALID_PORTABLE |\
     36                                 FE_OVERFLOW_PORTABLE | FE_UNDERFLOW_PORTABLE)
     37 
     38 /* Rounding modes. */
     39 #define FE_TONEAREST_PORTABLE  0x0
     40 #define FE_UPWARD_PORTABLE     0x1
     41 #define FE_DOWNWARD_PORTABLE   0x2
     42 #define FE_TOWARDZERO_PORTABLE 0x3
     43 
     44 #endif /* _FENV_PORTABLE_H_ */
     45