Menu

#74 [PATCH] Add AsciiPrint and AsciiVSPrint

Unstable_(example)
closed
None
5
2021-02-18
2021-02-17
Pete Batard
No

Per https://github.com/tianocore/edk2/blob/master/MdePkg/Include/Library/PrintLib.h
AsciiPrint() is the official name of APrint() so declare it as such and define
an APrint alias for compatibility.

Note: We do it this way rather than declare a new AsciiPrint define because hooking into a variable argument function call is notoriously difficult to accomplish, and, if one wants to to do so in a library that can hook into either EDK2 or gnu-efi, having one using AsciiPrint() as a define whereas the other one uses an actual linkable function call requires the addition of a wrapper that is EDK2 vs gnu-efi aware. But if instead we do define the gnu-efi call to use the same AsciiPrint name as EDK2, no such wrapper is necessary.

Also add an AsciiVSPrint() to print a formatted ASCII string to a buffer using
a va_list. AsciiPrint() too is defined in EDK2's PrintLib.h, though our implementation
just invokes the Unicode version and then converts the buffer to ASCII.

1 Attachments

Discussion

  • Nigel Croxon

    Nigel Croxon - 2021-02-18
    • status: open --> closed
    • assigned_to: Nigel Croxon
     
  • Nigel Croxon

    Nigel Croxon - 2021-02-18

    commit 0247cb7cd4024cf2ce45996c293be53e5b87c3cc (HEAD -> master)
    Author: Pete Batard pete@akeo.ie
    Date: Tue Feb 16 19:05:43 2021 +0000

    Add AsciiPrint and AsciiVSPrint
    
     

Log in to post a comment.

MongoDB Logo MongoDB