Author: sebor
Date: Fri Jan 27 14:45:26 2006
New Revision: 373016
URL: http://svn.apache.org/viewcvs?rev=373016&view=rev
Log:
2006-01-27 Martin Sebor <[EMAIL PROTECTED]>
STDCXX-34
* cstdint: Implementation of tr.c99.cstdint.
* stdint.h: Implementation of tr.c99.stdinth.
Added:
incubator/stdcxx/trunk/include/tr1/cstdint (with props)
incubator/stdcxx/trunk/include/tr1/stdint.h (with props)
Added: incubator/stdcxx/trunk/include/tr1/cstdint
URL:
http://svn.apache.org/viewcvs/incubator/stdcxx/trunk/include/tr1/cstdint?rev=373016&view=auto
==============================================================================
--- incubator/stdcxx/trunk/include/tr1/cstdint (added)
+++ incubator/stdcxx/trunk/include/tr1/cstdint Fri Jan 27 14:45:26 2006
@@ -0,0 +1,351 @@
+// -*- C++ -*-
+/***************************************************************************
+ *
+ * cstdint - definition of integer types [tr.c99.cstdint]
+ *
+ * $Id$
+ *
+ ***************************************************************************
+ *
+ * Copyright 2006 The Apache Software Foundation or its licensors,
+ * as applicable.
+ *
+ * Copyright 2006 Rogue Wave Software.
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ *
+ **************************************************************************/
+
+#ifndef _RWSTD_TR1_CSTDINT_INCLUDED
+#define _RWSTD_TR1_CSTDINT_INCLUDED
+
+
+#include <rw/_defs.h>
+
+
+_RWSTD_NAMESPACE (std) {
+
+_RWSTD_NAMESPACE (tr1) {
+
+#ifndef _RWSTD_BNO_TWOS_COMPLEMENT
+# define _RWSTD_T_MIN(tmax) (-(tmax) - 1)
+#else
+# define _RWSTD_T_MIN(tmax) -(tmax)
+#endif
+
+
+/*** int8_t ***************************************************************/
+
+#ifdef _RWSTD_INT8_T
+
+typedef _RWSTD_INT8_T int8_t;
+typedef _RWSTD_UINT8_T uint8_t;
+typedef _RWSTD_INT8_T int_least8_t;
+typedef _RWSTD_UINT8_T uint_least8_t;
+typedef _RWSTD_INT8_T int_fast8_t;
+typedef _RWSTD_UINT8_T uint_lfast8_t;
+
+# define INT8_MAX 127
+# define UINT8_MAX 255U
+# define INT_LEAST8_MAX 127
+# define UINT_LEAST8_MAX 255U
+# define INT_FAST8_MAX 127
+# define UINT_FAST8_MAX 255U
+
+#elif defined (_RWSTD_INT16_T)
+
+typedef _RWSTD_INT16_T int_least8_t;
+typedef _RWSTD_UINT16_T uint_least8_t;
+typedef _RWSTD_INT16_T int_fast8_t;
+typedef _RWSTD_UINT16_T uint_fast8_t;
+
+# define INT_LEAST8_MAX 32767
+# define UINT_LEAST8_MAX 65535U
+# define INT_FAST8_MAX 32767
+# define UINT_FAST8_MAX 65535U
+
+#elif defined (_RWSTD_INT32_T)
+
+typedef _RWSTD_INT32_T int_least8_t;
+typedef _RWSTD_UINT32_T uint_least8_t
+typedef _RWSTD_INT32_T int_fast8_t;
+typedef _RWSTD_UINT32_T uint_fast8_t
+
+# define INT_LEAST8_MAX 2147483647
+# define UINT_LEAST8_MAX 4294967295U
+# define INT_FAST8_MAX 2147483647
+# define UINT_FAST8_MAX 4294967295U
+
+#elif defined (_RWSTD_INT64_T)
+
+typedef _RWSTD_INT64_T int_least8_t;
+typedef _RWSTD_UINT64_T uint_least8_t
+typedef _RWSTD_INT64_T int_fast8_t;
+typedef _RWSTD_UINT64_T uint_fast8_t
+
+# if 8 == _RWSTD_LONG_SIZE
+# define INT_LEAST8_MAX _RWSTD_LONG_MAX
+# define UINT_LEAST8_MAX _RWSTD_ULONG_MAX
+# define INT_FAST8_MAX _RWSTD_LONG_MAX
+# define UINT_FAST8_MAX _RWSTD_ULONG_MAX
+# elif 8 == _RWSTD_LLONG_SIZE
+# define INT_LEAST8_MAX _RWSTD_LLONG_MAX
+# define UINT_LEAST8_MAX _RWSTD_ULLONG_MAX
+# define INT_FAST8_MAX _RWSTD_LLONG_MAX
+# define UINT_FAST8_MAX _RWSTD_ULLONG_MAX
+# endif
+
+#else // fallback on int
+
+typedef int int_least8_t;
+typedef unsigned uint_least8_t
+typedef int int_fast8_t;
+typedef unsigned uint_fast8_t
+
+# define INT_LEAST8_MAX _RWSTD_INT_MAX
+# define UINT_LEAST8_MAX _RWSTD_UINT_MAX
+# define INT_FAST8_MAX _RWSTD_INT_MAX
+# define UINT_FAST8_MAX _RWSTD_UINT_MAX
+
+#endif // _RWSTD_INT{8,16,32,64}_T
+
+
+/*** int16_t **************************************************************/
+
+#ifdef _RWSTD_INT16_T
+
+typedef _RWSTD_INT16_T int16_t;
+typedef _RWSTD_UINT16_T uint16_t;
+typedef _RWSTD_INT16_T int_least16_t;
+typedef _RWSTD_UINT16_T uint_least16_t;
+typedef _RWSTD_INT16_T int_fast16_t;
+typedef _RWSTD_UINT16_T uint_fast16_t;
+
+# define INT16_MAX 32767
+# define UINT16_MAX 65535U
+# define INT_LEAST16_MAX 32767
+# define UINT_LEAST16_MAX 65535U
+# define INT_FAST16_MAX 32767
+# define UINT_FAST16_MAX 65535U
+
+#elif defined (_RWSTD_INT32_T)
+
+typedef _RWSTD_INT32_T int_least16_t;
+typedef _RWSTD_UINT32_T uint_least16_t
+typedef _RWSTD_INT32_T int_fast16_t;
+typedef _RWSTD_UINT32_T uint_fast16_t;
+
+# define INT_LEAST16_MAX 2147483647
+# define UINT_LEAST16_MAX 4294967295U
+# define INT_FAST16_MAX 2147483647
+# define UINT_FAST16_MAX 4294967295U
+
+#elif defined (_RWSTD_INT64_T)
+
+typedef _RWSTD_INT64_T int_least16_t;
+typedef _RWSTD_UINT64_T uint_least16_t
+typedef _RWSTD_INT64_T int_fast16_t;
+typedef _RWSTD_UINT64_T uint_fast16_t;
+
+# if 8 == _RWSTD_LONG_SIZE
+# define INT_LEAST16_MAX _RWSTD_LONG_MAX
+# define UINT_LEAST16_MAX _RWSTD_ULONG_MAX
+# define INT_FAST16_MAX _RWSTD_LONG_MAX
+# define UINT_FAST16_MAX _RWSTD_ULONG_MAX
+# elif 8 == _RWSTD_LLONG_SIZE
+# define INT_LEAST16_MAX _RWSTD_LLONG_MAX
+# define UINT_LEAST16_MAX _RWSTD_ULLONG_MAX
+# define INT_FAST16_MAX _RWSTD_LLONG_MAX
+# define UINT_FAST16_MAX _RWSTD_ULLONG_MAX
+# endif
+
+#else // fallback on int
+
+typedef int int_least16_t;
+typedef unsigned uint_least16_t
+typedef int int_fast16_t;
+typedef unsigned uint_fast16_t
+
+# define INT_LEAST16_MAX _RWSTD_INT_MAX
+# define UINT_LEAST16_MAX _RWSTD_UINT_MAX
+# define INT_FAST16_MAX _RWSTD_INT_MAX
+# define UINT_FAST16_MAX _RWSTD_UINT_MAX
+
+#endif // _RWSTD_INT{16,32,64}_T
+
+
+/*** int32_t **************************************************************/
+
+#ifdef _RWSTD_INT32_T
+
+typedef _RWSTD_INT32_T int32_t;
+typedef _RWSTD_UINT32_T uint32_t;
+typedef _RWSTD_INT32_T int_least32_t;
+typedef _RWSTD_UINT32_T uint_least32_t;
+typedef _RWSTD_INT32_T int_faast32_t;
+typedef _RWSTD_UINT32_T uint_faast32_t;
+
+# define INT32_MAX 2147483647
+# define UINT32_MAX 4294967295U
+# define INT_LEAST32_MAX 2147483647
+# define UINT_LEAST32_MAX 4294967295U
+# define INT_FAST32_MAX 2147483647
+# define UINT_FAST32_MAX 4294967295U
+
+#elif defined (_RWSTD_INT64_T)
+
+typedef _RWSTD_INT64_T int_least32_t;
+typedef _RWSTD_UINT64_T uint_least32_t
+typedef _RWSTD_INT64_T int_fast32_t;
+typedef _RWSTD_UINT64_T uint_fast32_t
+
+# if 8 == _RWSTD_LONG_SIZE
+# define INT_LEAST32_MAX _RWSTD_LONG_MAX
+# define UINT_LEAST32_MAX _RWSTD_ULONG_MAX
+# define INT_FAST32_MAX _RWSTD_LONG_MAX
+# define UINT_FAST32_MAX _RWSTD_ULONG_MAX
+# elif 8 == _RWSTD_LLONG_SIZE
+# define INT_LEAST32_MAX _RWSTD_LLONG_MAX
+# define UINT_LEAST32_MAX _RWSTD_ULLONG_MAX
+# define INT_FAST32_MAX _RWSTD_LLONG_MAX
+# define UINT_FAST32_MAX _RWSTD_ULLONG_MAX
+# endif
+
+#else // fallback on int
+
+typedef int int_least32_t;
+typedef unsigned uint_least32_t
+typedef int int_faast32_t;
+typedef unsigned uint_faast32_t
+
+# define INT32_MAX _RWSTD_INT_MAX
+# define UINT32_MAX _RWSTD_UINT_MAX
+# define INT_LEAST32_MAX _RWSTD_INT_MAX
+# define UINT_LEAST32_MAX _RWSTD_UINT_MAX
+# define INT_FAST32_MAX _RWSTD_INT_MAX
+# define UINT_FAST32_MAX _RWSTD_UINT_MAX
+
+#endif // _RWSTD_INT{32,64}_T
+
+
+/*** int64_t **************************************************************/
+
+#ifdef _RWSTD_INT64_T
+
+typedef _RWSTD_INT64_T int64_t;
+typedef _RWSTD_UINT64_T uint64_t;
+typedef _RWSTD_INT64_T int_least64_t;
+typedef _RWSTD_UINT64_T uint_least64_t;
+typedef _RWSTD_INT64_T int_fast64_t;
+typedef _RWSTD_UINT64_T uint_fast64_t;
+
+// 7.18.2.5 of C99 requires that intmax_t be at least 64-bits wide
+typedef _RWSTD_INT64_T intmax_t;
+typedef _RWSTD_UINT64_T uintmax_t;
+
+# if 8 == _RWSTD_LONG_SIZE
+# define INT64_MAX _RWSTD_LONG_MAX
+# define UINT64_MAX _RWSTD_ULONG_MAX
+# define INT_LEAST64_MAX _RWSTD_LONG_MAX
+# define UINT_LEAST64_MAX _RWSTD_ULONG_MAX
+# define INT_FAST64_MAX _RWSTD_LONG_MAX
+# define UINT_FAST64_MAX _RWSTD_ULONG_MAX
+# elif 8 == _RWSTD_LLONG_SIZE
+# define INT64_MAX _RWSTD_LLONG_MAX
+# define UINT64_MAX _RWSTD_ULLONG_MAX
+# define INT_LEAST64_MAX _RWSTD_LLONG_MAX
+# define UINT_LEAST64_MAX _RWSTD_ULLONG_MAX
+# define INT_FAST64_MAX _RWSTD_LLONG_MAX
+# define UINT_FAST64_MAX _RWSTD_ULLONG_MAX
+# endif
+
+#else // fallback on long
+typedef long intmax_t;
+typedef unsigned long uintmax_t;
+#endif // _RWSTD_INT{64,32,16}_T
+
+/*** intptr_t**************************************************************/
+
+#if 8 == _RWSTD_PTR_SIZE
+
+typedef _RWSTD_INT64_T intptr_t;
+typedef _RWSTD_UINT64_T uintptr_t;
+
+# define INTPTR_MAX INT64_MAX
+# define UINTPTR_MAX UINT64_MAX
+
+#define INTPTR_MIN _
+
+#elif 4 == _RWSTD_PTR_SIZE
+
+typedef _RWSTD_INT32_T intptr_t;
+typedef _RWSTD_UINT32_T uintptr_t;
+
+# define INTPTR_MAX INT32_MAX
+# define UINTPTR_MAX UINT32_MAX
+
+#elif 2 == _RWSTD_PTR_SIZE
+
+typedef _RWSTD_INT16_T intptr_t;
+typedef _RWSTD_UINT16_T uintptr_t;
+
+# define INTPTR_MAX INT16_MAX
+# define UINTPTR_MAX UINT16_MAX
+
+#else // fallback on long
+
+typedef long intptr_t;
+typedef unsigned long uintptr_t;
+
+# define INTPTR_MAX _RWSTD_LONG_MAX
+# define UINTPTR_MAX _RWSTD_LONG_MAX
+
+#endif // {8,16,32,64} == _RWSTD_PTR_SIZE
+
+/*** _MIN constants *******************************************************/
+
+#define PTRDIFF_MIN _RWSTD_PTRIDFF_MIN
+#define PTRDIFF_MAX _RWSTD_PTRIDFF_MAX
+
+#define SIZE_MAX _RWSTD_SIZE_MAX
+
+#define WCHAR_MIN _RWSTD_WCHAR_T_MIN
+#define WCHAR_MAX _RWSTD_WCHAR_T_MAX
+
+#define WINT_MIN _RWSTD_WINT_MIN
+#define WINT_MAX _RWSTD_WINT_MAX
+
+#define SIG_ATOMIC_MIN _RWSTD_SIG_ATOMIC_MIN
+#define SIG_ATOMIC_MAX _RWSTD_SIG_ATOMIC_MAX
+
+#define INT8_MIN _RWSTD_T_MIN (INT8_MAX)
+#define INT16_MIN _RWSTD_T_MIN (INT16_MAX)
+#define INT32_MIN _RWSTD_T_MIN (INT32_MAX)
+#define INT64_MIN _RWSTD_T_MIN (INT64_MAX)
+
+#define INT_LEAST8_MIN _RWSTD_T_MIN (INT_LEAST8_MAX)
+#define INT_LEAST16_MIN _RWSTD_T_MIN (INT_LEAST16_MAX)
+#define INT_LEAST32_MIN _RWSTD_T_MIN (INT_LEAST32_MAX)
+#define INT_LEAST64_MIN _RWSTD_T_MIN (INT_LEAST64_MAX)
+
+#define INT_FAST8_MIN _RWSTD_T_MIN (INT_FAST8_MAX)
+#define INT_FAST16_MIN _RWSTD_T_MIN (INT_FAST16_MAX)
+#define INT_FAST32_MIN _RWSTD_T_MIN (INT_FAST32_MAX)
+#define INT_FAST64_MIN _RWSTD_T_MIN (INT_FAST64_MAX)
+
+} // namespace tr1
+
+} // namespace std
+
+
+#endif // _RWSTD_TR1_CSTDINT_INCLUDED
Propchange: incubator/stdcxx/trunk/include/tr1/cstdint
------------------------------------------------------------------------------
svn:keywords = Id
Added: incubator/stdcxx/trunk/include/tr1/stdint.h
URL:
http://svn.apache.org/viewcvs/incubator/stdcxx/trunk/include/tr1/stdint.h?rev=373016&view=auto
==============================================================================
--- incubator/stdcxx/trunk/include/tr1/stdint.h (added)
+++ incubator/stdcxx/trunk/include/tr1/stdint.h Fri Jan 27 14:45:26 2006
@@ -0,0 +1,98 @@
+// -*- C++ -*-
+/***************************************************************************
+ *
+ * stdint.h - definition of integer types [tr.c99.stdinth]
+ *
+ * $Id$
+ *
+ ***************************************************************************
+ *
+ * Copyright 2006 The Apache Software Foundation or its licensors,
+ * as applicable.
+ *
+ * Copyright 2006 Rogue Wave Software.
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ *
+ **************************************************************************/
+
+#ifndef _RWSTD_TR1_STDINT_H_INCLUDED
+#define _RWSTD_TR1_STDINT_H_INCLUDED
+
+
+#include <tr1/cstdint>
+#include <rw/_defs.h>
+
+
+#ifdef _RWSTD_INT8_T
+
+// optional exact-width types
+_USING (std::tr1::int8_t);
+_USING (std::tr1::uint8_t);
+
+#endif // _RWSTD_INT8_T
+
+_USING (std::tr1::int_least8_t);
+_USING (std::tr1::uint_least8_t);
+_USING (std::tr1::int_fast8_t);
+_USING (std::tr1::uint_fast8_t);
+
+
+#ifdef _RWSTD_INT16_T
+
+// optional exact-width types
+_USING (std::tr1::int16_t);
+_USING (std::tr1::uint16_t);
+
+#endif // _RWSTD_INT16_T
+
+_USING (std::tr1::int_least16_t);
+_USING (std::tr1::uint_least16_t);
+_USING (std::tr1::int_fast16_t);
+_USING (std::tr1::uint_fast16_t);
+
+
+#ifdef _RWSTD_INT32_T
+
+// optional exact-width types
+_USING (std::tr1::int32_t);
+_USING (std::tr1::uint32_t);
+
+#endif // _RWSTD_INT32_T
+
+_USING (std::tr1::int_least32_t);
+_USING (std::tr1::uint_least32_t);
+_USING (std::tr1::int_fast32_t);
+_USING (std::tr1::uint_fast32_t);
+
+
+#ifdef _RWSTD_INT64_T
+
+// optional exact-width types
+_USING (std::tr1::int64_t);
+_USING (std::tr1::uint64_t);
+
+#endif // _RWSTD_INT64_T
+
+_USING (std::tr1::int_least64_t);
+_USING (std::tr1::uint_least64_t);
+_USING (std::tr1::int_fast64_t);
+_USING (std::tr1::uint_fast64_t);
+
+_USING (std::tr1::intmax_t);
+_USING (std::tr1::uintmax_t);
+_USING (std::tr1::intptr_t);
+_USING (std::tr1::uintptr_t);
+
+
+#endif // _RWSTD_TR1_STDINT_H_INCLUDED
Propchange: incubator/stdcxx/trunk/include/tr1/stdint.h
------------------------------------------------------------------------------
svn:eol-style = native
Propchange: incubator/stdcxx/trunk/include/tr1/stdint.h
------------------------------------------------------------------------------
svn:keywords = Id