]> git.proxmox.com Git - mirror_edk2.git/blobdiff - StdLib/Include/stddef.h
MdeModulePkg: Delete never touched code
[mirror_edk2.git] / StdLib / Include / stddef.h
index c97d5648c47036f6a59089c9a725357fa7d676c9..ce4483acbfd62976118566232bea8b13475b2bf4 100644 (file)
@@ -1,64 +1,68 @@
 /** @file\r
-  Common Definitions.\r
+  Common "Standard" Definitions.\r
 \r
-Copyright (c) 2010, Intel Corporation. All rights reserved.<BR>\r
-This program and the accompanying materials are licensed and made available under\r
-the terms and conditions of the BSD License that accompanies this distribution.\r
-The full text of the license may be found at\r
-http://opensource.org/licenses/bsd-license.php.\r
+  The files stddef.h and stdlib.h are "catch all" headers for definitions and declarations\r
+  that don't fit well in the other headers.  There are two separate header files because\r
+  the contents of <stddef.h> are valid in both freestanding and hosted environment, while the\r
+  header <stdlib.h> contains elements that are only valid in a hosted environment.\r
 \r
-THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,\r
-WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.\r
+  This means that the elements in this file may not impose dependencies on headers other than\r
+  <float.h>, <iso646.h>, <limits.h>, <stdarg.h>, <stdbool.h>, and (of course) <sys/EfiCdefs.h>.\r
 \r
+  Copyright (c) 2010 - 2011, Intel Corporation. All rights reserved.<BR>\r
+  This program and the accompanying materials are licensed and made available under\r
+  the terms and conditions of the BSD License that accompanies this distribution.\r
+  The full text of the license may be found at\r
+  http://opensource.org/licenses/bsd-license.\r
+\r
+  THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,\r
+  WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.\r
 **/\r
 #ifndef _STDDEF_H\r
 #define _STDDEF_H\r
 #include  <sys/EfiCdefs.h>\r
 \r
-/** ptrdiff_t is the signed integer type of the result of subtracting two pointers.\r
-**/\r
 #ifdef _EFI_PTRDIFF_T_\r
+  /** ptrdiff_t is the signed integer type of the result of subtracting two pointers. **/\r
   typedef _EFI_PTRDIFF_T_  ptrdiff_t;\r
   #undef _EFI_PTRDIFF_T_\r
 #endif\r
 \r
-/** size_t is the unsigned integer type of the result of the sizeof operator.\r
-**/\r
 #ifdef _EFI_SIZE_T_\r
+  /** size_t is the unsigned integer type of the result of the sizeof operator. **/\r
   typedef _EFI_SIZE_T_  size_t;\r
   #undef _EFI_SIZE_T_\r
   #undef _BSD_SIZE_T_\r
 #endif\r
 \r
-/** wchar_t is an integer type whose range of values can represent distinct\r
-    codes for all members of the largest extended character set specified among\r
-    the supported locales.  The null character shall have the code value zero.\r
-**/\r
 #ifndef __cplusplus\r
   #ifdef _EFI_WCHAR_T\r
+    /** wchar_t is an integer type whose range of values can represent distinct\r
+        codes for all members of the largest extended character set specified among\r
+        the supported locales.  The null character shall have the code value zero.\r
+    **/\r
     typedef _EFI_WCHAR_T wchar_t;\r
     #undef  _EFI_WCHAR_T\r
     #undef _BSD_WCHAR_T_\r
   #endif\r
 #endif\r
 \r
-/** NULL expands to an implementation-defined null pointer constant.\r
+/** @def NULL\r
+    A macro that expands to a null pointer constant.<BR>\r
     NULL is defined in MdePkg/Include/Base.h which is automatically included\r
     by the EDK II build tools.\r
 **/\r
 \r
-/** offsetof(type, member-designator) expands to an integer constant expression\r
-    that has type size_t, the value of which is the offset in bytes, to the\r
-    structure member (designated by member-designator), from the beginning of\r
-    its structure (designated by type). The type and member designator shall be\r
-    such that given<BR>\r
-    static type t;<BR>\r
-    then the expression &(t.member-designator) evaluates to an address constant.\r
-    (If the specified member is a bit-field, the behavior is undefined.)\r
+/** The offsetof macro determines the offset of the beginning of a structure\r
+    member from the beginning of the structure.\r
+\r
+    The macro expands to an integer constant expression that has type size_t,\r
+    the value of which is the offset in bytes, to the structure member (Member),\r
+    from the beginning of its structure (StrucName).\r
 \r
     Alliased to OFFSET_OF which is defined in MdePkg/Include/Base.h which is\r
     automatically included by the EDK II build tools.\r
 **/\r
-#define offsetof(type, member)  OFFSET_OF(type, member)\r
+#define offsetof(StrucName, Member)  OFFSET_OF(StrucName, Member)\r
 \r
 #endif  /* _STDDEF_H */\r