mirror of
https://github.com/holub/mame
synced 2025-06-05 12:26:35 +03:00
Fixing issue compiling on GCC 4.9 till 5.1 (nw)
This commit is contained in:
parent
424ea5d9d8
commit
626a13ae1a
65
3rdparty/compat_cpp14.h
vendored
Normal file
65
3rdparty/compat_cpp14.h
vendored
Normal file
@ -0,0 +1,65 @@
|
||||
// Ville Voutilainen code from include/bits/range_access.h from libstdc++
|
||||
|
||||
#if defined(__GNUC__) && ((__GNUC__ == 5 && __GNUC_MINOR__ < 2) || (__GNUC__ == 4 && __GNUC_MINOR__ > 8))
|
||||
|
||||
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); }
|
||||
|
||||
template<class _Container>
|
||||
inline auto
|
||||
rbegin(_Container& __cont) -> decltype(__cont.rbegin())
|
||||
{ return __cont.rbegin(); }
|
||||
|
||||
template<class _Container>
|
||||
inline auto
|
||||
rbegin(const _Container& __cont) -> decltype(__cont.rbegin())
|
||||
{ return __cont.rbegin(); }
|
||||
|
||||
template<class _Container>
|
||||
inline auto
|
||||
rend(_Container& __cont) -> decltype(__cont.rend())
|
||||
{ return __cont.rend(); }
|
||||
|
||||
template<class _Container>
|
||||
inline auto
|
||||
rend(const _Container& __cont) -> decltype(__cont.rend())
|
||||
{ return __cont.rend(); }
|
||||
|
||||
template<class _Tp, size_t _Nm>
|
||||
inline reverse_iterator<_Tp*>
|
||||
rbegin(_Tp (&__arr)[_Nm])
|
||||
{ return reverse_iterator<_Tp*>(__arr + _Nm); }
|
||||
|
||||
template<class _Tp, size_t _Nm>
|
||||
inline reverse_iterator<_Tp*>
|
||||
rend(_Tp (&__arr)[_Nm])
|
||||
{ return reverse_iterator<_Tp*>(__arr); }
|
||||
|
||||
template<class _Tp>
|
||||
inline reverse_iterator<const _Tp*>
|
||||
rbegin(initializer_list<_Tp> __il)
|
||||
{ return reverse_iterator<const _Tp*>(__il.end()); }
|
||||
|
||||
template<class _Tp>
|
||||
inline reverse_iterator<const _Tp*>
|
||||
rend(initializer_list<_Tp> __il)
|
||||
{ return reverse_iterator<const _Tp*>(__il.begin()); }
|
||||
|
||||
template<class _Container>
|
||||
inline auto
|
||||
crbegin(const _Container& __cont) -> decltype(std::rbegin(__cont))
|
||||
{ return std::rbegin(__cont); }
|
||||
|
||||
template<class _Container>
|
||||
inline auto
|
||||
crend(const _Container& __cont) -> decltype(std::rend(__cont))
|
||||
{ return std::rend(__cont); }
|
||||
|
||||
#endif
|
@ -217,6 +217,7 @@ project ("ocore_" .. _OPTIONS["osd"])
|
||||
dofile("windows_cfg.lua")
|
||||
|
||||
includedirs {
|
||||
MAME_DIR .. "3rdparty",
|
||||
MAME_DIR .. "src/emu",
|
||||
MAME_DIR .. "src/osd",
|
||||
MAME_DIR .. "src/lib",
|
||||
|
@ -25,6 +25,8 @@
|
||||
#include <unordered_map>
|
||||
#include <unordered_set>
|
||||
|
||||
#include "compat_cpp14.h"
|
||||
|
||||
// core emulator headers -- must be first
|
||||
#include "emucore.h"
|
||||
#include "eminline.h"
|
||||
|
Loading…
Reference in New Issue
Block a user