Using __FILE_NAME__ is useful for reducing the size of debug image and it's also good for reproducable builds. The gcc-12 also supported this macro.
Ref: https://gcc.gnu.org/git/gitweb.cgi?p=gcc.git;h=1a9b3f04c11eb467a8dc504a37dad57a371a0d4c This patch removed the checking of __clang__ when using __FILE_NAME__. Cc: Zhiguang Liu <zhiguang....@intel.com> Cc: Michael D Kinney <michael.d.kin...@intel.com> Signed-off-by: Chun-Yi Lee <j...@suse.com> --- MdePkg/Include/Library/DebugLib.h | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/MdePkg/Include/Library/DebugLib.h b/MdePkg/Include/Library/DebugLib.h index 0db3b78e..fc5c8346 100644 --- a/MdePkg/Include/Library/DebugLib.h +++ b/MdePkg/Include/Library/DebugLib.h @@ -342,13 +342,13 @@ UnitTestDebugAssert ( #if defined (_ASSERT) #undef _ASSERT #endif - #if defined (__clang__) && defined (__FILE_NAME__) + #if defined (__FILE_NAME__) #define _ASSERT(Expression) UnitTestDebugAssert (__FILE_NAME__, DEBUG_LINE_NUMBER, DEBUG_EXPRESSION_STRING (Expression)) #else #define _ASSERT(Expression) UnitTestDebugAssert (__FILE__, DEBUG_LINE_NUMBER, DEBUG_EXPRESSION_STRING (Expression)) #endif #else - #if defined (__clang__) && defined (__FILE_NAME__) + #if defined (__FILE_NAME__) #define _ASSERT(Expression) DebugAssert (__FILE_NAME__, DEBUG_LINE_NUMBER, DEBUG_EXPRESSION_STRING (Expression)) #else #define _ASSERT(Expression) DebugAssert (__FILE__, DEBUG_LINE_NUMBER, DEBUG_EXPRESSION_STRING (Expression)) -- 2.35.3 -=-=-=-=-=-=-=-=-=-=-=- Groups.io Links: You receive all messages sent to this group. View/Reply Online (#120556): https://edk2.groups.io/g/devel/message/120556 Mute This Topic: https://groups.io/mt/108408749/21656 Group Owner: devel+ow...@edk2.groups.io Unsubscribe: https://edk2.groups.io/g/devel/unsub [arch...@mail-archive.com] -=-=-=-=-=-=-=-=-=-=-=-