]> git.proxmox.com Git - mirror_edk2.git/commitdiff
Update BasePrintLib to work correctly on compilers where VA_LIST is a structure
authormdkinney <mdkinney@6f19259b-4bc3-4df7-8a09-765794883524>
Tue, 18 Aug 2009 21:00:02 +0000 (21:00 +0000)
committermdkinney <mdkinney@6f19259b-4bc3-4df7-8a09-765794883524>
Tue, 18 Aug 2009 21:00:02 +0000 (21:00 +0000)
git-svn-id: https://edk2.svn.sourceforge.net/svnroot/edk2/trunk/edk2@9109 6f19259b-4bc3-4df7-8a09-765794883524

MdePkg/Library/BasePrintLib/PrintLib.c

index 2066c7a1ddd186731d97e4ea5da344449a8c96ae..3bf4d0c2ffb185d8c9f42dc4f3b6c9bd1966b77e 100644 (file)
@@ -2,6 +2,7 @@
   Base Print Library instance implementation.\r
 \r
   Copyright (c) 2006 - 2008, Intel Corporation<BR>\r
+  Portions Copyright (c) 2008-2009 Apple Inc.<BR>
   All rights reserved. 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
 \r
 #include "PrintLibInternal.h"\r
 \r
+//
+// Declare a VA_LIST global variable that is used in calls to BasePrintLibSPrintMarker()\r
+// when the BASE_LIST parameter is valid and the VA_LIST parameter is ignored.  \r
+// A NULL VA_LIST can not be passed into  BasePrintLibSPrintMarker() because some \r
+// compilers define VA_LIST to be a structure.
+//
+VA_LIST gNullVaList;\r
+
 #define ASSERT_UNICODE_BUFFER(Buffer) ASSERT ((((UINTN) (Buffer)) & 0x01) == 0)\r
 \r
 /**\r
@@ -109,7 +118,7 @@ UnicodeBSPrint (
 {\r
   ASSERT_UNICODE_BUFFER (StartOfBuffer);\r
   ASSERT_UNICODE_BUFFER (FormatString);\r
-  return BasePrintLibSPrintMarker ((CHAR8 *)StartOfBuffer, BufferSize >> 1, FORMAT_UNICODE | OUTPUT_UNICODE, (CHAR8 *)FormatString, NULL, Marker);\r
+  return BasePrintLibSPrintMarker ((CHAR8 *)StartOfBuffer, BufferSize >> 1, FORMAT_UNICODE | OUTPUT_UNICODE, (CHAR8 *)FormatString, gNullVaList, Marker);
 }\r
 \r
 /**\r
@@ -250,7 +259,7 @@ UnicodeBSPrintAsciiFormat (
   )\r
 {\r
   ASSERT_UNICODE_BUFFER (StartOfBuffer);\r
-  return BasePrintLibSPrintMarker ((CHAR8 *)StartOfBuffer, BufferSize >> 1, OUTPUT_UNICODE, FormatString, NULL, Marker);\r
+  return BasePrintLibSPrintMarker ((CHAR8 *)StartOfBuffer, BufferSize >> 1, OUTPUT_UNICODE, FormatString, gNullVaList, Marker);
 }\r
 \r
 /**\r
@@ -441,7 +450,7 @@ AsciiBSPrint (
   IN  BASE_LIST     Marker\r
   )\r
 {\r
-  return BasePrintLibSPrintMarker (StartOfBuffer, BufferSize, 0, FormatString, NULL, Marker);\r
+  return BasePrintLibSPrintMarker (StartOfBuffer, BufferSize, 0, FormatString, gNullVaList, Marker);
 }\r
 \r
 /**\r
@@ -581,7 +590,7 @@ AsciiBSPrintUnicodeFormat (
   )\r
 {\r
   ASSERT_UNICODE_BUFFER (FormatString);\r
-  return BasePrintLibSPrintMarker (StartOfBuffer, BufferSize, FORMAT_UNICODE, (CHAR8 *)FormatString, NULL, Marker);\r
+  return BasePrintLibSPrintMarker (StartOfBuffer, BufferSize, FORMAT_UNICODE, (CHAR8 *)FormatString, gNullVaList, Marker);
 }\r
 \r
 /**\r