X-Git-Url: http://git.lttng.org/?a=blobdiff_plain;f=include%2Fhelper.h;h=e529ba08bc5f2bd0e101e8dbdf5228eba62dd39d;hb=c0c0989ab70574e09b2f7e8b48c2da6af664a849;hp=9873feadd85b020556c1cd1e4f45925094b1fdd1;hpb=171fcc6fd03e3f5787b3d0ee8aedc8cb9bcc6f17;p=lttng-ust.git diff --git a/include/helper.h b/include/helper.h index 9873fead..e529ba08 100644 --- a/include/helper.h +++ b/include/helper.h @@ -1,24 +1,12 @@ -#ifndef _LTTNG_UST_HELPER_H -#define _LTTNG_UST_HELPER_H - /* - * Copyright (C) 2011 Mathieu Desnoyers + * SPDX-License-Identifier: LGPL-2.1-only * - * This library is free software; you can redistribute it and/or - * modify it under the terms of the GNU Lesser General Public - * License as published by the Free Software Foundation; version 2.1 of - * the License. - * - * This library is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - * Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public - * License along with this library; if not, write to the Free Software - * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA + * Copyright (C) 2011 Mathieu Desnoyers */ +#ifndef _LTTNG_UST_HELPER_H +#define _LTTNG_UST_HELPER_H + #include static inline __attribute__((always_inline)) @@ -55,4 +43,15 @@ void *zmalloc(size_t len) #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 */