Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
G
girara
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
6
Issues
6
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Analytics
Analytics
CI / CD
Repository
Value Stream
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
pwmt
girara
Commits
eeae4706
Commit
eeae4706
authored
Apr 28, 2019
by
Sebastian Ramacher
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Simplify GCC version checks
parent
d935bebb
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
12 additions
and
5 deletions
+12
-5
girara/macros.h
girara/macros.h
+12
-5
No files found.
girara/macros.h
View file @
eeae4706
...
...
@@ -11,8 +11,15 @@
#define __has_builtin(x) 0
#endif
#if defined(__GNUC__) && defined(__GNUC_MINOR__)
# define GIRARA_GNUC_CHECK(maj, min) \
(((__GNUC__ << 20) + (__GNUC_MINOR__ << 10)) >= (((maj) << 20) + ((min) << 10)))
#else
# define GIRARA_GNUC_CHECK(maj, min) 0
#endif
#ifndef GIRARA_PRINTF
# if
__GNUC__ > 2 || (__GNUC__ == 2 && __GNUC_MINOR__ > 4
) || defined(__clang__)
# if
GIRARA_GNUC_CHECK(2, 5
) || defined(__clang__)
# define GIRARA_PRINTF(format_idx, arg_idx) \
__attribute__((__format__ (__printf__, format_idx, arg_idx)))
# else
...
...
@@ -31,7 +38,7 @@
#endif
#ifndef GIRARA_HIDDEN
# if
(defined(__GNUC__) && (__GNUC__ >= 4)
) || __has_attribute(visibility)
# if
GIRARA_GNUC_CHECK(4, 0
) || __has_attribute(visibility)
# define GIRARA_HIDDEN __attribute__((visibility("hidden")))
# elif defined(__SUNPRO_C)
# define GIRARA_HIDDEN __hidden
...
...
@@ -41,7 +48,7 @@
#endif
#ifndef GIRARA_VISIBLE
# if
(defined(__GNUC__) && (__GNUC__ >= 4)
) || __has_attribute(visibility)
# if
GIRARA_GNUC_CHECK(4, 0
) || __has_attribute(visibility)
# define GIRARA_VISIBLE __attribute__((visibility("default")))
# else
# define GIRARA_VISIBLE
...
...
@@ -49,7 +56,7 @@
#endif
#ifndef GIRARA_DEPRECATED
# if defined(__GNUC__)
# if defined(__GNUC__)
|| __has_attribute(deprecated)
# define GIRARA_DEPRECATED(x) x __attribute__((deprecated))
# define GIRARA_DEPRECATED_ __attribute__((deprecated))
# else
...
...
@@ -59,7 +66,7 @@
#endif
#ifndef GIRARA_ALLOC_SIZE
# if (!defined(__clang__) &&
((__GNUC__ > 4) || (__GNUC__ == 4 && __GNUC_MINOR__ >= 3)
)) || \
# if (!defined(__clang__) &&
GIRARA_GNUC_CHECK(4, 3
)) || \
(defined(__clang__) && __has_attribute(__alloc_size__))
# define GIRARA_ALLOC_SIZE(...) __attribute__((alloc_size(__VA_ARGS__)))
# else
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment