summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authoreric_tian <eric_tian@6f19259b-4bc3-4df7-8a09-765794883524>2009-08-14 09:41:23 +0000
committereric_tian <eric_tian@6f19259b-4bc3-4df7-8a09-765794883524>2009-08-14 09:41:23 +0000
commitc113cd3272b5cde2f79a88ac5895e607ba2852e2 (patch)
treeed06f26efb09d5deb039fb55103097944979b44c
parentd4cf6b6c976d07af769ad3bfeeccbcf833e72c32 (diff)
downloadedk2-c113cd3272b5cde2f79a88ac5895e607ba2852e2.tar.gz
edk2-c113cd3272b5cde2f79a88ac5895e607ba2852e2.tar.bz2
edk2-c113cd3272b5cde2f79a88ac5895e607ba2852e2.zip
redefine the ASM_PFX to let it can work on Apple/NetBSD and other Unix* platform.
git-svn-id: https://edk2.svn.sourceforge.net/svnroot/edk2/trunk/edk2@9074 6f19259b-4bc3-4df7-8a09-765794883524
-rw-r--r--EdkCompatibilityPkg/Foundation/Include/Ia32/EfiBind.h17
-rw-r--r--EdkCompatibilityPkg/Foundation/Include/X64/EfiBind.h17
2 files changed, 24 insertions, 10 deletions
diff --git a/EdkCompatibilityPkg/Foundation/Include/Ia32/EfiBind.h b/EdkCompatibilityPkg/Foundation/Include/Ia32/EfiBind.h
index 0f5b220731..5cfbb74131 100644
--- a/EdkCompatibilityPkg/Foundation/Include/Ia32/EfiBind.h
+++ b/EdkCompatibilityPkg/Foundation/Include/Ia32/EfiBind.h
@@ -310,11 +310,18 @@ typedef int32_t intn_t;
// For symbol name in GNU assembly code, an extra "_" is necessary
//
#if defined(__GNUC__)
- #if defined(linux)
- #define ASM_PFX(name) name
- #else
- #define ASM_PFX(name) _##name
- #endif
+ ///
+ /// Private worker functions for ASM_PFX()
+ ///
+ #define _CONCATENATE(a, b) __CONCATENATE(a, b)
+ #define __CONCATENATE(a, b) a ## b
+
+ ///
+ /// The __USER_LABEL_PREFIX__ macro predefined by GNUC represents the prefix
+ /// on symbols in assembly language.
+ ///
+ #define ASM_PFX(name) _CONCATENATE (__USER_LABEL_PREFIX__, name)
+
#endif
#endif
diff --git a/EdkCompatibilityPkg/Foundation/Include/X64/EfiBind.h b/EdkCompatibilityPkg/Foundation/Include/X64/EfiBind.h
index 273490eeca..a0ab02b838 100644
--- a/EdkCompatibilityPkg/Foundation/Include/X64/EfiBind.h
+++ b/EdkCompatibilityPkg/Foundation/Include/X64/EfiBind.h
@@ -262,11 +262,18 @@ typedef int64_t intn_t;
// For symbol name in GNU assembly code, an extra "_" is necessary
//
#if defined(__GNUC__)
- #if defined(linux)
- #define ASM_PFX(name) name
- #else
- #define ASM_PFX(name) _##name
- #endif
+ ///
+ /// Private worker functions for ASM_PFX()
+ ///
+ #define _CONCATENATE(a, b) __CONCATENATE(a, b)
+ #define __CONCATENATE(a, b) a ## b
+
+ ///
+ /// The __USER_LABEL_PREFIX__ macro predefined by GNUC represents the prefix
+ /// on symbols in assembly language.
+ ///
+ #define ASM_PFX(name) _CONCATENATE (__USER_LABEL_PREFIX__, name)
+
#endif
#endif