| 59 |
|
|
| 60 |
// This is for ABI compatibility with old versions of pcre (pre-7.6), |
// This is for ABI compatibility with old versions of pcre (pre-7.6), |
| 61 |
// which defined a global no_arg variable instead of putting it in the |
// which defined a global no_arg variable instead of putting it in the |
| 62 |
// RE class. This works on GCC >= 3, at least. We could probably have |
// RE class. This works on GCC >= 3, at least. We could probably |
| 63 |
// a more inclusive test if we ever needed it. |
// have a more inclusive test if we ever needed it. (Note that not |
| 64 |
|
// only the __attribute__ syntax, but also __USER_LABEL_PREFIX__, are |
| 65 |
|
// gnu-specific.) |
| 66 |
#if defined(__GNUC__) && __GNUC__ >= 3 |
#if defined(__GNUC__) && __GNUC__ >= 3 |
| 67 |
extern Arg no_arg __attribute__((alias("_ZN7pcrecpp2RE6no_argE"))); |
#if defined(__ELF__) |
| 68 |
|
extern Arg no_arg |
| 69 |
|
__attribute__((alias(__USER_LABEL_PREFIX__ "_ZN7pcrecpp2RE6no_argE"))); |
| 70 |
|
#else |
| 71 |
|
// While we know elf supports strong aliases, not all formats do (Mach |
| 72 |
|
// doesn't, for instance). So make aliases weak by default. This is |
| 73 |
|
// a smidge less safe in theory (conceivably, someone could override |
| 74 |
|
// this symbol in their own binary), but perfectly ok in practice. |
| 75 |
|
extern Arg no_arg |
| 76 |
|
__attribute__((weak, alias(__USER_LABEL_PREFIX__ "_ZN7pcrecpp2RE6no_argE"))); |
| 77 |
|
#endif |
| 78 |
#endif |
#endif |
| 79 |
|
|
| 80 |
// If a regular expression has no error, its error_ field points here |
// If a regular expression has no error, its error_ field points here |