/*
* CDDL HEADER START
*
* The contents of this file are subject to the terms of the
* Common Development and Distribution License (the "License").
* You may not use this file except in compliance with the License.
*
* You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
* See the License for the specific language governing permissions
* and limitations under the License.
*
* When distributing Covered Code, include this CDDL HEADER in each
* file and include the License file at usr/src/OPENSOLARIS.LICENSE.
* If applicable, add the following below this CDDL HEADER, with the
* fields enclosed by brackets "[]" replaced with your own identifying
* information: Portions Copyright [yyyy] [name of copyright owner]
*
* CDDL HEADER END
*/
/*
* Copyright 2011 Nexenta Systems, Inc. All rights reserved.
*/
/*
* Copyright 2004 Sun Microsystems, Inc. All rights reserved.
* Use is subject to license terms.
*/
#ifndef _FENV_H
#define _FENV_H
#include <sys/feature_tests.h>
#ifdef __cplusplus
extern "C" {
#endif
#ifndef __P
#ifdef __STDC__
#define __P(p) p
#else
#define __P(p) ()
#endif
#endif /* !defined(__P) */
/*
* Rounding modes
*/
#if defined(__sparc)
#define FE_TONEAREST 0
#define FE_TONEAREST 0
#endif
extern int fegetround __P((void));
extern int fesetround __P((int));
(!defined(_STRICT_STDC) || defined(__EXTENSIONS__))
#define FE_FLTPREC 0
#endif
/*
* Exception flags
*/
#if defined(__sparc)
#endif
typedef int fexcept_t;
extern int feclearexcept __P((int));
extern int feraiseexcept __P((int));
extern int fetestexcept __P((int));
#if !defined(_STRICT_STDC) || defined(__EXTENSIONS__)
/*
* Exception handling extensions
*/
#define FEX_NONSTOP 0
#define FEX_NONE 0
/* structure to hold a numeric value in any format used by the FPU */
typedef struct {
enum fex_nt {
fex_nodata = 0,
} type;
union {
int i;
defined(__C99FEATURES__)
long long l;
#else
struct {
int l[2];
} l;
#endif
float f;
double d;
long double q;
} val;
/* structure to supply information about an exception to a custom handler */
typedef struct {
enum fex_op {
fex_add = 0,
} fex_info_t;
typedef struct fex_handler_data {
int __mode;
void (*__handler)();
extern int fex_get_handling __P((int));
extern int fex_set_handling __P((int, int, void (*)()));
#ifdef __STDC__
#include <stdio_tag.h>
#ifndef _FILEDEFED
#define _FILEDEFED
#endif
#endif
extern int fex_get_log_depth __P((void));
extern int fex_set_log_depth __P((int));
extern void fex_log_entry __P((const char *));
#else
typedef struct {
int __mode;
void (*__handler)();
#endif /* !defined(_STRICT_STDC) || defined(__EXTENSIONS__) */
/*
* Environment as a whole
*/
typedef struct {
unsigned long __fsr;
} fenv_t;
#ifdef __STDC__
extern const fenv_t __fenv_dfl_env;
#else
extern fenv_t __fenv_dfl_env;
#endif
#if !defined(_STRICT_STDC) || defined(__EXTENSIONS__)
#endif
#ifdef __cplusplus
}
#endif
#endif /* _FENV_H */