Re: [pcre-dev] [Bug 664] ABI breakage in PCRE 7.6

Αρχική Σελίδα
Delete this message
Συντάκτης: Zack Weinberg
Ημερομηνία:  
Υ/ο: pcre-dev
Αντικείμενο: Re: [pcre-dev] [Bug 664] ABI breakage in PCRE 7.6
On Mon, Mar 24, 2008 at 2:20 PM, Daniel Macks <dmacks@???> wrote:
> --- Comment #18 from Daniel Macks <dmacks@???> 2008-03-24 18:20:23 ---
> Libtool supplies an autoconf macro AC_LTDL_SYMBOL_USCORE, documented as "does
> the compiler prefix global symbols with an underscore?". Use the
> $ac_cv_sys_symbol_underscore result to decide what to do.


Or, as this is already gcc specific, you could just use the predefined
macro __USER_LABEL_PREFIX__, which expands to a string; for instance

#if defined(__GNUC__) && __GNUC__ >= 3
extern Arg no_arg __attribute__((
#ifdef __MACH__
// Mach (or at least OS X), doesn't support strong aliases, so make it
// weak.  This is a smidge less safe in theory (conceivably, someone
// could override this symbol in their own binary), but perfectly ok.
                 weak,
#endif
                 alias(__USER_LABEL_PREFIX__
                       "_ZN7pcrecpp2RE6no_argE")));
#endif


[in case you haven't seen it before, I should explain that two
adjacent strings will be concatenated by the compiler]

zw