From: Mathieu Desnoyers Date: Fri, 15 Dec 2023 16:26:33 +0000 (-0500) Subject: Remove backup file X-Git-Url: http://git.efficios.com/?p=libside.git;a=commitdiff_plain;h=7f874fb21b5b0ce7800a00463bef13c899698693 Remove backup file Signed-off-by: Mathieu Desnoyers --- diff --git a/include/side/macros-bkp.h b/include/side/macros-bkp.h deleted file mode 100644 index 3c9f6b7..0000000 --- a/include/side/macros-bkp.h +++ /dev/null @@ -1,71 +0,0 @@ -// SPDX-License-Identifier: MIT -/* - * Copyright 2022 Mathieu Desnoyers - */ - -#ifndef _SIDE_MACROS_H -#define _SIDE_MACROS_H - -#include -#include - -/* Helper macros */ - -#define SIDE_ARRAY_SIZE(arr) (sizeof(arr) / sizeof((arr)[0])) - -/* - * Compound literals with static storage are needed by SIDE - * instrumentation. - * Compound literals are part of the C99 and C11 standards, but not - * part of the C++ standards. They are supported by most C++ compilers - * though. - * - * Example use: - * static struct mystruct *var = LTTNG_UST_COMPOUND_LITERAL(struct mystruct, { 1, 2, 3 }); - */ -#define SIDE_COMPOUND_LITERAL(type, ...) (type[]) { __VA_ARGS__ } - -#define side_likely(x) __builtin_expect(!!(x), 1) -#define side_unlikely(x) __builtin_expect(!!(x), 0) - -#define SIDE_PARAM(...) __VA_ARGS__ - -/* Select arg1 in list of arguments. */ -#define SIDE_PARAM_SELECT_ARG1(_arg0, _arg1, ...) _arg1 - -/* - * Use the default parameter if no additional arguments are provided, -.* else use the following arguments. Use inside macros to implement - * optional last macro argument. - */ -#define SIDE_PARAM_DEFAULT(_default, ...) \ - SIDE_PARAM_SELECT_ARG1(dummy, ##__VA_ARGS__, _default) - -/* - * side_container_of - Get the address of an object containing a field. - * - * @ptr: pointer to the field. - * @type: type of the object. - * @member: name of the field within the object. - */ -#define side_container_of(ptr, type, member) \ - __extension__ \ - ({ \ - const __typeof__(((type *) NULL)->member) * __ptr = (ptr); \ - (type *)((char *)__ptr - offsetof(type, member)); \ - }) - -#define side_struct_field_sizeof(_struct, _field) \ - sizeof(((_struct * )NULL)->_field) - -#if defined(__SIZEOF_LONG__) -#define SIDE_BITS_PER_LONG (__SIZEOF_LONG__ * 8) -#elif defined(_LP64) -#define SIDE_BITS_PER_LONG 64 -#else -#define SIDE_BITS_PER_LONG 32 -#endif - -#define SIDE_PACKED __attribute__((packed)) - -#endif /* _SIDE_MACROS_H */