]> git.proxmox.com Git - mirror_edk2.git/blob - StdLib/Include/stddef.h
Standard Libraries for EDK II.
[mirror_edk2.git] / StdLib / Include / stddef.h
1 /** @file
2 Common Definitions.
3
4 Copyright (c) 2010, Intel Corporation. All rights reserved.<BR>
5 This program and the accompanying materials are licensed and made available under
6 the terms and conditions of the BSD License that accompanies this distribution.
7 The full text of the license may be found at
8 http://opensource.org/licenses/bsd-license.php.
9
10 THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
11 WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
12
13 **/
14 #ifndef _STDDEF_H
15 #define _STDDEF_H
16 #include <sys/EfiCdefs.h>
17
18 /** ptrdiff_t is the signed integer type of the result of subtracting two pointers.
19 **/
20 #ifdef _EFI_PTRDIFF_T_
21 typedef _EFI_PTRDIFF_T_ ptrdiff_t;
22 #undef _EFI_PTRDIFF_T_
23 #endif
24
25 /** size_t is the unsigned integer type of the result of the sizeof operator.
26 **/
27 #ifdef _EFI_SIZE_T_
28 typedef _EFI_SIZE_T_ size_t;
29 #undef _EFI_SIZE_T_
30 #undef _BSD_SIZE_T_
31 #endif
32
33 /** wchar_t is an integer type whose range of values can represent distinct
34 codes for all members of the largest extended character set specified among
35 the supported locales. The null character shall have the code value zero.
36 **/
37 #ifndef __cplusplus
38 #ifdef _EFI_WCHAR_T
39 typedef _EFI_WCHAR_T wchar_t;
40 #undef _EFI_WCHAR_T
41 #undef _BSD_WCHAR_T_
42 #endif
43 #endif
44
45 /** NULL expands to an implementation-defined null pointer constant.
46 NULL is defined in MdePkg/Include/Base.h which is automatically included
47 by the EDK II build tools.
48 **/
49
50 /** offsetof(type, member-designator) expands to an integer constant expression
51 that has type size_t, the value of which is the offset in bytes, to the
52 structure member (designated by member-designator), from the beginning of
53 its structure (designated by type). The type and member designator shall be
54 such that given<BR>
55 static type t;<BR>
56 then the expression &(t.member-designator) evaluates to an address constant.
57 (If the specified member is a bit-field, the behavior is undefined.)
58
59 Alliased to OFFSET_OF which is defined in MdePkg/Include/Base.h which is
60 automatically included by the EDK II build tools.
61 **/
62 #define offsetof(type, member) OFFSET_OF(type, member)
63
64 #endif /* _STDDEF_H */