Print this page
remove support for non-ANSI compilation

Split Close
Expand all
Collapse all
          --- old/usr/src/head/ieeefp.h
          +++ new/usr/src/head/ieeefp.h
↓ open down ↓ 12 lines elided ↑ open up ↑
  13   13   *
  14   14   * When distributing Covered Code, include this CDDL HEADER in each
  15   15   * file and include the License file at usr/src/OPENSOLARIS.LICENSE.
  16   16   * If applicable, add the following below this CDDL HEADER, with the
  17   17   * fields enclosed by brackets "[]" replaced with your own identifying
  18   18   * information: Portions Copyright [yyyy] [name of copyright owner]
  19   19   *
  20   20   * CDDL HEADER END
  21   21   */
  22   22  /*
       23 + * Copyright 2014 Garrett D'Amore <garrett@damore.org>
       24 + *
  23   25   * Copyright 2005 Sun Microsystems, Inc.  All rights reserved.
  24   26   * Use is subject to license terms.
  25   27   */
  26   28  
  27   29  /*      Copyright (c) 1988 AT&T */
  28   30  /*        All Rights Reserved */
  29   31  
  30   32  
  31   33  #ifndef _IEEEFP_H
  32   34  #define _IEEEFP_H
  33   35  
  34      -#pragma ident   "%Z%%M% %I%     %E% SMI"
  35      -
  36   36  #ifdef  __cplusplus
  37   37  extern "C" {
  38   38  #endif
  39   39  
  40   40  /*
  41   41   * Floating point enviornment for machines that support
  42   42   * the IEEE 754 floating-point standard.  This file currently
  43   43   * supports the 80*87, and SPARC families.
  44   44   *
  45   45   * This header defines the following interfaces:
↓ open down ↓ 16 lines elided ↑ open up ↑
  62   62          FP_NINF = 2,    /* negative infinity */
  63   63          FP_PINF = 3,    /* positive infinity */
  64   64          FP_NDENORM = 4, /* negative denormalized non-zero */
  65   65          FP_PDENORM = 5, /* positive denormalized non-zero */
  66   66          FP_NZERO = 6,   /* -0.0 */
  67   67          FP_PZERO = 7,   /* +0.0 */
  68   68          FP_NNORM = 8,   /* negative normalized non-zero */
  69   69          FP_PNORM = 9    /* positive normalized non-zero */
  70   70  } fpclass_t;
  71   71  
  72      -#if defined(__STDC__)
  73   72  extern fpclass_t fpclass(double);       /* get class of double value */
  74   73  extern int      finite(double);
  75   74  extern int      unordered(double, double);
  76      -#else
  77      -extern fpclass_t fpclass();     /* get class of double value */
  78      -#endif
  79   75  
  80   76  /*
  81   77   * ROUNDING CONTROL ******************************************
  82   78   *
  83   79   * At all times, floating-point math is done using one of four
  84   80   * mutually-exclusive rounding modes.
  85   81   */
  86   82  
  87   83  #if defined(__i386) || defined(__amd64)
  88   84  
↓ open down ↓ 18 lines elided ↑ open up ↑
 107  103   */
 108  104  typedef enum    fp_rnd {
 109  105          FP_RN = 0,      /* round to nearest representable number, tie -> even */
 110  106          FP_RZ = 1,      /* round toward zero (truncate) */
 111  107          FP_RP = 2,      /* round toward plus infinity */
 112  108          FP_RM = 3       /* round toward minus infinity */
 113  109  } fp_rnd;
 114  110  
 115  111  #endif
 116  112  
 117      -#if defined(__STDC__)
 118  113  extern fp_rnd   fpsetround(fp_rnd);     /* set rounding mode, return previous */
 119  114  extern fp_rnd   fpgetround(void);       /* return current rounding mode */
 120  115  
 121      -#else
 122      -extern fp_rnd   fpsetround();           /* set rounding mode, return previous */
 123      -extern fp_rnd   fpgetround();           /* return current rounding mode */
 124      -
 125      -#endif
 126      -
 127  116  /*
 128  117   * EXCEPTION CONTROL *****************************************
 129  118   *
 130  119   */
 131  120  
 132  121  #define fp_except       int
 133  122  
 134  123  #define FP_DISABLE      0       /* exception will be ignored */
 135  124  #define FP_ENABLE       1       /* exception will cause SIGFPE */
 136  125  #define FP_CLEAR        0       /* exception has not occurred */
↓ open down ↓ 38 lines elided ↑ open up ↑
 175  164  
 176  165  /* an fp_except can have the following (not exclusive) values: */
 177  166  #define FP_X_INV        0x10    /* invalid operation exception */
 178  167  #define FP_X_OFL        0x08    /* overflow exception */
 179  168  #define FP_X_UFL        0x04    /* underflow exception */
 180  169  #define FP_X_DZ         0x02    /* divide-by-zero exception */
 181  170  #define FP_X_IMP        0x01    /* imprecise (loss of precision) */
 182  171  
 183  172  #endif
 184  173  
 185      -#if defined(__STDC__)
 186  174  extern fp_except fpgetmask(void);               /* current exception mask */
 187  175  extern fp_except fpsetmask(fp_except);          /* set mask, return previous */
 188  176  extern fp_except fpgetsticky(void);             /* return logged exceptions */
 189  177  extern fp_except fpsetsticky(fp_except);        /* change logged exceptions */
 190  178  
 191      -#else
 192      -extern fp_except fpgetmask();   /* current exception mask */
 193      -extern fp_except fpsetmask();   /* set mask, return previous */
 194      -extern fp_except fpgetsticky(); /* return logged exceptions */
 195      -extern fp_except fpsetsticky(); /* change logged exceptions */
 196      -
 197      -#endif
 198      -
 199  179  /*
 200  180   * UTILITY MACROS ********************************************
 201  181   */
 202  182  
 203      -#if defined(__STDC__)
 204  183  extern int isnanf(float);
 205  184  extern int isnand(double);
 206  185  
 207      -#else
 208      -extern int isnand();
 209      -#define isnanf(x)       (((*(long *)&(x) & 0x7f800000L) == 0x7f800000L) && \
 210      -                            ((*(long *)&(x) & 0x007fffffL) != 0x00000000L))
 211      -#endif
 212      -
 213  186  #if defined(__i386) || defined(__amd64)
 214  187  
 215  188  /*
 216  189   * EXCEPTION HANDLING ****************************************
 217  190   *
 218  191   * When a signal handler catches an FPE, it will have a freshly initialized
 219  192   * coprocessor.  This allows signal handling routines to make use of
 220  193   * floating point arithmetic, if need be.  The previous state of the 87
 221  194   * chip is available, however.  There are two ways to get at this information,
 222  195   * depending on how the signal handler was set up.
↓ open down ↓ 105 lines elided ↑ open up ↑
XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX