LMMS
Loading...
Searching...
No Matches
attributes.h
Go to the documentation of this file.
1// Copyright 2012-2022 David Robillard <d@drobilla.net>
2// SPDX-License-Identifier: ISC
3
4#ifndef PUGL_SRC_ATTRIBUTES_H
5#define PUGL_SRC_ATTRIBUTES_H
6
7// Unused parameter macro to suppresses warnings and make it impossible to use
8#if defined(__cplusplus)
9# define PUGL_UNUSED(name)
10#elif defined(__GNUC__) || defined(__clang__)
11# define PUGL_UNUSED(name) name##_unused __attribute__((__unused__))
12#else
13# define PUGL_UNUSED(name) name
14#endif
15
16// Unused result macro to warn when an important return status is ignored
17#ifndef _MSC_VER
18# define PUGL_WARN_UNUSED_RESULT __attribute__((warn_unused_result))
19#else
20# define PUGL_WARN_UNUSED_RESULT
21#endif
22
23#endif // PUGL_SRC_ATTRIBUTES_H