Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
M
mpd
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Registry
Registry
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Иван Мажукин
mpd
Commits
0964b062
Commit
0964b062
authored
Nov 28, 2014
by
Max Kellermann
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Compiler.h: add macro GCC_OLDER_THAN()
parent
92eeca3b
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
12 additions
and
4 deletions
+12
-4
Compiler.h
src/Compiler.h
+10
-2
Manual.hxx
src/util/Manual.hxx
+2
-2
No files found.
src/Compiler.h
View file @
0964b062
...
@@ -31,13 +31,21 @@
...
@@ -31,13 +31,21 @@
#define GCC_CHECK_VERSION(major, minor) \
#define GCC_CHECK_VERSION(major, minor) \
(defined(__GNUC__) && GCC_VERSION >= GCC_MAKE_VERSION(major, minor, 0))
(defined(__GNUC__) && GCC_VERSION >= GCC_MAKE_VERSION(major, minor, 0))
/**
* Are we building with gcc (not clang or any other compiler) and a
* version older than the specified one?
*/
#define GCC_OLDER_THAN(major, minor) \
(defined(__GNUC__) && !defined(__clang__) && \
GCC_VERSION < GCC_MAKE_VERSION(major, minor, 0))
#ifdef __clang__
#ifdef __clang__
# define CLANG_VERSION GCC_MAKE_VERSION(__clang_major__, __clang_minor__, __clang_patchlevel__)
# define CLANG_VERSION GCC_MAKE_VERSION(__clang_major__, __clang_minor__, __clang_patchlevel__)
# if __clang_major__ < 3
# if __clang_major__ < 3
# error Sorry, your clang version is too old. You need at least version 3.1.
# error Sorry, your clang version is too old. You need at least version 3.1.
# endif
# endif
#elif defined(__GNUC__)
#elif defined(__GNUC__)
# if
!GCC_CHECK_VERSIO
N(4,6)
# if
GCC_OLDER_THA
N(4,6)
# error Sorry, your gcc version is too old. You need at least version 4.6.
# error Sorry, your gcc version is too old. You need at least version 4.6.
# endif
# endif
#else
#else
...
@@ -138,7 +146,7 @@
...
@@ -138,7 +146,7 @@
#if defined(__cplusplus)
#if defined(__cplusplus)
/* support for C++11 "override" was added in gcc 4.7 */
/* support for C++11 "override" was added in gcc 4.7 */
#if
!defined(__clang__) && !GCC_CHECK_VERSIO
N(4,7)
#if
GCC_OLDER_THA
N(4,7)
#define override
#define override
#define final
#define final
#endif
#endif
...
...
src/util/Manual.hxx
View file @
0964b062
...
@@ -35,7 +35,7 @@
...
@@ -35,7 +35,7 @@
#include <new>
#include <new>
#include <utility>
#include <utility>
#if
!defined(__clang__) && __GNUC__ && !GCC_CHECK_VERSIO
N(4,8)
#if
GCC_OLDER_THA
N(4,8)
#include <type_traits>
#include <type_traits>
#endif
#endif
...
@@ -54,7 +54,7 @@
...
@@ -54,7 +54,7 @@
*/
*/
template
<
class
T
>
template
<
class
T
>
class
Manual
{
class
Manual
{
#if
!defined(__clang__) && __GNUC__ && !GCC_CHECK_VERSIO
N(4,8)
#if
GCC_OLDER_THA
N(4,8)
/* no alignas() on gcc < 4.8: apply worst-case fallback */
/* no alignas() on gcc < 4.8: apply worst-case fallback */
__attribute__
((
aligned
(
8
)))
__attribute__
((
aligned
(
8
)))
#else
#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