]> git.proxmox.com Git - mirror_edk2.git/blobdiff - MdePkg/Include/Base.h
Update the copyright notice format
[mirror_edk2.git] / MdePkg / Include / Base.h
index 5b1f418d1af4d9c9c0d356d718584c0119751e0f..0e722ec7abeda9954cf15d0b6bd7e99b0fd6f058 100644 (file)
@@ -6,9 +6,9 @@
   environment. There are a set of base libraries in the Mde Package that can\r
   be used to implement base modules.\r
 \r
-Copyright (c) 2006 - 2010, Intel Corporation.  All rights reserved<BR>\r
-Portions copyright (c) 2008-2009 Apple Inc. All rights reserved.<BR>\r
-All rights reserved. This program and the accompanying materials\r
+Copyright (c) 2006 - 2010, Intel Corporation. All rights reserved.<BR>\r
+Portions copyright (c) 2008 - 2009, Apple Inc. All rights reserved.<BR>\r
+This program and the accompanying materials\r
 are licensed and made available under the terms and conditions of the BSD License\r
 which accompanies this distribution.  The full text of the license may be found at\r
 http://opensource.org/licenses/bsd-license.php.\r
@@ -27,24 +27,35 @@ WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
 //\r
 #include <ProcessorBind.h>\r
 \r
+\r
+/**\r
+  Verifies the storage size of a given data type.\r
+  \r
+  This macro generates a divide by zero error or a zero size array declaration in\r
+  the preprocessor if the size is incorrect.  These are declared as "extern" so\r
+  the space for these arrays will not be in the modules.\r
+\r
+  @param  TYPE  The date type to determine the size of.\r
+  @param  Size  The expected size for the TYPE.\r
+\r
+**/\r
+#define VERIFY_SIZE_OF(TYPE, Size) extern UINT8 _VerifySizeof##TYPE[(sizeof(TYPE) == (Size)) / (sizeof(TYPE) == (Size))]\r
+\r
 //\r
 // Verify that ProcessorBind.h produced UEFI Data Types that are compliant with \r
-// Section 2.3.1 of the UEFI 2.3 Specification.  Generates a divide by zero \r
-// error or a zero size array declaration in the preprocessor if the size is \r
-// incorrect.  These are declared as "extern" so the space for these arrays will \r
-// not be in the modules.\r
+// Section 2.3.1 of the UEFI 2.3 Specification.  \r
 //\r
-extern UINT8 _VerifySizeOfBoolean [(sizeof(BOOLEAN) == 1) / (sizeof(BOOLEAN) == 1)];\r
-extern UINT8 _VerifySizeOfInt8    [(sizeof(INT8)    == 1) / (sizeof(INT8)    == 1)];\r
-extern UINT8 _VerifySizeOfUint8   [(sizeof(UINT8)   == 1) / (sizeof(UINT8)   == 1)];\r
-extern UINT8 _VerifySizeOfInt16   [(sizeof(INT16)   == 2) / (sizeof(INT16)   == 2)];\r
-extern UINT8 _VerifySizeOfUint16  [(sizeof(UINT16)  == 2) / (sizeof(UINT16)  == 2)];\r
-extern UINT8 _VerifySizeOfInt32   [(sizeof(INT32)   == 4) / (sizeof(INT32)   == 4)];\r
-extern UINT8 _VerifySizeOfUint32  [(sizeof(UINT32)  == 4) / (sizeof(UINT32)  == 4)];\r
-extern UINT8 _VerifySizeOfInt64   [(sizeof(INT64)   == 8) / (sizeof(INT64)   == 8)];\r
-extern UINT8 _VerifySizeOfUint64  [(sizeof(UINT64)  == 8) / (sizeof(UINT64)  == 8)];\r
-extern UINT8 _VerifySizeOfChar8   [(sizeof(CHAR8)   == 1) / (sizeof(CHAR8)   == 1)];\r
-extern UINT8 _VerifySizeOfChar16  [(sizeof(CHAR16)  == 2) / (sizeof(CHAR16)  == 2)];\r
+VERIFY_SIZE_OF (BOOLEAN, 1);\r
+VERIFY_SIZE_OF (INT8, 1);\r
+VERIFY_SIZE_OF (UINT8, 1);\r
+VERIFY_SIZE_OF (INT16, 2);\r
+VERIFY_SIZE_OF (UINT16, 2);\r
+VERIFY_SIZE_OF (INT32, 4);\r
+VERIFY_SIZE_OF (UINT32, 4);\r
+VERIFY_SIZE_OF (INT64, 8);\r
+VERIFY_SIZE_OF (UINT64, 8);\r
+VERIFY_SIZE_OF (CHAR8, 1);\r
+VERIFY_SIZE_OF (CHAR16, 2);\r
 \r
 //\r
 // The Microsoft* C compiler can removed references to unreferenced data items\r