diff --git a/build/clang-plugin/tests/TestCustomHeap.cpp b/build/clang-plugin/tests/TestCustomHeap.cpp index ec2d51ebaf5a5..c1e82f2fa7b5d 100644 --- a/build/clang-plugin/tests/TestCustomHeap.cpp +++ b/build/clang-plugin/tests/TestCustomHeap.cpp @@ -1,9 +1,11 @@ #define MOZ_NONHEAP_CLASS __attribute__((annotate("moz_nonheap_class"))) +#ifndef MOZ_HEAP_ALLOCATOR #define MOZ_HEAP_ALLOCATOR \ _Pragma("GCC diagnostic push") \ _Pragma("GCC diagnostic ignored \"-Wgcc-compat\"") \ __attribute__((annotate("moz_heap_allocator"))) \ _Pragma("GCC diagnostic pop") +#endif #include #include diff --git a/mfbt/Char16.h b/mfbt/Char16.h index 3c2f254aa9dbb..3d129332b43a5 100644 --- a/mfbt/Char16.h +++ b/mfbt/Char16.h @@ -20,6 +20,7 @@ #ifdef WIN32 # define MOZ_USE_CHAR16_WRAPPER # include +# include "mozilla/Attributes.h" /** * Win32 API extensively uses wchar_t, which is represented by a separated * builtin type than char16_t per spec. It's not the case for MSVC prior to @@ -39,13 +40,13 @@ class char16ptr_t "char16_t and wchar_t sizes differ"); public: - char16ptr_t(const char16_t* aPtr) : mPtr(aPtr) {} - char16ptr_t(const wchar_t* aPtr) : + MOZ_IMPLICIT char16ptr_t(const char16_t* aPtr) : mPtr(aPtr) {} + MOZ_IMPLICIT char16ptr_t(const wchar_t* aPtr) : mPtr(reinterpret_cast(aPtr)) {} /* Without this, nullptr assignment would be ambiguous. */ - constexpr char16ptr_t(decltype(nullptr)) : mPtr(nullptr) {} + constexpr MOZ_IMPLICIT char16ptr_t(decltype(nullptr)) : mPtr(nullptr) {} operator const char16_t*() const { @@ -59,7 +60,7 @@ class char16ptr_t { return mPtr; } - operator bool() const + MOZ_IMPLICIT operator bool() const { return mPtr != nullptr; }