X-Git-Url: https://git.lttng.org/?a=blobdiff_plain;f=include%2Flttng%2Fust-utils.h;h=575034faa5bae82fa3a5f890bb16b1702e70e86e;hb=1c1968450409b3c159a3000f9e1a968ff1e5f7e8;hp=25b8c7fdb835d55c9f815278c4c2aa1386c1a648;hpb=62eb004ccbd4b3d759bda96f7a0c6d072b23ffa9;p=lttng-ust.git diff --git a/include/lttng/ust-utils.h b/include/lttng/ust-utils.h index 25b8c7fd..575034fa 100644 --- a/include/lttng/ust-utils.h +++ b/include/lttng/ust-utils.h @@ -1,8 +1,6 @@ -/* - * SPDX-License-Identifier: MIT - * - * Copyright (C) 2010-2011 Mathieu Desnoyers - */ +// SPDX-FileCopyrightText: 2010-2011 Mathieu Desnoyers +// +// SPDX-License-Identifier: MIT #ifndef _LTTNG_UST_UTILS_H #define _LTTNG_UST_UTILS_H @@ -62,13 +60,16 @@ * lttng_ust_is_pointer_type - check if type is a pointer * * Returns true if the type of @type is a pointer. + * + * Note: The C implementation of lttng_ust_is_pointer_type uses pointer + * arithmetic, which does not work on opaque pointer types. */ #if defined(__cplusplus) #define lttng_ust_is_pointer_type(type) (std::is_pointer::value) #else /* The difference between two pointers is an integer. */ #define lttng_ust_is_pointer_type(type) \ - (lttng_ust_is_integer_type(typeof(((type)0 - (type)0))) && !lttng_ust_is_integer_type(type)) + (lttng_ust_is_integer_type(typeof(((type)1 - (type)1))) && !lttng_ust_is_integer_type(type)) #endif