From 5a49bad020792483b5abd137861f906c55bf9dca Mon Sep 17 00:00:00 2001 From: Gary Ching-Pang Lin Date: Tue, 27 Oct 2015 12:00:13 +0800 Subject: Cryptlib: Define the va functions for EFIAPI It turned out that my previous crash fix(*) was wrong. We actually always used the gcc built-in va functions instead of the "real" va functions for EFIAPI, and we are just lucky that ERR_add_error_data didn't crash before. This commit copies the va functions from MdePkg/Include/Base.h in edk2 and introdues NO_BUILTIN_VA_FUNCS for x86_64, so that all the x86_64 build will adopt the new va functions. For safety, I also added EFIAPI to all the functions which use va_* to avoid the potential trouble. (*) a7f4b26cc35204165bd04e75c34e8e7aa2a87ecc Signed-off-by: Gary Ching-Pang Lin --- Cryptlib/Include/openssl/bio.h | 8 ++++++++ 1 file changed, 8 insertions(+) (limited to 'Cryptlib/Include/openssl/bio.h') diff --git a/Cryptlib/Include/openssl/bio.h b/Cryptlib/Include/openssl/bio.h index 561ae2f0..69bd48c9 100644 --- a/Cryptlib/Include/openssl/bio.h +++ b/Cryptlib/Include/openssl/bio.h @@ -787,11 +787,19 @@ void BIO_copy_next_retry(BIO *b); # else # define __bio_h__attr__(x) # endif +# if defined(OPENSSL_SYS_UEFI) +int EFIAPI BIO_printf(BIO *bio, const char *format, ...) +# else int BIO_printf(BIO *bio, const char *format, ...) +# endif __bio_h__attr__((__format__(__printf__, 2, 3))); int BIO_vprintf(BIO *bio, const char *format, va_list args) __bio_h__attr__((__format__(__printf__, 2, 0))); +# if defined(OPENSSL_SYS_UEFI) +int EFIAPI BIO_snprintf(char *buf, size_t n, const char *format, ...) +# else int BIO_snprintf(char *buf, size_t n, const char *format, ...) +# endif __bio_h__attr__((__format__(__printf__, 3, 4))); int BIO_vsnprintf(char *buf, size_t n, const char *format, va_list args) __bio_h__attr__((__format__(__printf__, 3, 0))); -- cgit v1.2.3