summaryrefslogtreecommitdiffstatshomepage
diff options
context:
space:
mode:
author Vas Crabb <vas@vastheman.com>2016-06-24 19:56:50 +1000
committer Vas Crabb <vas@vastheman.com>2016-06-24 19:56:50 +1000
commit15f02da7bd96175523810b3e44e8502f730cb4f7 (patch)
tree928afd55818811ac0744c10cfba7347c3d2a7d1f
parent5ece80fe5d693a022e4584f5f9c6dd57d3802a24 (diff)
Improved workaround for missing cbegin/cend in glibstdc++ [Alex Miller]
-rw-r--r--src/lib/util/strformat.h30
-rw-r--r--src/lib/util/vecstream.h6
2 files changed, 18 insertions, 18 deletions
diff --git a/src/lib/util/strformat.h b/src/lib/util/strformat.h
index 975f3f39de5..7fb41c1d52b 100644
--- a/src/lib/util/strformat.h
+++ b/src/lib/util/strformat.h
@@ -168,8 +168,8 @@
#pragma once
-#ifndef __MAME_UTIL_STRFORMAT_H__
-#define __MAME_UTIL_STRFORMAT_H__
+#ifndef MAME_UTIL_STRFORMAT_H
+#define MAME_UTIL_STRFORMAT_H
#include <algorithm>
#include <array>
@@ -185,18 +185,18 @@
#include <type_traits>
#include <utility>
-#if defined(__GLIBCXX__) && (__GLIBCXX__ < 20150413)
-namespace std
-{
-template<class _Container>
- inline constexpr auto
- cbegin(const _Container& __cont) noexcept(noexcept(std::begin(__cont)))-> decltype(std::begin(__cont))
- { return std::begin(__cont); }
-
-template<class _Container>
- inline constexpr auto
- cend(const _Container& __cont) noexcept(noexcept(std::end(__cont)))-> decltype(std::end(__cont))
- { return std::end(__cont); }
+#if defined(__GLIBCXX__)
+namespace std {
+namespace mame_cxx14_compat {
+template <typename T>
+inline constexpr auto cbegin(const T& cont) noexcept(noexcept(std::begin(cont))) -> decltype(std::begin(cont))
+{ return std::begin(cont); }
+
+template <typename T>
+inline constexpr auto cend(const T& cont) noexcept(noexcept(std::end(cont))) -> decltype(std::end(cont))
+{ return std::end(cont); }
+}
+using namespace mame_cxx14_compat;
}
#endif
@@ -1746,4 +1746,4 @@ using detail::make_format_argument_pack;
using util::string_format;
-#endif // __MAME_UTIL_STRFORMAT_H__
+#endif // MAME_UTIL_STRFORMAT_H
diff --git a/src/lib/util/vecstream.h b/src/lib/util/vecstream.h
index 4491c1d61b7..aaf0e84e61b 100644
--- a/src/lib/util/vecstream.h
+++ b/src/lib/util/vecstream.h
@@ -14,8 +14,8 @@
***************************************************************************/
-#ifndef __MAME_UTIL_VECSTREAM_H__
-#define __MAME_UTIL_VECSTREAM_H__
+#ifndef MAME_UTIL_VECSTREAM_H
+#define MAME_UTIL_VECSTREAM_H
#include <algorithm>
#include <cassert>
@@ -395,4 +395,4 @@ void swap(basic_vectorstream<CharT, Traits, Allocator> &a, basic_vectorstream<Ch
} // namespace util
-#endif // __MAME_UTIL_VECSTREAM_H__
+#endif // MAME_UTIL_VECSTREAM_H