summaryrefslogtreecommitdiff
path: root/pcrecpp.cc
diff options
context:
space:
mode:
authorph10 <ph10@2f5784b3-3f2a-0410-8824-cb99058d5e15>2008-03-28 12:06:36 +0000
committerph10 <ph10@2f5784b3-3f2a-0410-8824-cb99058d5e15>2008-03-28 12:06:36 +0000
commitf977212ac20f98f13c78f00dab0c502379a3cfa1 (patch)
treed506a7b74d5331a157d78f2f5e2e4452dfe17ca7 /pcrecpp.cc
parent7b07ed7033aa78a3c1b292ca34e3d764f4554513 (diff)
downloadpcre-f977212ac20f98f13c78f00dab0c502379a3cfa1.tar.gz
Craig's second patch to fix the previous one.
git-svn-id: svn://vcs.exim.org/pcre/code/trunk@329 2f5784b3-3f2a-0410-8824-cb99058d5e15
Diffstat (limited to 'pcrecpp.cc')
-rw-r--r--pcrecpp.cc13
1 files changed, 8 insertions, 5 deletions
diff --git a/pcrecpp.cc b/pcrecpp.cc
index ad1720a..c1b254e 100644
--- a/pcrecpp.cc
+++ b/pcrecpp.cc
@@ -64,17 +64,20 @@ Arg RE::no_arg((void*)NULL);
// only the __attribute__ syntax, but also __USER_LABEL_PREFIX__, are
// gnu-specific.)
#if defined(__GNUC__) && __GNUC__ >= 3
-#if defined(__ELF__)
+# define AS_STRING(x) AS_STRING_INTERNAL(x)
+# define AS_STRING_INTERNAL(x) #x
+# define USER_LABEL_PREFIX AS_STRING(__USER_LABEL_PREFIX__)
+# if defined(__ELF__)
extern Arg no_arg
- __attribute__((alias(__USER_LABEL_PREFIX__ "_ZN7pcrecpp2RE6no_argE")));
-#else
+ __attribute__((alias(USER_LABEL_PREFIX "_ZN7pcrecpp2RE6no_argE")));
+# else
// While we know elf supports strong aliases, not all formats do (Mach
// doesn't, for instance). So make aliases weak by default. This is
// a smidge less safe in theory (conceivably, someone could override
// this symbol in their own binary), but perfectly ok in practice.
extern Arg no_arg
- __attribute__((weak, alias(__USER_LABEL_PREFIX__ "_ZN7pcrecpp2RE6no_argE")));
-#endif
+ __attribute__((weak, alias(USER_LABEL_PREFIX "_ZN7pcrecpp2RE6no_argE")));
+# endif
#endif
// If a regular expression has no error, its error_ field points here