summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorChun-Yi Lee <jlee@suse.com>2024-09-12 14:32:05 +0800
committermergify[bot] <37929162+mergify[bot]@users.noreply.github.com>2024-09-13 12:45:29 +0000
commit5c8bdb190f6dd79f38ef6191754c9a26892f8d26 (patch)
tree08e096b17ff8dad95de79ea4f3d185eb13f759b6
parent69139e39bc9bd7410ee71a830b812fb74d21bdb4 (diff)
downloadedk2-5c8bdb190f6dd79f38ef6191754c9a26892f8d26.tar.gz
edk2-5c8bdb190f6dd79f38ef6191754c9a26892f8d26.tar.bz2
edk2-5c8bdb190f6dd79f38ef6191754c9a26892f8d26.zip
MdePkg DebugLib: Enable FILE NAME as DEBUG ASSERT for GCC12
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__. References: https://gcc.gnu.org/bugzilla/show_bug.cgi?id=42579 Signed-off-by: Chun-Yi Lee <jlee@suse.com>
-rw-r--r--MdePkg/Include/Library/DebugLib.h4
1 files changed, 2 insertions, 2 deletions
diff --git a/MdePkg/Include/Library/DebugLib.h b/MdePkg/Include/Library/DebugLib.h
index 0db3b78ec8..fc5c83463d 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))