Bug 1250196 - Part 1: Import mozilla::Forward and mozilla::UniqePtr into the std namespace in a way that is compatible with libc++; r=lsalzman

This commit is contained in:
Ehsan Akhgari 2016-02-22 11:53:59 -05:00
parent c048c0b00d
commit 195eeef0a1
2 changed files with 19 additions and 1 deletions

View File

@ -32,10 +32,23 @@
#include "mozilla/Function.h"
#endif
namespace std {
// In libc++, symbols such as std::forward may be defined in std::__1.
// The _LIBCPP_BEGIN_NAMESPACE_STD and _LIBCPP_END_NAMESPACE_STD macros
// will expand to the correct namespace.
#ifdef _LIBCPP_BEGIN_NAMESPACE_STD
#define MOZ_BEGIN_STD_NAMESPACE _LIBCPP_BEGIN_NAMESPACE_STD
#define MOZ_END_STD_NAMESPACE _LIBCPP_END_NAMESPACE_STD
#else
#define MOZ_BEGIN_STD_NAMESPACE namespace std {
#define MOZ_END_STD_NAMESPACE }
#endif
MOZ_BEGIN_STD_NAMESPACE
using mozilla::Forward;
#define forward Forward
MOZ_END_STD_NAMESPACE
namespace std {
#if SKIA_IMPLEMENTATION
using mozilla::IntegralConstant;
using mozilla::IsEmpty;

View File

@ -15,6 +15,11 @@
#ifdef MOZ_SKIA
#include "mozilla/UniquePtr.h"
namespace std {
using mozilla::DefaultDelete;
using mozilla::UniquePtr;
}
namespace skstd {
using mozilla::DefaultDelete;
using mozilla::UniquePtr;