| 64 |
// only the __attribute__ syntax, but also __USER_LABEL_PREFIX__, are |
// only the __attribute__ syntax, but also __USER_LABEL_PREFIX__, are |
| 65 |
// gnu-specific.) |
// gnu-specific.) |
| 66 |
#if defined(__GNUC__) && __GNUC__ >= 3 |
#if defined(__GNUC__) && __GNUC__ >= 3 |
| 67 |
#if defined(__ELF__) |
# define AS_STRING(x) AS_STRING_INTERNAL(x) |
| 68 |
|
# define AS_STRING_INTERNAL(x) #x |
| 69 |
|
# define USER_LABEL_PREFIX AS_STRING(__USER_LABEL_PREFIX__) |
| 70 |
|
# if defined(__ELF__) |
| 71 |
extern Arg no_arg |
extern Arg no_arg |
| 72 |
__attribute__((alias(__USER_LABEL_PREFIX__ "_ZN7pcrecpp2RE6no_argE"))); |
__attribute__((alias(USER_LABEL_PREFIX "_ZN7pcrecpp2RE6no_argE"))); |
| 73 |
#else |
# else |
| 74 |
// While we know elf supports strong aliases, not all formats do (Mach |
// While we know elf supports strong aliases, not all formats do (Mach |
| 75 |
// doesn't, for instance). So make aliases weak by default. This is |
// doesn't, for instance). So make aliases weak by default. This is |
| 76 |
// a smidge less safe in theory (conceivably, someone could override |
// a smidge less safe in theory (conceivably, someone could override |
| 77 |
// this symbol in their own binary), but perfectly ok in practice. |
// this symbol in their own binary), but perfectly ok in practice. |
| 78 |
extern Arg no_arg |
extern Arg no_arg |
| 79 |
__attribute__((weak, alias(__USER_LABEL_PREFIX__ "_ZN7pcrecpp2RE6no_argE"))); |
__attribute__((weak, alias(USER_LABEL_PREFIX "_ZN7pcrecpp2RE6no_argE"))); |
| 80 |
#endif |
# endif |
| 81 |
#endif |
#endif |
| 82 |
|
|
| 83 |
// If a regular expression has no error, its error_ field points here |
// If a regular expression has no error, its error_ field points here |