diff options
author | Ehsan Akhgari <[email protected]> | 2016-04-18 17:04:30 -0400 |
---|---|---|
committer | Ehsan Akhgari <[email protected]> | 2016-04-18 17:04:30 -0400 |
commit | ebc27b2281b09ff828241eb91f0a4afb1b25064e (patch) | |
tree | d283a7b22677d2884a34b01a3299f9f315219ec3 /src/cubeb_resampler_internal.h | |
parent | 1eb2966b69d3cef6550cd7de8b45ec1a24cb9548 (diff) | |
download | cubeb-ebc27b2281b09ff828241eb91f0a4afb1b25064e.tar.gz cubeb-ebc27b2281b09ff828241eb91f0a4afb1b25064e.zip |
Make the unique_ptr replacment technique compatible with libc++
Diffstat (limited to 'src/cubeb_resampler_internal.h')
-rw-r--r-- | src/cubeb_resampler_internal.h | 15 |
1 files changed, 12 insertions, 3 deletions
diff --git a/src/cubeb_resampler_internal.h b/src/cubeb_resampler_internal.h index 0a93adb..8f8d6dc 100644 --- a/src/cubeb_resampler_internal.h +++ b/src/cubeb_resampler_internal.h @@ -14,13 +14,22 @@ #include <memory> #ifdef CUBEB_GECKO_BUILD #include "mozilla/UniquePtr.h" -namespace std -{ +// In libc++, symbols such as std::unique_ptr 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::DefaultDelete; using mozilla::UniquePtr; #define default_delete DefaultDelete #define unique_ptr UniquePtr -} +MOZ_END_STD_NAMESPACE #endif #include "cubeb/cubeb.h" #include "cubeb_utils.h" |