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
2f76f9da
Commit
2f76f9da
authored
Nov 18, 2016
by
Max Kellermann
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
configure.ac: enable C++14
parent
b0b8f573
Expand all
Hide whitespace changes
Inline
Side-by-side
Showing
9 changed files
with
45 additions
and
152 deletions
+45
-152
NEWS
NEWS
+2
-0
configure.ac
configure.ac
+1
-8
developer.xml
doc/developer.xml
+2
-2
ax_cxx_compile_stdcxx.m4
m4/ax_cxx_compile_stdcxx.m4
+0
-0
ax_cxx_compile_stdcxx_0x.m4
m4/ax_cxx_compile_stdcxx_0x.m4
+0
-107
ax_cxx_compile_stdcxx_14.m4
m4/ax_cxx_compile_stdcxx_14.m4
+34
-0
Chrono.hxx
src/Chrono.hxx
+4
-15
Compiler.h
src/Compiler.h
+2
-16
Manual.hxx
src/util/Manual.hxx
+0
-4
No files found.
NEWS
View file @
2f76f9da
...
...
@@ -53,6 +53,8 @@ ver 0.20 (not yet released)
- proxy: add TCP keepalive option
* update
- apply .mpdignore matches to subdirectories
* switch the code base to C++14
- GCC 4.9 or clang 3.4 (or newer) recommended
ver 0.19.20 (not yet released)
* decoder
...
...
configure.ac
View file @
2f76f9da
...
...
@@ -186,14 +186,7 @@ dnl ---------------------------------------------------------------------------
dnl Language Checks
dnl ---------------------------------------------------------------------------
AC_CXX_COMPILE_STDCXX_0X
if test "$ax_cv_cxx_compile_cxx0x_native" != yes; then
if test "$ax_cv_cxx_compile_cxx0x_gxx" = yes; then
AM_CXXFLAGS="$AM_CXXFLAGS -std=gnu++0x"
elif test "$ax_cv_cxx_compile_cxx0x_cxx" = yes; then
AM_CXXFLAGS="$AM_CXXFLAGS -std=c++0x"
fi
fi
AX_CXX_COMPILE_STDCXX_14([noext], [mandatory])
dnl ---------------------------------------------------------------------------
dnl Header/Library Checks
...
...
doc/developer.xml
View file @
2f76f9da
...
...
@@ -41,8 +41,8 @@
<listitem>
<para>
the code should be C++11 compliant, and must compile with
<application>
GCC
</application>
4.
7
and
<application>
clang
</application>
3.
2
<application>
GCC
</application>
4.
9
and
<application>
clang
</application>
3.
4
</para>
</listitem>
...
...
m4/ax_cxx_compile_stdcxx.m4
0 → 100644
View file @
2f76f9da
This diff is collapsed.
Click to expand it.
m4/ax_cxx_compile_stdcxx_0x.m4
deleted
100644 → 0
View file @
b0b8f573
# ============================================================================
# http://www.gnu.org/software/autoconf-archive/ax_cxx_compile_stdcxx_0x.html
# ============================================================================
#
# SYNOPSIS
#
# AX_CXX_COMPILE_STDCXX_0X
#
# DESCRIPTION
#
# Check for baseline language coverage in the compiler for the C++0x
# standard.
#
# LICENSE
#
# Copyright (c) 2008 Benjamin Kosnik <bkoz@redhat.com>
#
# Copying and distribution of this file, with or without modification, are
# permitted in any medium without royalty provided the copyright notice
# and this notice are preserved. This file is offered as-is, without any
# warranty.
#serial 8
AU_ALIAS([AC_CXX_COMPILE_STDCXX_0X], [AX_CXX_COMPILE_STDCXX_0X])
AC_DEFUN([AX_CXX_COMPILE_STDCXX_0X], [
AC_CACHE_CHECK(if g++ supports C++0x features without additional flags,
ax_cv_cxx_compile_cxx0x_native,
[AC_LANG_SAVE
AC_LANG_CPLUSPLUS
AC_TRY_COMPILE([
template <typename T>
struct check
{
static_assert(sizeof(int) <= sizeof(T), "not big enough");
};
typedef check<check<bool>> right_angle_brackets;
int a;
decltype(a) b;
typedef check<int> check_type;
check_type c;
check_type&& cr = static_cast<check_type&&>(c);],,
ax_cv_cxx_compile_cxx0x_native=yes, ax_cv_cxx_compile_cxx0x_native=no)
AC_LANG_RESTORE
])
AC_CACHE_CHECK(if g++ supports C++0x features with -std=c++0x,
ax_cv_cxx_compile_cxx0x_cxx,
[AC_LANG_SAVE
AC_LANG_CPLUSPLUS
ac_save_CXXFLAGS="$CXXFLAGS"
CXXFLAGS="$CXXFLAGS -std=c++0x"
AC_TRY_COMPILE([
template <typename T>
struct check
{
static_assert(sizeof(int) <= sizeof(T), "not big enough");
};
typedef check<check<bool>> right_angle_brackets;
int a;
decltype(a) b;
typedef check<int> check_type;
check_type c;
check_type&& cr = static_cast<check_type&&>(c);],,
ax_cv_cxx_compile_cxx0x_cxx=yes, ax_cv_cxx_compile_cxx0x_cxx=no)
CXXFLAGS="$ac_save_CXXFLAGS"
AC_LANG_RESTORE
])
AC_CACHE_CHECK(if g++ supports C++0x features with -std=gnu++0x,
ax_cv_cxx_compile_cxx0x_gxx,
[AC_LANG_SAVE
AC_LANG_CPLUSPLUS
ac_save_CXXFLAGS="$CXXFLAGS"
CXXFLAGS="$CXXFLAGS -std=gnu++0x"
AC_TRY_COMPILE([
template <typename T>
struct check
{
static_assert(sizeof(int) <= sizeof(T), "not big enough");
};
typedef check<check<bool>> right_angle_brackets;
int a;
decltype(a) b;
typedef check<int> check_type;
check_type c;
check_type&& cr = static_cast<check_type&&>(c);],,
ax_cv_cxx_compile_cxx0x_gxx=yes, ax_cv_cxx_compile_cxx0x_gxx=no)
CXXFLAGS="$ac_save_CXXFLAGS"
AC_LANG_RESTORE
])
if test "$ax_cv_cxx_compile_cxx0x_native" = yes ||
test "$ax_cv_cxx_compile_cxx0x_cxx" = yes ||
test "$ax_cv_cxx_compile_cxx0x_gxx" = yes; then
AC_DEFINE(HAVE_STDCXX_0X,,[Define if g++ supports C++0x features. ])
fi
])
m4/ax_cxx_compile_stdcxx_14.m4
0 → 100644
View file @
2f76f9da
# ============================================================================
# http://www.gnu.org/software/autoconf-archive/ax_cxx_compile_stdcxx_14.html
# ============================================================================
#
# SYNOPSIS
#
# AX_CXX_COMPILE_STDCXX_14([ext|noext], [mandatory|optional])
#
# DESCRIPTION
#
# Check for baseline language coverage in the compiler for the C++14
# standard; if necessary, add switches to CXX and CXXCPP to enable
# support.
#
# This macro is a convenience alias for calling the AX_CXX_COMPILE_STDCXX
# macro with the version set to C++14. The two optional arguments are
# forwarded literally as the second and third argument respectively.
# Please see the documentation for the AX_CXX_COMPILE_STDCXX macro for
# more information. If you want to use this macro, you also need to
# download the ax_cxx_compile_stdcxx.m4 file.
#
# LICENSE
#
# Copyright (c) 2015 Moritz Klammler <moritz@klammler.eu>
#
# Copying and distribution of this file, with or without modification, are
# permitted in any medium without royalty provided the copyright notice
# and this notice are preserved. This file is offered as-is, without any
# warranty.
#serial 4
AX_REQUIRE_DEFINED([AX_CXX_COMPILE_STDCXX])
AC_DEFUN([AX_CXX_COMPILE_STDCXX_14], [AX_CXX_COMPILE_STDCXX([14], [$1], [$2])])
src/Chrono.hxx
View file @
2f76f9da
...
...
@@ -20,19 +20,10 @@
#ifndef MPD_CHRONO_HXX
#define MPD_CHRONO_HXX
#include "Compiler.h"
#include <chrono>
#include <utility>
#include <cstdint>
#if GCC_OLDER_THAN(4,7)
/* std::chrono::duration operators are "constexpr" since gcc 4.7 */
#define chrono_constexpr gcc_pure
#else
#define chrono_constexpr constexpr
#endif
/**
* A time stamp within a song. Granularity is 1 millisecond and the
* maximum value is about 49 days.
...
...
@@ -108,11 +99,11 @@ public:
return
count
()
>
0
;
}
c
hrono_c
onstexpr
SongTime
operator
+
(
const
SongTime
&
other
)
const
{
constexpr
SongTime
operator
+
(
const
SongTime
&
other
)
const
{
return
SongTime
(
*
(
const
Base
*
)
this
+
(
const
Base
&
)
other
);
}
c
hrono_c
onstexpr
SongTime
operator
-
(
const
SongTime
&
other
)
const
{
constexpr
SongTime
operator
-
(
const
SongTime
&
other
)
const
{
return
SongTime
(
*
(
const
Base
*
)
this
-
(
const
Base
&
)
other
);
}
};
...
...
@@ -212,15 +203,13 @@ public:
return
count
()
<
0
;
}
c
hrono_c
onstexpr
SignedSongTime
operator
+
(
const
SignedSongTime
&
other
)
const
{
constexpr
SignedSongTime
operator
+
(
const
SignedSongTime
&
other
)
const
{
return
SignedSongTime
(
*
(
const
Base
*
)
this
+
(
const
Base
&
)
other
);
}
c
hrono_c
onstexpr
SignedSongTime
operator
-
(
const
SignedSongTime
&
other
)
const
{
constexpr
SignedSongTime
operator
-
(
const
SignedSongTime
&
other
)
const
{
return
SignedSongTime
(
*
(
const
Base
*
)
this
-
(
const
Base
&
)
other
);
}
};
#undef chrono_constexpr
#endif
src/Compiler.h
View file @
2f76f9da
...
...
@@ -62,8 +62,8 @@
# error Sorry, your clang version is too old. You need at least version 3.1.
# endif
#elif defined(__GNUC__)
# if GCC_OLDER_THAN(4,
7
)
# error Sorry, your gcc version is too old. You need at least version 4.
6
.
# if GCC_OLDER_THAN(4,
9
)
# error Sorry, your gcc version is too old. You need at least version 4.
9
.
# endif
#else
# warning Untested compiler. Use at your own risk!
...
...
@@ -97,8 +97,6 @@
#define gcc_likely(x) __builtin_expect (!!(x), 1)
#define gcc_unlikely(x) __builtin_expect (!!(x), 0)
#define gcc_aligned(n) __attribute__((aligned(n)))
#define gcc_visibility_hidden __attribute__((visibility("hidden")))
#define gcc_visibility_default __attribute__((visibility("default")))
...
...
@@ -126,8 +124,6 @@
#define gcc_likely(x) (x)
#define gcc_unlikely(x) (x)
#define gcc_aligned(n)
#define gcc_visibility_hidden
#define gcc_visibility_default
...
...
@@ -168,17 +164,7 @@
#if defined(__cplusplus)
/* support for C++11 "override" was added in gcc 4.7 */
#if GCC_OLDER_THAN(4,7)
#define override
#define final
#endif
#if CLANG_OR_GCC_VERSION(4,8)
#define gcc_alignas(T, fallback) alignas(T)
#else
#define gcc_alignas(T, fallback) gcc_aligned(fallback)
#endif
#endif
...
...
src/util/Manual.hxx
View file @
2f76f9da
...
...
@@ -35,10 +35,6 @@
#include <new>
#include <utility>
#if GCC_OLDER_THAN(4,8)
#include <type_traits>
#endif
#include <assert.h>
#if CLANG_OR_GCC_VERSION(4,7)
...
...
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