Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
C
cmp_tool
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Deploy
Releases
Package registry
Model registry
Operate
Terraform modules
Monitor
Incidents
Service Desk
Analyze
Value stream analytics
Contributor analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
GitLab community forum
Contribute to GitLab
Provide feedback
Terms and privacy
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Dominik Loidolt
cmp_tool
Commits
4d1c4da0
Commit
4d1c4da0
authored
1 year ago
by
Dominik Loidolt
Browse files
Options
Downloads
Patches
Plain Diff
Fix UNUSED macro for older compiler (gcc 4.4 and older)
parent
98ec18e6
No related branches found
No related tags found
1 merge request
!26
Adapt cmp_tool to the chunk decompression
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
lib/common/compiler.h
+25
-2
25 additions, 2 deletions
lib/common/compiler.h
with
25 additions
and
2 deletions
lib/common/compiler.h
+
25
−
2
View file @
4d1c4da0
...
...
@@ -21,6 +21,22 @@
#define COMPILER_H
/* Derived from Linux "Features Test Macro" header Convenience macros to test
* the versions of gcc (or a compatible compiler).
* Use them like this:
* #if GNUC_PREREQ (2,8)
* ... code requiring gcc 2.8 or later ...
* #endif
*/
#if defined(__GNUC__) && defined(__GNUC_MINOR__)
# define GNUC_PREREQ(maj, min) \
((__GNUC__ << 16) + __GNUC_MINOR__ >= ((maj) << 16) + (min))
#else
#define GNUC_PREREQ(maj, min) 0
#endif
/**
* Compile time check usable outside of function scope.
* Stolen from Linux (hpi_internal.h)
...
...
@@ -108,12 +124,19 @@
*
* This macro is used to indicate that a variable is intentionally left unused
* in the code. It helps suppress compiler warnings about unused variables.
* It also protecting against actual use of the "unused" variable.
*
* It also tries to prevent the actual use of the "unused" variables.
*/
#if GNUC_PREREQ(4, 5)
#define UNUSED __attribute__((unused)) \
__attribute__((deprecated ("parameter declared as UNUSED")))
#elif defined(__GNUC__)
#define UNUSED __attribute__((unused)) \
__attribute__((deprecated))
#else
#define UNUSED
#endif
/**
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment