Print this page
remove support for non-ANSI compilation

Split Close
Expand all
Collapse all
          --- old/usr/src/uts/common/sys/int_limits.h
          +++ new/usr/src/uts/common/sys/int_limits.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 2004 Sun Microsystems, Inc.  All rights reserved.
  24   26   * Use is subject to license terms.
  25   27   */
  26   28  
  27   29  #ifndef _SYS_INT_LIMITS_H
  28   30  #define _SYS_INT_LIMITS_H
  29   31  
  30      -#pragma ident   "%Z%%M% %I%     %E% SMI"
  31      -
  32   32  /*
  33   33   * This file, <sys/int_limits.h>, is part of the Sun Microsystems implementation
  34   34   * of <inttypes.h> as defined in the ISO C standard, ISO/IEC 9899:1999
  35   35   * Programming language - C.
  36   36   *
  37   37   * Programs/Modules should not directly include this file.  Access to the
  38   38   * types defined in this file should be through the inclusion of one of the
  39   39   * following files:
  40   40   *
  41   41   *      <limits.h>              This nested inclusion is disabled for strictly
↓ open down ↓ 31 lines elided ↑ open up ↑
  73   73   * a particular size of integer by testing if the macro that gives the
  74   74   * maximum for that datatype is defined. For example, if #ifdef UINT64_MAX
  75   75   * tests false, the implementation does not support unsigned 64 bit integers.
  76   76   *
  77   77   * The type of these macros is intentionally unspecified.
  78   78   *
  79   79   * The types int8_t, int_least8_t, and int_fast8_t are not defined for ISAs
  80   80   * where the ABI specifies "char" as unsigned when the translation mode is
  81   81   * not ANSI-C.
  82   82   */
  83      -#if defined(_CHAR_IS_SIGNED) || defined(__STDC__)
  84   83  #define INT8_MAX        (127)
  85      -#endif
  86   84  #define INT16_MAX       (32767)
  87   85  #define INT32_MAX       (2147483647)
  88   86  #if defined(_LP64)
  89   87  #define INT64_MAX       (9223372036854775807L)
  90   88  #elif defined(_LONGLONG_TYPE)
  91   89  #define INT64_MAX       (9223372036854775807LL)
  92   90  #endif
  93   91  
  94   92  #define UINT8_MAX       (255U)
  95   93  #define UINT16_MAX      (65535U)
↓ open down ↓ 9 lines elided ↑ open up ↑
 105  103  #else
 106  104  #define INTMAX_MAX      INT32_MAX
 107  105  #endif
 108  106  
 109  107  #ifdef UINT64_MAX
 110  108  #define UINTMAX_MAX     UINT64_MAX
 111  109  #else
 112  110  #define UINTMAX_MAX     UINT32_MAX
 113  111  #endif
 114  112  
 115      -#if defined(_CHAR_IS_SIGNED) || defined(__STDC__)
 116  113  #define INT_LEAST8_MAX  INT8_MAX
 117      -#endif
 118  114  #define INT_LEAST16_MAX INT16_MAX
 119  115  #define INT_LEAST32_MAX INT32_MAX
 120  116  #ifdef INT64_MAX
 121  117  #define INT_LEAST64_MAX INT64_MAX
 122  118  #endif
 123  119  
 124  120  #define UINT_LEAST8_MAX UINT8_MAX
 125  121  #define UINT_LEAST16_MAX UINT16_MAX
 126  122  #define UINT_LEAST32_MAX UINT32_MAX
 127  123  #ifdef UINT64_MAX
 128  124  #define UINT_LEAST64_MAX UINT64_MAX
 129  125  #endif
 130  126  
 131      -#if defined(_CHAR_IS_SIGNED) || defined(__STDC__)
 132  127  #define INT_FAST8_MAX   INT8_MAX
 133      -#endif
 134  128  #define INT_FAST16_MAX INT16_MAX
 135  129  #define INT_FAST32_MAX INT32_MAX
 136  130  #ifdef INT64_MAX
 137  131  #define INT_FAST64_MAX INT64_MAX
 138  132  #endif
 139  133  
 140  134  #define UINT_FAST8_MAX  UINT8_MAX
 141  135  #define UINT_FAST16_MAX UINT16_MAX
 142  136  #define UINT_FAST32_MAX UINT32_MAX
 143  137  #ifdef UINT64_MAX
↓ open down ↓ 53 lines elided ↑ open up ↑
 197  191  #define WINT_MAX        2147483647
 198  192  #endif
 199  193  
 200  194  /*
 201  195   * It is probably a bug in the POSIX specification (IEEE-1003.1-1990) that
 202  196   * when including <limits.h> that the suffix _MAX is reserved but not the
 203  197   * suffix _MIN.  However, until that issue is resolved....
 204  198   */
 205  199  #if defined(__EXTENSIONS__) || !defined(__XOPEN_OR_POSIX) || defined(_XPG6)
 206  200  
 207      -#if defined(_CHAR_IS_SIGNED) || defined(__STDC__)
 208  201  #define INT8_MIN        (-128)
 209      -#endif
 210  202  #define INT16_MIN       (-32767-1)
 211  203  #define INT32_MIN       (-2147483647-1)
 212  204  #if defined(_LP64)
 213  205  #define INT64_MIN       (-9223372036854775807L-1)
 214  206  #elif defined(_LONGLONG_TYPE)
 215  207  #define INT64_MIN       (-9223372036854775807LL-1)
 216  208  #endif
 217  209  
 218  210  #ifdef INT64_MIN
 219  211  #define INTMAX_MIN      INT64_MIN
 220  212  #else
 221  213  #define INTMAX_MIN      INT32_MIN
 222  214  #endif
 223  215  
 224      -#if defined(_CHAR_IS_SIGNED) || defined(__STDC__)
 225  216  #define INT_LEAST8_MIN  INT8_MIN
 226      -#endif
 227  217  #define INT_LEAST16_MIN INT16_MIN
 228  218  #define INT_LEAST32_MIN INT32_MIN
 229  219  #ifdef INT64_MIN
 230  220  #define INT_LEAST64_MIN INT64_MIN
 231  221  #endif
 232  222  
 233      -#if defined(_CHAR_IS_SIGNED) || defined(__STDC__)
 234  223  #define INT_FAST8_MIN   INT8_MIN
 235      -#endif
 236  224  #define INT_FAST16_MIN  INT16_MIN
 237  225  #define INT_FAST32_MIN INT32_MIN
 238  226  #ifdef INT64_MIN
 239  227  #define INT_FAST64_MIN  INT64_MIN
 240  228  #endif
 241  229  
 242  230  /* Minimum value of a pointer-holding signed integer type */
 243  231  #if defined(_LP64) || defined(_I32LPx)
 244  232  #define INTPTR_MIN      INT64_MIN
 245  233  #else
↓ open down ↓ 36 lines elided ↑ open up ↑
XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX