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

[tyndur-devel] [PATCH 2/6] + 18.1 Language support library, Types: <cstddef>



---
 STATUS                          |    2 +-
 include/cstddef                 |   50 +++++++++++++++++++++++++++++++++++++++
 include/lightlibc++/doxygen.hpp |   20 +++++++++++++++
 libc.README                     |   18 ++++++++++++++
 4 files changed, 89 insertions(+), 1 deletions(-)
 create mode 100644 include/cstddef
 create mode 100644 include/lightlibc++/doxygen.hpp
 create mode 100644 libc.README

diff --git a/STATUS b/STATUS
index b3406f1..540672c 100644
--- a/STATUS
+++ b/STATUS
@@ -3,7 +3,7 @@ This file documents the status of the implementation.
 
 
 18. language support library                                         [ ]
-18.1 Types                                                           [ ]
+18.1 Types                                                           [X]
 18.2 Implementation properties                                       [ ]
 18.3 Integer types                                                   [ ]
 18.4 Start and termination                                           [ ]
diff --git a/include/cstddef b/include/cstddef
new file mode 100644
index 0000000..6d9ee48
--- /dev/null
+++ b/include/cstddef
@@ -0,0 +1,50 @@
+/*
+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_CSTDDEF
+#define _LIGHTLIBCPP_CSTDDEF
+
+
+
+#include <stddef.h>          // NULL, offsetof, size_t, ptrdiff_t
+
+
+
+// NOTE: The NULL and offsetof macro come from the Standard C library headers
+
+
+
+namespace std
+{
+  /** \addtogroup lightlibcpp_18_1 */
+  /*@{*/
+
+  /** ptrdiff_t type from the C Standard library */
+  typedef ::ptrdiff_t        ptrdiff_t;
+  /** size_t type from the C Standard library */
+  typedef ::size_t           size_t;
+
+  #ifdef _LIGHTLIBCPP_CPP10
+    // TODO (C++1x): max_align_t
+    // TODO (C++1x): nullptr_t: typedef decltype(nullptr) nullptr_t
+  #endif
+
+  /*@}*/
+}
+
+
+
+#endif
diff --git a/include/lightlibc++/doxygen.hpp b/include/lightlibc++/doxygen.hpp
new file mode 100644
index 0000000..5a0d985
--- /dev/null
+++ b/include/lightlibc++/doxygen.hpp
@@ -0,0 +1,20 @@
+/*
+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.
+*/
+
+/** \defgroup lightlibcpp_18 18. Language support library */
+/** \defgroup lightlibcpp_18_1 18.1 Types
+ *  \ingroup lightlibcpp_18 */
diff --git a/libc.README b/libc.README
new file mode 100644
index 0000000..586fcf5
--- /dev/null
+++ b/libc.README
@@ -0,0 +1,18 @@
+This document is supposed to document all the changes that need to be made in
+the underlying C library in order to be compliant with the C++ Standard. Most
+of the changes are as easily implemented as for example the NULL macro:
+
+#ifdef __cplusplus
+  #define NULL 0
+#else
+  #define NULL (void*)0
+#endif
+
+This document is ordered by the names of the C library headers.
+
+
+<stddef.h>
+==========
+
+* NULL must be defined to 0, not (void*)0
+TODO: offsetof
-- 
1.6.0.4