[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[tyndur-devel] [PATCH 3/6] + 18.3 Language support library, Integer Types: <cstdint>



---
 STATUS                          |    2 +-
 include/cstdint                 |  116 +++++++++++++++++++++++++++++++++++++++
 include/lightlibc++/doxygen.hpp |    2 +
 3 files changed, 119 insertions(+), 1 deletions(-)
 create mode 100644 include/cstdint

diff --git a/STATUS b/STATUS
index 540672c..813580e 100644
--- a/STATUS
+++ b/STATUS
@@ -5,7 +5,7 @@ This file documents the status of the implementation.
 18. language support library                                         [ ]
 18.1 Types                                                           [X]
 18.2 Implementation properties                                       [ ]
-18.3 Integer types                                                   [ ]
+18.3 Integer types                                                   [X]
 18.4 Start and termination                                           [ ]
 18.5 Dynamic memory management <new>                                 [ ]
 18.6 Type identi�cation                                              [ ]
diff --git a/include/cstdint b/include/cstdint
new file mode 100644
index 0000000..817c7c9
--- /dev/null
+++ b/include/cstdint
@@ -0,0 +1,116 @@
+/*
+Permission is granted to use, modify, and / or redistribute at will.
+
+This includes removing authorship notices, re-use of code parts in
+other software (with or without giving credit), and / or creating a
+commercial product based on it.
+
+This permission is not revocable by the author.
+
+This software is provided as-is. Use it at your own risk. There is
+no warranty whatsoever, neither expressed nor implied, and by using
+this software you accept that the author(s) shall not be held liable
+for any loss of data, loss of service, or other damages, be they
+incidental or consequential. Your only option other than accepting
+this is not to use the software at all.
+*/
+#ifndef _LIGHTLIBCPP_CSTDINT
+#define _LIGHTLIBCPP_CSTDINT
+
+
+
+#ifdef _LIGHTLIBCPP_CPP03_STRICT
+  #error The <cstdint> Header is not available in strict ISO/IEC 14882:2003 mode
+#endif
+
+
+
+#include <stdint.h>          // NOTE:  (u)int[X]_t, (u)int_fast[X]_t,
+                             //        (u)int_least[X]_t, (u)intmax_t,
+                             //        (u)intptr_t
+
+// NOTE: macros INT_{FAST, LEAST}{8, 16, 32, 64}_{MIN, MAX}
+//              UINT_{FAST, LEAST}{8, 16, 32, 64}_MAX
+//              INT{MAX, PTR}_{MIN, MAX}, UINT{MAX, PTR}_MAX
+//              {PTRDIFF, SIG_ATOMIC, WCHAR, WINT}_{MIN, MAX}
+//              SIZE_MAX
+//       function macros: [U]INT{8, 16, 32, 64, MAX}_C
+//       taken from C Standard library
+
+
+
+namespace std
+{
+  /** \addtogroup lightlibcpp_18_3 */
+  /*@{*/
+
+  /** int8_t type from the C Standard library */
+  typedef ::int8_t           int8_t;
+  /** int16_t type from the C Standard library */
+  typedef ::int16_t          int16_t;
+  /** int32_t type from the C Standard library */
+  typedef ::int32_t          int32_t;
+  /** int64_t type from the C Standard library */
+  typedef ::int64_t          int64_t;
+
+  /** int_fast8_t type from the C Standard library */
+  typedef ::int_fast8_t      int_fast8_t;
+  /** int_fast16_t type from the C Standard library */
+  typedef ::int_fast16_t     int_fast16_t;
+  /** int_fast32_t type from the C Standard library */
+  typedef ::int_fast32_t     int_fast32_t;
+  /** int_fast64_t type from the C Standard library */
+  typedef ::int_fast64_t     int_fast64_t;
+
+  /** int_least8_t type from the C Standard library */
+  typedef ::int_least8_t     int_least8_t;
+  /** int_least16_t type from the C Standard library */
+  typedef ::int_least16_t    int_least16_t;
+  /** int_least32_t type from the C Standard library */
+  typedef ::int_least32_t    int_least32_t;
+  /** int_least64_t type from the C Standard library */
+  typedef ::int_least64_t    int_least64_t;
+
+  /** intmax_t type from the C Standard library */
+  typedef ::intmax_t         intmax_t;
+  /** intptr_t type from the C Standard library */
+  typedef ::intptr_t         intptr_t;
+
+  /** uint8_t type from the C Standard library */
+  typedef ::uint8_t          uint8_t;
+  /** uint16_t type from the C Standard library */
+  typedef ::uint16_t         uint16_t;
+  /** uint32_t type from the C Standard library */
+  typedef ::uint32_t         uint32_t;
+  /** uint64_t type from the C Standard library */
+  typedef ::uint64_t         uint64_t;
+
+  /** uint_fast8_t type from the C Standard library */
+  typedef ::uint_fast8_t     uint_fast8_t;
+  /** uint_fast16_t type from the C Standard library */
+  typedef ::uint_fast16_t    uint_fast16_t;
+  /** uint_fast32_t type from the C Standard library */
+  typedef ::uint_fast32_t    uint_fast32_t;
+  /** uint_fast64_t type from the C Standard library */
+  typedef ::uint_fast64_t    uint_fast64_t;
+
+  /** uint_least8_t type from the C Standard library */
+  typedef ::uint_least8_t    uint_least8_t;
+  /** uint_least16_t type from the C Standard library */
+  typedef ::uint_least16_t   uint_least16_t;
+  /** uint_least32_t type from the C Standard library */
+  typedef ::uint_least32_t   uint_least32_t;
+  /** uint_least64_t type from the C Standard library */
+  typedef ::uint_least64_t   uint_least64_t;
+
+  /** uintmax_t type from the C Standard library */
+  typedef ::uintmax_t        uintmax_t;
+  /** uintptr_t type from the C Standard library */
+  typedef ::uintptr_t        uintptr_t;
+
+  /*@}*/
+}
+
+
+
+#endif
diff --git a/include/lightlibc++/doxygen.hpp b/include/lightlibc++/doxygen.hpp
index 5a0d985..bdf9b31 100644
--- a/include/lightlibc++/doxygen.hpp
+++ b/include/lightlibc++/doxygen.hpp
@@ -18,3 +18,5 @@ this is not to use the software at all.
 /** \defgroup lightlibcpp_18 18. Language support library */
 /** \defgroup lightlibcpp_18_1 18.1 Types
  *  \ingroup lightlibcpp_18 */
+/** \defgroup lightlibcpp_18_3 18.3 Integer types
+ *  \ingroup lightlibcpp_18 */
-- 
1.6.0.4