mirror of
https://github.com/panda3d/panda3d.git
synced 2025-10-03 10:22:45 -04:00
C++11 polyfills. This should fix Snow Leopard build.
This commit is contained in:
parent
53752bd376
commit
816b2ac3ba
@ -75,6 +75,7 @@ typedef int ios_seekdir;
|
|||||||
#endif
|
#endif
|
||||||
|
|
||||||
#include <string>
|
#include <string>
|
||||||
|
#include <utility>
|
||||||
|
|
||||||
#ifdef HAVE_NAMESPACE
|
#ifdef HAVE_NAMESPACE
|
||||||
using namespace std;
|
using namespace std;
|
||||||
@ -114,6 +115,18 @@ typedef ios::iostate ios_iostate;
|
|||||||
typedef ios::seekdir ios_seekdir;
|
typedef ios::seekdir ios_seekdir;
|
||||||
#endif
|
#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<class T> struct remove_reference {typedef T type;};
|
||||||
|
template<class T> struct remove_reference<T&> {typedef T type;};
|
||||||
|
template<class T> struct remove_reference<T&& >{typedef T type;};
|
||||||
|
|
||||||
|
template<class T> typename remove_reference<T>::type &&move(T &&t) {
|
||||||
|
return static_cast<typename remove_reference<T>::type&&>(t);
|
||||||
|
}
|
||||||
|
#endif
|
||||||
|
|
||||||
#ifdef _MSC_VER
|
#ifdef _MSC_VER
|
||||||
#define ALWAYS_INLINE __forceinline
|
#define ALWAYS_INLINE __forceinline
|
||||||
#elif defined(__GNUC__)
|
#elif defined(__GNUC__)
|
||||||
@ -153,7 +166,7 @@ typedef ios::seekdir ios_seekdir;
|
|||||||
#elif defined(__GNUC__) && (__cplusplus >= 201103L) // GCC
|
#elif defined(__GNUC__) && (__cplusplus >= 201103L) // GCC
|
||||||
|
|
||||||
// GCC defines several macros which we can query. List of all supported
|
// 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
|
# if __cpp_constexpr >= 200704
|
||||||
# define CONSTEXPR constexpr
|
# define CONSTEXPR constexpr
|
||||||
# endif
|
# endif
|
||||||
|
Loading…
x
Reference in New Issue
Block a user