components/stdcxx/patches/002-cstdint.patch
changeset 402 94ae4d75524c
equal deleted inserted replaced
401:bf52ef48020c 402:94ae4d75524c
       
     1 --- stdcxx-4.2.1/include/tr1/cstdint	2008-04-24 20:23:49.000000000 -0400
       
     2 +++ stdcxx-4.2.1/include/tr1/cstdint	2009-03-28 01:54:56.000000000 -0400
       
     3 @@ -1,359 +1,68 @@
       
     4  // -*- C++ -*-
       
     5 -/***************************************************************************
       
     6 +/**
       
     7 + * CDDL HEADER START
       
     8   *
       
     9 - * cstdint - definition of integer types [tr.c99.cstdint]
       
    10 - *
       
    11 - * $Id: cstdint 590052 2007-10-30 12:44:14Z faridz $
       
    12 - *
       
    13 - ***************************************************************************
       
    14 - *
       
    15 - * Licensed to the Apache Software  Foundation (ASF) under one or more
       
    16 - * contributor  license agreements.  See  the NOTICE  file distributed
       
    17 - * with  this  work  for  additional information  regarding  copyright
       
    18 - * ownership.   The ASF  licenses this  file to  you under  the Apache
       
    19 - * License, Version  2.0 (the  "License"); you may  not use  this file
       
    20 - * except in  compliance with the License.   You may obtain  a copy of
       
    21 - * the License at
       
    22 - *
       
    23 - * http://www.apache.org/licenses/LICENSE-2.0
       
    24 - *
       
    25 - * Unless required by applicable law or agreed to in writing, software
       
    26 - * distributed under the  License is distributed on an  "AS IS" BASIS,
       
    27 - * WITHOUT  WARRANTIES OR CONDITIONS  OF ANY  KIND, either  express or
       
    28 - * implied.   See  the License  for  the  specific language  governing
       
    29 - * permissions and limitations under the License.
       
    30 - *
       
    31 - * Copyright 2006 Rogue Wave Software.
       
    32 - * 
       
    33 - **************************************************************************/
       
    34 -
       
    35 -#ifndef _RWSTD_TR1_CSTDINT_INCLUDED
       
    36 -#define _RWSTD_TR1_CSTDINT_INCLUDED
       
    37 -
       
    38 -
       
    39 -#include <rw/_defs.h>
       
    40 -
       
    41 -
       
    42 -_RWSTD_NAMESPACE (std) {
       
    43 -
       
    44 -_RWSTD_NAMESPACE (tr1) {
       
    45 -
       
    46 -#ifndef _RWSTD_BNO_TWOS_COMPLEMENT
       
    47 -#  define _RWSTD_T_MIN(tmax)   (-(tmax) - 1)
       
    48 -#else
       
    49 -#  define _RWSTD_T_MIN(tmax)   -(tmax)
       
    50 -#endif
       
    51 -
       
    52 -
       
    53 -/*** int8_t ***************************************************************/
       
    54 -
       
    55 -#ifdef _RWSTD_INT8_T
       
    56 -
       
    57 -// optional exact width types
       
    58 -typedef _RWSTD_INT8_T       int8_t;
       
    59 -typedef _RWSTD_UINT8_T      uint8_t;
       
    60 -
       
    61 -#  define INT8_MAX          127
       
    62 -#  define UINT8_MAX         255U
       
    63 -#  define INT_LEAST8_MAX    INT8_MAX
       
    64 -#  define UINT_LEAST8_MAX   UINT8_MAX
       
    65 -#  define INT_FAST8_MAX     INT8_MAX
       
    66 -#  define UINT_FAST8_MAX    UINT8_MAX
       
    67 -
       
    68 -#elif defined (_RWSTD_INT16_T)
       
    69 -
       
    70 -#  define INT_LEAST8_MAX    32767
       
    71 -#  define UINT_LEAST8_MAX   65535U
       
    72 -#  define INT_FAST8_MAX     32767
       
    73 -#  define UINT_FAST8_MAX    65535U
       
    74 -
       
    75 -#elif defined (_RWSTD_INT32_T)
       
    76 -
       
    77 -#  if 4 == _RWSTD_INT_SIZE
       
    78 -#    define INT_LEAST8_MAX    _RWSTD_INT_MAX
       
    79 -#    define UINT_LEAST8_MAX   _RWSTD_UINT_MAX
       
    80 -#    define INT_FAST8_MAX     _RWSTD_INT_MAX
       
    81 -#    define UINT_FAST8_MAX    _RWSTD_UINT_MAX
       
    82 -#  elif 4 == _RWSTD_LONG_SIZE
       
    83 -#    define INT_LEAST8_MAX    _RWSTD_LONG_MAX
       
    84 -#    define UINT_LEAST8_MAX   _RWSTD_ULONG_MAX
       
    85 -#    define INT_FAST8_MAX     _RWSTD_LONG_MAX
       
    86 -#    define UINT_FAST8_MAX    _RWSTD_ULONG_MAX
       
    87 -#  endif
       
    88 -
       
    89 -#elif defined (_RWSTD_INT64_T)
       
    90 -
       
    91 -#  if 8 == _RWSTD_LONG_SIZE
       
    92 -#    define INT_LEAST8_MAX    _RWSTD_LONG_MAX
       
    93 -#    define UINT_LEAST8_MAX   _RWSTD_ULONG_MAX
       
    94 -#    define INT_FAST8_MAX     _RWSTD_LONG_MAX
       
    95 -#    define UINT_FAST8_MAX    _RWSTD_ULONG_MAX
       
    96 -#  elif 8 == _RWSTD_LLONG_SIZE
       
    97 -#    define INT_LEAST8_MAX    _RWSTD_LLONG_MAX
       
    98 -#    define UINT_LEAST8_MAX   _RWSTD_ULLONG_MAX
       
    99 -#    define INT_FAST8_MAX     _RWSTD_LLONG_MAX
       
   100 -#    define UINT_FAST8_MAX    _RWSTD_ULLONG_MAX
       
   101 -#  endif
       
   102 -
       
   103 -#else   // fallback on int
       
   104 -
       
   105 -#  define INT_LEAST8_MAX    _RWSTD_INT_MAX
       
   106 -#  define UINT_LEAST8_MAX   _RWSTD_UINT_MAX
       
   107 -#  define INT_FAST8_MAX     _RWSTD_INT_MAX
       
   108 -#  define UINT_FAST8_MAX    _RWSTD_UINT_MAX
       
   109 -
       
   110 -#endif   // _RWSTD_INT{8,16,32,64}_T
       
   111 -
       
   112 -
       
   113 -/*** int16_t **************************************************************/
       
   114 -
       
   115 -#ifdef _RWSTD_INT16_T
       
   116 -
       
   117 -// optional exact width types
       
   118 -typedef _RWSTD_INT16_T       int16_t;
       
   119 -typedef _RWSTD_UINT16_T      uint16_t;
       
   120 -
       
   121 -#  define INT16_MAX          32767
       
   122 -#  define UINT16_MAX         65535U
       
   123 -
       
   124 -#  define INT_LEAST16_MAX    INT16_MAX
       
   125 -#  define UINT_LEAST16_MAX   UINT16_MAX
       
   126 -#  define INT_FAST16_MAX     INT16_MAX
       
   127 -#  define UINT_FAST16_MAX    UINT16_MAX
       
   128 -
       
   129 -#elif defined (_RWSTD_INT32_T)
       
   130 -
       
   131 -#  if 4 == _RWSTD_INT_SIZE
       
   132 -#    define INT_LEAST16_MAX    _RWSTD_INT_MAX
       
   133 -#    define UINT_LEAST16_MAX   _RWSTD_UINT_MAX
       
   134 -#    define INT_FAST16_MAX     _RWSTD_INT_MAX
       
   135 -#    define UINT_FAST16_MAX    _RWSTD_UINT_MAX
       
   136 -#  elif 4 == _RWSTD_LONG_SIZE
       
   137 -#    define INT_LEAST16_MAX    _RWSTD_LONG_MAX
       
   138 -#    define UINT_LEAST16_MAX   _RWSTD_ULONG_MAX
       
   139 -#    define INT_FAST16_MAX     _RWSTD_LONG_MAX
       
   140 -#    define UINT_FAST16_MAX    _RWSTD_ULONG_MAX
       
   141 -#  endif
       
   142 -
       
   143 -#elif defined (_RWSTD_INT64_T)
       
   144 -
       
   145 -#  if 8 == _RWSTD_LONG_SIZE
       
   146 -#    define INT_LEAST16_MAX    _RWSTD_LONG_MAX
       
   147 -#    define UINT_LEAST16_MAX   _RWSTD_ULONG_MAX
       
   148 -#    define INT_FAST16_MAX     _RWSTD_LONG_MAX
       
   149 -#    define UINT_FAST16_MAX    _RWSTD_ULONG_MAX
       
   150 -#  elif 8 == _RWSTD_LLONG_SIZE
       
   151 -#    define INT_LEAST16_MAX    _RWSTD_LLONG_MAX
       
   152 -#    define UINT_LEAST16_MAX   _RWSTD_ULLONG_MAX
       
   153 -#    define INT_FAST16_MAX     _RWSTD_LLONG_MAX
       
   154 -#    define UINT_FAST16_MAX    _RWSTD_ULLONG_MAX
       
   155 -#  endif
       
   156 -
       
   157 -#else   // fallback on int
       
   158 -
       
   159 -#  define INT_LEAST16_MAX    _RWSTD_INT_MAX
       
   160 -#  define UINT_LEAST16_MAX   _RWSTD_UINT_MAX
       
   161 -#  define INT_FAST16_MAX     _RWSTD_INT_MAX
       
   162 -#  define UINT_FAST16_MAX    _RWSTD_UINT_MAX
       
   163 -
       
   164 -#endif   // _RWSTD_INT{16,32,64}_T
       
   165 -
       
   166 -
       
   167 -/*** int32_t **************************************************************/
       
   168 -
       
   169 -#ifdef _RWSTD_INT32_T
       
   170 -
       
   171 -// optional exact width types
       
   172 -typedef _RWSTD_INT32_T       int32_t;
       
   173 -typedef _RWSTD_UINT32_T      uint32_t;
       
   174 -
       
   175 -#  if 4 == _RWSTD_INT_SIZE
       
   176 -#    define INT32_MAX          _RWSTD_INT_MAX
       
   177 -#    define UINT32_MAX         _RWSTD_UINT_MAX
       
   178 -#  elif 4 == _RWSTD_LONG_SIZE
       
   179 -#    define INT32_MAX          _RWSTD_LONG_MAX
       
   180 -#    define UINT32_MAX         _RWSTD_LONG_MAX
       
   181 -#  endif
       
   182 -
       
   183 -#  define INT_LEAST32_MAX      INT32_MAX
       
   184 -#  define UINT_LEAST32_MAX     UINT32_MAX
       
   185 -#  define INT_FAST32_MAX       INT32_MAX
       
   186 -#  define UINT_FAST32_MAX      UINT32_MAX
       
   187 -
       
   188 -#elif defined (_RWSTD_INT64_T)
       
   189 -
       
   190 -#  if 8 == _RWSTD_LONG_SIZE
       
   191 -#    define INT_LEAST32_MAX    _RWSTD_LONG_MAX
       
   192 -#    define UINT_LEAST32_MAX   _RWSTD_ULONG_MAX
       
   193 -#    define INT_FAST32_MAX     _RWSTD_LONG_MAX
       
   194 -#    define UINT_FAST32_MAX    _RWSTD_ULONG_MAX
       
   195 -#  elif 8 == _RWSTD_LLONG_SIZE
       
   196 -#    define INT_LEAST32_MAX    _RWSTD_LLONG_MAX
       
   197 -#    define UINT_LEAST32_MAX   _RWSTD_ULLONG_MAX
       
   198 -#    define INT_FAST32_MAX     _RWSTD_LLONG_MAX
       
   199 -#    define UINT_FAST32_MAX    _RWSTD_ULLONG_MAX
       
   200 -#  endif
       
   201 -
       
   202 -#else   // fallback on int
       
   203 -
       
   204 -#  define INT32_MAX          _RWSTD_INT_MAX
       
   205 -#  define UINT32_MAX         _RWSTD_UINT_MAX
       
   206 -#  define INT_LEAST32_MAX    _RWSTD_INT_MAX
       
   207 -#  define UINT_LEAST32_MAX   _RWSTD_UINT_MAX
       
   208 -#  define INT_FAST32_MAX     _RWSTD_INT_MAX
       
   209 -#  define UINT_FAST32_MAX    _RWSTD_UINT_MAX
       
   210 -
       
   211 -#endif   // _RWSTD_INT{32,64}_T
       
   212 -
       
   213 -
       
   214 -/*** int64_t **************************************************************/
       
   215 -
       
   216 -#ifdef _RWSTD_INT64_T
       
   217 -
       
   218 -// optional exact width types
       
   219 -typedef _RWSTD_INT64_T   int64_t;
       
   220 -typedef _RWSTD_UINT64_T  uint64_t;
       
   221 -
       
   222 -// 7.18.2.5 of C99 requires that intmax_t be at least 64-bits wide
       
   223 -typedef _RWSTD_INT64_T   intmax_t;
       
   224 -typedef _RWSTD_UINT64_T  uintmax_t;
       
   225 -
       
   226 -#  if 8 == _RWSTD_LONG_SIZE
       
   227 -#    define INT64_MAX          _RWSTD_LONG_MAX
       
   228 -#    define UINT64_MAX         _RWSTD_ULONG_MAX
       
   229 -#  elif 8 == _RWSTD_LLONG_SIZE
       
   230 -#    define INT64_MAX          _RWSTD_LLONG_MAX
       
   231 -#    define UINT64_MAX         _RWSTD_ULLONG_MAX
       
   232 -#  endif
       
   233 -
       
   234 -#  define INT_LEAST64_MAX    INT64_MAX
       
   235 -#  define UINT_LEAST64_MAX   UINT64_MAX
       
   236 -#  define INT_FAST64_MAX     INT64_MAX
       
   237 -#  define UINT_FAST64_MAX    UINT64_MAX
       
   238 -
       
   239 -#elif defined (_RWSTD_LONG_LONG)      // fallback on long long
       
   240 -
       
   241 -// this possibly violates 7.18.2.5 of C99 which requires that intmax_t
       
   242 -// be at least 64-bits wide
       
   243 -typedef _RWSTD_LONG_LONG             intmax_t;
       
   244 -typedef unsigned _RWSTD_LONG_LONG    uintmax_t;
       
   245 -
       
   246 -#else   // fallback on long
       
   247 -
       
   248 -// this likely violates 7.18.2.5 of C99 which requires that intmax_t
       
   249 -// be at least 64-bits wide
       
   250 -typedef long           intmax_t;
       
   251 -typedef unsigned long  uintmax_t;
       
   252 -
       
   253 -#endif   // _RWSTD_INT{64,32,16}_T
       
   254 -
       
   255 -/*** intptr_t *************************************************************/
       
   256 -
       
   257 -#if 8 == _RWSTD_PTR_SIZE
       
   258 -
       
   259 -typedef _RWSTD_INT64_T    intptr_t;
       
   260 -typedef _RWSTD_UINT64_T   uintptr_t;
       
   261 -
       
   262 -#  define INTPTR_MAX      INT64_MAX
       
   263 -#  define UINTPTR_MAX     UINT64_MAX
       
   264 -
       
   265 -#elif 4 == _RWSTD_PTR_SIZE
       
   266 -
       
   267 -typedef _RWSTD_INT32_T    intptr_t;
       
   268 -typedef _RWSTD_UINT32_T   uintptr_t;
       
   269 -
       
   270 -#  define INTPTR_MAX      INT32_MAX
       
   271 -#  define UINTPTR_MAX     UINT32_MAX
       
   272 -
       
   273 -#elif 2 == _RWSTD_PTR_SIZE
       
   274 -
       
   275 -typedef _RWSTD_INT16_T    intptr_t;
       
   276 -typedef _RWSTD_UINT16_T   uintptr_t;
       
   277 -
       
   278 -#  define INTPTR_MAX      INT16_MAX
       
   279 -#  define UINTPTR_MAX     UINT16_MAX
       
   280 -
       
   281 -#else   // fallback on long
       
   282 -
       
   283 -typedef long              intptr_t;
       
   284 -typedef unsigned long     uintptr_t;
       
   285 -
       
   286 -#  define INTPTR_MAX      _RWSTD_LONG_MAX
       
   287 -#  define UINTPTR_MAX     _RWSTD_LONG_MAX
       
   288 -
       
   289 -#endif   // {8,16,32,64} == _RWSTD_PTR_SIZE
       
   290 -
       
   291 -/*** least and fast types *************************************************/
       
   292 -
       
   293 -typedef _RWSTD_INT_LEAST8_T       int_least8_t;
       
   294 -typedef _RWSTD_UINT_LEAST8_T      uint_least8_t;
       
   295 -typedef _RWSTD_INT_LEAST8_T       int_fast8_t;
       
   296 -typedef _RWSTD_UINT_LEAST8_T      uint_fast8_t;
       
   297 -
       
   298 -typedef _RWSTD_INT_LEAST16_T      int_least16_t;
       
   299 -typedef _RWSTD_UINT_LEAST16_T     uint_least16_t;
       
   300 -typedef _RWSTD_INT_LEAST16_T      int_fast16_t;
       
   301 -typedef _RWSTD_UINT_LEAST16_T     uint_fast16_t;
       
   302 -
       
   303 -typedef _RWSTD_INT_LEAST32_T      int_least32_t;
       
   304 -typedef _RWSTD_UINT_LEAST32_T     uint_least32_t;
       
   305 -typedef _RWSTD_INT_LEAST32_T      int_fast32_t;
       
   306 -typedef _RWSTD_UINT_LEAST32_T     uint_fast32_t;
       
   307 -
       
   308 -#ifdef _RWSTD_INT_LEAST64_T
       
   309 -
       
   310 -typedef _RWSTD_INT_LEAST64_T      int_least64_t;
       
   311 -typedef _RWSTD_UINT_LEAST64_T     uint_least64_t;
       
   312 -typedef _RWSTD_INT_LEAST64_T      int_fast64_t;
       
   313 -typedef _RWSTD_UINT_LEAST64_T     uint_fast64_t;
       
   314 -
       
   315 -#endif   // _RWSTD_INT_LEAST64_T
       
   316 -
       
   317 -#ifdef _RWSTD_INT_LEAST128_T
       
   318 -
       
   319 -typedef _RWSTD_INT_LEAST128_T     int_least128_t;
       
   320 -typedef _RWSTD_UINT_LEAST128_T    uint_least128_t;
       
   321 -typedef _RWSTD_INT_LEAST128_T     int_fast128_t;
       
   322 -typedef _RWSTD_UINT_LEAST128_T    uint_fast128_t;
       
   323 -
       
   324 -#endif   // _RWSTD_INT_LEAST128_T
       
   325 -
       
   326 -/*** other constants ******************************************************/
       
   327 -
       
   328 -#define PTRDIFF_MIN         _RWSTD_PTRDIFF_MIN
       
   329 -#define PTRDIFF_MAX         _RWSTD_PTRDIFF_MAX
       
   330 -
       
   331 -#define SIZE_MAX            _RWSTD_SIZE_MAX
       
   332 -
       
   333 -#define WCHAR_MIN           _RWSTD_WCHAR_MIN
       
   334 -#define WCHAR_MAX           _RWSTD_WCHAR_MAX
       
   335 -
       
   336 -#define WINT_MIN            _RWSTD_WINT_MIN
       
   337 -#define WINT_MAX            _RWSTD_WINT_MAX
       
   338 -
       
   339 -#define SIG_ATOMIC_MIN      _RWSTD_SIG_ATOMIC_MIN
       
   340 -#define SIG_ATOMIC_MAX      _RWSTD_SIG_ATOMIC_MAX
       
   341 -
       
   342 -/*** computed _MIN constants **********************************************/
       
   343 -
       
   344 -#define INT8_MIN            _RWSTD_T_MIN (INT8_MAX)
       
   345 -#define INT16_MIN           _RWSTD_T_MIN (INT16_MAX)
       
   346 -#define INT32_MIN           _RWSTD_T_MIN (INT32_MAX)
       
   347 -#define INT64_MIN           _RWSTD_T_MIN (INT64_MAX)
       
   348 -
       
   349 -#define INT_LEAST8_MIN      _RWSTD_T_MIN (INT_LEAST8_MAX)
       
   350 -#define INT_LEAST16_MIN     _RWSTD_T_MIN (INT_LEAST16_MAX)
       
   351 -#define INT_LEAST32_MIN     _RWSTD_T_MIN (INT_LEAST32_MAX)
       
   352 -#define INT_LEAST64_MIN     _RWSTD_T_MIN (INT_LEAST64_MAX)
       
   353 -
       
   354 -#define INT_FAST8_MIN       _RWSTD_T_MIN (INT_FAST8_MAX)
       
   355 -#define INT_FAST16_MIN      _RWSTD_T_MIN (INT_FAST16_MAX)
       
   356 -#define INT_FAST32_MIN      _RWSTD_T_MIN (INT_FAST32_MAX)
       
   357 -#define INT_FAST64_MIN      _RWSTD_T_MIN (INT_FAST64_MAX)
       
   358 -
       
   359 -}   // namespace tr1
       
   360 + * The contents of this file are subject to the terms of the
       
   361 + * Common Development and Distribution License (the "License").
       
   362 + * You may not use this file except in compliance with the License.
       
   363 + *
       
   364 + * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
       
   365 + * or http://www.opensolaris.org/os/licensing.
       
   366 + * See the License for the specific language governing permissions
       
   367 + * and limitations under the License.
       
   368 + *
       
   369 + * When distributing Covered Code, include this CDDL HEADER in each
       
   370 + * file and include the License file at usr/src/OPENSOLARIS.LICENSE.
       
   371 + * If applicable, add the following below this CDDL HEADER, with the
       
   372 + * fields enclosed by brackets "[]" replaced with your own identifying
       
   373 + * information: Portions Copyright [yyyy] [name of copyright owner]
       
   374 + *
       
   375 + * CDDL HEADER END
       
   376 + *
       
   377 + *
       
   378 + * Copyright 2009 Sun Microsystems, Inc.  All rights reserved.
       
   379 + * Use is subject to license terms.
       
   380 + *
       
   381 + * ident "@(#)cstdint.2.diff 1.1     09/08/21 SMI"
       
   382 + */
       
   383 +
       
   384 +#ifndef _STDINT_H
       
   385 +
       
   386 +#include <stdint.h>
       
   387 +
       
   388 +namespace std {
       
   389 +    namespace tr1 {
       
   390 +        using ::int8_t;
       
   391 +        using ::int16_t;
       
   392 +        using ::int32_t;
       
   393 +        using ::int64_t;
       
   394 +        using ::uint8_t;
       
   395 +        using ::uint16_t;
       
   396 +        using ::uint32_t;
       
   397 +        using ::uint64_t;
       
   398 +        using ::int_fast8_t;
       
   399 +        using ::int_fast16_t;
       
   400 +        using ::int_fast32_t;
       
   401 +        using ::int_fast64_t;
       
   402 +        using ::int_least8_t;
       
   403 +        using ::int_least16_t;
       
   404 +        using ::int_least32_t;
       
   405 +        using ::int_least64_t;
       
   406 +        using ::intmax_t;
       
   407 +        using ::intptr_t;
       
   408 +        using ::uint_fast8_t;
       
   409 +        using ::uint_fast16_t;
       
   410 +        using ::uint_fast32_t;
       
   411 +        using ::uint_fast64_t;
       
   412 +        using ::uint_least8_t;
       
   413 +        using ::uint_least16_t;
       
   414 +        using ::uint_least32_t;
       
   415 +        using ::uint_least64_t;
       
   416 +        using ::uintmax_t;
       
   417 +        using ::uintptr_t;
       
   418 +    }
       
   419 +}
       
   420  
       
   421 -}   // namespace std
       
   422  
       
   423 +#endif /* _STDINT_H */
       
   424  
       
   425 -#endif   // _RWSTD_TR1_CSTDINT_INCLUDED