25c28e83beb90e7c80452a7c818c5e6f73a07dc8Piotr Jasiukajtis * CDDL HEADER START
25c28e83beb90e7c80452a7c818c5e6f73a07dc8Piotr Jasiukajtis * The contents of this file are subject to the terms of the
25c28e83beb90e7c80452a7c818c5e6f73a07dc8Piotr Jasiukajtis * Common Development and Distribution License (the "License").
25c28e83beb90e7c80452a7c818c5e6f73a07dc8Piotr Jasiukajtis * You may not use this file except in compliance with the License.
25c28e83beb90e7c80452a7c818c5e6f73a07dc8Piotr Jasiukajtis * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
25c28e83beb90e7c80452a7c818c5e6f73a07dc8Piotr Jasiukajtis * or http://www.opensolaris.org/os/licensing.
25c28e83beb90e7c80452a7c818c5e6f73a07dc8Piotr Jasiukajtis * See the License for the specific language governing permissions
25c28e83beb90e7c80452a7c818c5e6f73a07dc8Piotr Jasiukajtis * and limitations under the License.
25c28e83beb90e7c80452a7c818c5e6f73a07dc8Piotr Jasiukajtis * When distributing Covered Code, include this CDDL HEADER in each
25c28e83beb90e7c80452a7c818c5e6f73a07dc8Piotr Jasiukajtis * file and include the License file at usr/src/OPENSOLARIS.LICENSE.
25c28e83beb90e7c80452a7c818c5e6f73a07dc8Piotr Jasiukajtis * If applicable, add the following below this CDDL HEADER, with the
25c28e83beb90e7c80452a7c818c5e6f73a07dc8Piotr Jasiukajtis * fields enclosed by brackets "[]" replaced with your own identifying
25c28e83beb90e7c80452a7c818c5e6f73a07dc8Piotr Jasiukajtis * information: Portions Copyright [yyyy] [name of copyright owner]
25c28e83beb90e7c80452a7c818c5e6f73a07dc8Piotr Jasiukajtis * CDDL HEADER END
25c28e83beb90e7c80452a7c818c5e6f73a07dc8Piotr Jasiukajtis * Copyright 2011 Nexenta Systems, Inc. All rights reserved.
25c28e83beb90e7c80452a7c818c5e6f73a07dc8Piotr Jasiukajtis * Copyright 2004 Sun Microsystems, Inc. All rights reserved.
25c28e83beb90e7c80452a7c818c5e6f73a07dc8Piotr Jasiukajtis * Use is subject to license terms.
25c28e83beb90e7c80452a7c818c5e6f73a07dc8Piotr Jasiukajtis#endif /* !defined(__P) */
25c28e83beb90e7c80452a7c818c5e6f73a07dc8Piotr Jasiukajtis * Rounding modes
25c28e83beb90e7c80452a7c818c5e6f73a07dc8Piotr Jasiukajtis#if (defined(__i386) || defined(__amd64)) && \
25c28e83beb90e7c80452a7c818c5e6f73a07dc8Piotr Jasiukajtis (!defined(_STRICT_STDC) || defined(__EXTENSIONS__))
25c28e83beb90e7c80452a7c818c5e6f73a07dc8Piotr Jasiukajtis * Exception flags
25c28e83beb90e7c80452a7c818c5e6f73a07dc8Piotr Jasiukajtisextern int fegetexceptflag __P((fexcept_t *, int));
25c28e83beb90e7c80452a7c818c5e6f73a07dc8Piotr Jasiukajtisextern int fesetexceptflag __P((const fexcept_t *, int));
25c28e83beb90e7c80452a7c818c5e6f73a07dc8Piotr Jasiukajtis#if !defined(_STRICT_STDC) || defined(__EXTENSIONS__)
25c28e83beb90e7c80452a7c818c5e6f73a07dc8Piotr Jasiukajtis * Exception handling extensions
25c28e83beb90e7c80452a7c818c5e6f73a07dc8Piotr Jasiukajtis#define FEX_COMMON (FEX_INVALID | FEX_DIVBYZERO | FEX_OVERFLOW)
25c28e83beb90e7c80452a7c818c5e6f73a07dc8Piotr Jasiukajtis#define FEX_ALL (FEX_COMMON | FEX_UNDERFLOW | FEX_INEXACT)
25c28e83beb90e7c80452a7c818c5e6f73a07dc8Piotr Jasiukajtis/* structure to hold a numeric value in any format used by the FPU */
25c28e83beb90e7c80452a7c818c5e6f73a07dc8Piotr Jasiukajtistypedef struct {
25c28e83beb90e7c80452a7c818c5e6f73a07dc8Piotr Jasiukajtis#if !defined(_STRICT_STDC) && !defined(_NO_LONGLONG) || defined(_STDC_C99) || \
25c28e83beb90e7c80452a7c818c5e6f73a07dc8Piotr Jasiukajtis long double q;
25c28e83beb90e7c80452a7c818c5e6f73a07dc8Piotr Jasiukajtis/* structure to supply information about an exception to a custom handler */
25c28e83beb90e7c80452a7c818c5e6f73a07dc8Piotr Jasiukajtistypedef struct {
25c28e83beb90e7c80452a7c818c5e6f73a07dc8Piotr Jasiukajtis } op; /* operation that caused the exception */
25c28e83beb90e7c80452a7c818c5e6f73a07dc8Piotr Jasiukajtis fex_numeric_t op1, op2, res; /* operands and result */
25c28e83beb90e7c80452a7c818c5e6f73a07dc8Piotr Jasiukajtisextern int fex_set_handling __P((int, int, void (*)()));
25c28e83beb90e7c80452a7c818c5e6f73a07dc8Piotr Jasiukajtisextern void fex_getexcepthandler __P((fex_handler_t *, int));
25c28e83beb90e7c80452a7c818c5e6f73a07dc8Piotr Jasiukajtisextern void fex_setexcepthandler __P((const fex_handler_t *, int));
25c28e83beb90e7c80452a7c818c5e6f73a07dc8Piotr Jasiukajtisextern void fex_log_entry __P((const char *));
25c28e83beb90e7c80452a7c818c5e6f73a07dc8Piotr Jasiukajtistypedef struct {
25c28e83beb90e7c80452a7c818c5e6f73a07dc8Piotr Jasiukajtis#endif /* !defined(_STRICT_STDC) || defined(__EXTENSIONS__) */
25c28e83beb90e7c80452a7c818c5e6f73a07dc8Piotr Jasiukajtis * Environment as a whole
25c28e83beb90e7c80452a7c818c5e6f73a07dc8Piotr Jasiukajtistypedef struct {
25c28e83beb90e7c80452a7c818c5e6f73a07dc8Piotr Jasiukajtisextern int feupdateenv __P((const fenv_t *));
25c28e83beb90e7c80452a7c818c5e6f73a07dc8Piotr Jasiukajtis#if !defined(_STRICT_STDC) || defined(__EXTENSIONS__)
25c28e83beb90e7c80452a7c818c5e6f73a07dc8Piotr Jasiukajtisextern void fex_merge_flags __P((const fenv_t *));
25c28e83beb90e7c80452a7c818c5e6f73a07dc8Piotr Jasiukajtis#endif /* _FENV_H */