Skip to content

Commit ea3323c

Browse files
committed
Added two preprocessor macros: UNUSED and UNUSED_FUNCTION
1 parent df7107f commit ea3323c

File tree

2 files changed

+15
-0
lines changed

2 files changed

+15
-0
lines changed

CHANGELOG.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,8 @@
2222
The hook will check the license headers, amend them where possible and abort
2323
where not possible, showing the commands needed to update the license.
2424
_NOT recommended_ The hook can be skipped by passing the `--no-verify` option to `git commit`
25+
- An `UNUSED` preprocessor macro to mark arguments as unused.
26+
- An `UNUSED_FUNCTION` preprocessor macro to mark functions as unused.
2527

2628
### Changed
2729

include/Config.hpp.in

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -41,6 +41,19 @@
4141
#define attribute(x)
4242
#endif
4343

44+
#ifdef __GNUC__
45+
# define UNUSED(x) UNUSED_ ## x __attribute__((__unused__))
46+
#else
47+
# define UNUSED(x) UNUSED_ ## x
48+
#endif
49+
50+
#ifdef __GNUC__
51+
# define UNUSED_FUNCTION(x) __attribute__((__unused__)) UNUSED_ ## x
52+
#else
53+
# define UNUSED_FUNCTION(x) UNUSED_ ## x
54+
#endif
55+
56+
4457
#include <boost/current_function.hpp>
4558

4659
// Inspired from Eigen EIGEN_DEFAULT_DENSE_INDEX_TYPE

0 commit comments

Comments
 (0)