diff options
author | ph10 <ph10@2f5784b3-3f2a-0410-8824-cb99058d5e15> | 2008-03-26 17:39:06 +0000 |
---|---|---|
committer | ph10 <ph10@2f5784b3-3f2a-0410-8824-cb99058d5e15> | 2008-03-26 17:39:06 +0000 |
commit | 7b07ed7033aa78a3c1b292ca34e3d764f4554513 (patch) | |
tree | 5a6b9dba01ee1ed3004200c52615a2d2da6bb0c0 | |
parent | 7198804ea6cfc68b245026dcf43bbff197cf7956 (diff) | |
download | pcre-7b07ed7033aa78a3c1b292ca34e3d764f4554513.tar.gz |
Patch to pcrecpp.cc to fix an OS X linking problem.
git-svn-id: svn://vcs.exim.org/pcre/code/trunk@328 2f5784b3-3f2a-0410-8824-cb99058d5e15
-rw-r--r-- | ChangeLog | 3 | ||||
-rw-r--r-- | pcrecpp.cc | 18 |
2 files changed, 18 insertions, 3 deletions
@@ -36,6 +36,9 @@ Version 7.7 05-Mar-08 7. Added some missing "const"s to declarations of static tables in pcre_compile.c and pcre_dfa_exec.c. + +8. Applied Craig's patch to pcrecpp.cc to fix a problem in OS X that was + caused by fix #2 above. Version 7.6 28-Jan-08 @@ -59,10 +59,22 @@ Arg RE::no_arg((void*)NULL); // This is for ABI compatibility with old versions of pcre (pre-7.6), // which defined a global no_arg variable instead of putting it in the -// RE class. This works on GCC >= 3, at least. We could probably have -// a more inclusive test if we ever needed it. +// RE class. This works on GCC >= 3, at least. We could probably +// have a more inclusive test if we ever needed it. (Note that not +// only the __attribute__ syntax, but also __USER_LABEL_PREFIX__, are +// gnu-specific.) #if defined(__GNUC__) && __GNUC__ >= 3 -extern Arg no_arg __attribute__((alias("_ZN7pcrecpp2RE6no_argE"))); +#if defined(__ELF__) +extern Arg no_arg + __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 #endif // If a regular expression has no error, its error_ field points here |