]> git.proxmox.com Git - mirror_edk2.git/blobdiff - MdePkg/Include/Base.h
Updating processor bindings to not use stdint.h. Also added code to verify at compil...
[mirror_edk2.git] / MdePkg / Include / Base.h
index 2a55dd2697bae32d698f671d5e5ad4e394ac5dcb..98fdca36a6dbe577dd162c4edb24b7b94424a6da 100644 (file)
@@ -27,6 +27,25 @@ WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
 //\r
 #include <ProcessorBind.h>\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
+//\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
+\r
 //\r
 // The Microsoft* C compiler can removed references to unreferenced data items\r
 //  if the /OPT:REF linker option is used. We defined a macro as this is a \r