__FUNCTION__ is a pre-standard extension that gcc and Visual C++ among
others support, while __func__ was standardized in C99.

Since it's more standard, replace __FUNCTION__ with __func__ throughout
CryptoPkg.

Visual Studio versions before VS 2015 don't support __func__ and so
will fail to compile. A workaround is to define __func__ as
__FUNCTION__ :

  #define __func__ __FUNCTION__

Signed-off-by: Rebecca Cran <rebe...@bsdio.com>
---
 CryptoPkg/Library/TlsLib/TlsConfig.c  | 8 ++++----
 CryptoPkg/Library/TlsLib/TlsProcess.c | 4 ++--
 2 files changed, 6 insertions(+), 6 deletions(-)

diff --git a/CryptoPkg/Library/TlsLib/TlsConfig.c 
b/CryptoPkg/Library/TlsLib/TlsConfig.c
index 60559de4a7f3..fdda73690ae5 100644
--- a/CryptoPkg/Library/TlsLib/TlsConfig.c
+++ b/CryptoPkg/Library/TlsLib/TlsConfig.c
@@ -331,7 +331,7 @@ TlsSetCipherList (
         DEBUG_VERBOSE,
         "%a:%a: skipping CipherId=0x%04x\n",
         gEfiCallerBaseName,
-        __FUNCTION__,
+        __func__,
         CipherId[Index]
         ));
       //
@@ -380,7 +380,7 @@ TlsSetCipherList (
       DEBUG_ERROR,
       "%a:%a: no CipherId could be mapped\n",
       gEfiCallerBaseName,
-      __FUNCTION__
+      __func__
       ));
     Status = EFI_UNSUPPORTED;
     goto FreeMappedCipher;
@@ -441,7 +441,7 @@ TlsSetCipherList (
     DEBUG_VERBOSE,
     "%a:%a: CipherString={\n",
     gEfiCallerBaseName,
-    __FUNCTION__
+    __func__
     ));
   for (CipherStringPosition = CipherString;
        CipherStringPosition < CipherString + FullLength;
@@ -610,7 +610,7 @@ TlsSetVerifyHost (
       "%a:%a: parsed \"%a\" as an IPv%c address "
       "literal\n",
       gEfiCallerBaseName,
-      __FUNCTION__,
+      __func__,
       HostName,
       (UINTN)((BinaryAddressSize == NS_IN6ADDRSZ) ? '6' : '4')
       ));
diff --git a/CryptoPkg/Library/TlsLib/TlsProcess.c 
b/CryptoPkg/Library/TlsLib/TlsProcess.c
index a803d86c4f4e..db296053fd2c 100644
--- a/CryptoPkg/Library/TlsLib/TlsProcess.c
+++ b/CryptoPkg/Library/TlsLib/TlsProcess.c
@@ -127,7 +127,7 @@ TlsDoHandshake (
       DEBUG ((
         DEBUG_ERROR,
         "%a SSL_HANDSHAKE_ERROR State=0x%x SSL_ERROR_%a\n",
-        __FUNCTION__,
+        __func__,
         SSL_get_state (TlsConn->Ssl),
         Ret == SSL_ERROR_SSL ? "SSL" : Ret == SSL_ERROR_SYSCALL ? "SYSCALL" : 
"ZERO_RETURN"
         ));
@@ -141,7 +141,7 @@ TlsDoHandshake (
         DEBUG ((
           DEBUG_ERROR,
           "%a ERROR 0x%x=L%x:F%x:R%x\n",
-          __FUNCTION__,
+          __func__,
           ErrorCode,
           ERR_GET_LIB (ErrorCode),
           ERR_GET_FUNC (ErrorCode),
-- 
2.34.1



-=-=-=-=-=-=-=-=-=-=-=-
Groups.io Links: You receive all messages sent to this group.
View/Reply Online (#102643): https://edk2.groups.io/g/devel/message/102643
Mute This Topic: https://groups.io/mt/98115251/21656
Group Owner: devel+ow...@edk2.groups.io
Unsubscribe: https://edk2.groups.io/g/devel/unsub [arch...@mail-archive.com]
-=-=-=-=-=-=-=-=-=-=-=-


Reply via email to