diff --git a/dtool/src/dtoolbase/dtoolbase_cc.h b/dtool/src/dtoolbase/dtoolbase_cc.h index eb99381c01..eb7afc9048 100644 --- a/dtool/src/dtoolbase/dtoolbase_cc.h +++ b/dtool/src/dtoolbase/dtoolbase_cc.h @@ -75,6 +75,7 @@ typedef int ios_seekdir; #endif #include +#include #ifdef HAVE_NAMESPACE using namespace std; @@ -114,6 +115,18 @@ typedef ios::iostate ios_iostate; typedef ios::seekdir ios_seekdir; #endif +// Apple has an outdated libstdc++. Not all is lost, though, as we can fill +// in some important missing functions. +#if defined(__GLIBCXX__) && __GLIBCXX__ <= 20070719 +template struct remove_reference {typedef T type;}; +template struct remove_reference {typedef T type;}; +template struct remove_reference{typedef T type;}; + +template typename remove_reference::type &&move(T &&t) { + return static_cast::type&&>(t); +} +#endif + #ifdef _MSC_VER #define ALWAYS_INLINE __forceinline #elif defined(__GNUC__) @@ -153,7 +166,7 @@ typedef ios::seekdir ios_seekdir; #elif defined(__GNUC__) && (__cplusplus >= 201103L) // GCC // GCC defines several macros which we can query. List of all supported -// builtin macros: https:gcc.gnu.orgprojectscxx0x.html +// builtin macros: https://gcc.gnu.org/projects/cxx-status.html # if __cpp_constexpr >= 200704 # define CONSTEXPR constexpr # endif