From 3c5199042a1206d11eb062c142c13aedd96c108e Mon Sep 17 00:00:00 2001 From: Anton Korobeynikov Date: Tue, 19 Apr 2011 21:22:14 +0000 Subject: Add some macro magic: user __USER_LABEL_PREFIX__ instead of hardcoding it for each platform llvm-svn: 129818 --- compiler-rt/lib/assembly.h | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) (limited to 'compiler-rt') diff --git a/compiler-rt/lib/assembly.h b/compiler-rt/lib/assembly.h index 245f96d88bb..0ce83ac294c 100644 --- a/compiler-rt/lib/assembly.h +++ b/compiler-rt/lib/assembly.h @@ -22,18 +22,18 @@ #define SEPARATOR ; #endif -/* We can't use __USER_LABEL_PREFIX__ here, it isn't possible to concatenate the - *values* of two macros. This is quite brittle, though. */ #if defined(__APPLE__) -#define SYMBOL_NAME(name) _##name #define HIDDEN_DIRECTIVE .private_extern #define LOCAL_LABEL(name) L_##name #else -#define SYMBOL_NAME(name) name #define HIDDEN_DIRECTIVE .hidden #define LOCAL_LABEL(name) .L_##name #endif +#define GLUE2(a, b) a ## b +#define GLUE(a, b) GLUE2(a, b) +#define SYMBOL_NAME(name) GLUE(__USER_LABEL_PREFIX__, name) + #ifdef VISIBILITY_HIDDEN #define DEFINE_COMPILERRT_FUNCTION(name) \ .globl SYMBOL_NAME(name) SEPARATOR \ -- cgit v1.2.3