X-Git-Url: http://git.liburcu.org/?a=blobdiff_plain;f=include%2Fhelper.h;h=a187b0e7327b2af0f3d39f1160182ad514317303;hb=de713d8a77cbd77e60f58537b0fc222f98fde395;hp=9d6617a8de044b2f1fa04481c9c1874cb8ffbcd2;hpb=fd67a0045e800401532c095588a1fe5d452a4777;p=lttng-ust.git diff --git a/include/helper.h b/include/helper.h index 9d6617a8..a187b0e7 100644 --- a/include/helper.h +++ b/include/helper.h @@ -43,4 +43,27 @@ void *zmalloc(size_t len) #define LTTNG_ARRAY_SIZE(arr) (sizeof(arr) / sizeof((arr)[0])) +/* + * Use of __builtin_return_address(0) sometimes seems to cause stack + * corruption on 32-bit PowerPC. Disable this feature on that + * architecture for now by always using the NULL value for the ip + * context. + */ +#if defined(__PPC__) && !defined(__PPC64__) +#define LTTNG_UST_CALLER_IP() NULL +#else /* #if defined(__PPC__) && !defined(__PPC64__) */ +#define LTTNG_UST_CALLER_IP() __builtin_return_address(0) +#endif /* #else #if defined(__PPC__) && !defined(__PPC64__) */ + +/* + * LTTNG_HIDDEN: set the hidden attribute for internal functions + * On Windows, symbols are local unless explicitly exported, + * see https://gcc.gnu.org/wiki/Visibility + */ +#if defined(_WIN32) || defined(__CYGWIN__) +#define LTTNG_HIDDEN +#else +#define LTTNG_HIDDEN __attribute__((visibility("hidden"))) +#endif + #endif /* _LTTNG_UST_HELPER_H */