mirror of
https://github.com/mozilla/gecko-dev.git
synced 2025-02-05 13:45:46 +00:00
Bug 1189967 - Avoid including <string> from Char16.h. r=nfroyd
Since Char16.h is included everywhere, and MSVC 2015 uses the char16ptr_t trick it contains, we include <string> everywhere, but that has the side effect of breaking the build in subtle ways. One way around this would be to avoid including Char16.h in the first place, but that requires more work than I was ready to put in. So instead, just avoid including <string> by removing the conversion operator for std::wstring.
This commit is contained in:
parent
8d4c5b336d
commit
672db6ba31
@ -49,7 +49,7 @@ typedef unsigned int char32_t;
|
||||
#endif
|
||||
|
||||
#ifdef MOZ_USE_CHAR16_WRAPPER
|
||||
# include <string>
|
||||
# include <cstdint>
|
||||
/**
|
||||
* 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
|
||||
@ -93,10 +93,6 @@ public:
|
||||
{
|
||||
return mPtr != nullptr;
|
||||
}
|
||||
operator std::wstring() const
|
||||
{
|
||||
return std::wstring(static_cast<const wchar_t*>(*this));
|
||||
}
|
||||
|
||||
/* Explicit cast operators to allow things like (char16_t*)str. */
|
||||
explicit operator char16_t*() const
|
||||
|
@ -7,6 +7,11 @@
|
||||
#include "mozilla/Compression.h"
|
||||
#include "mozilla/CheckedInt.h"
|
||||
|
||||
// Without including <string>, MSVC 2015 complains about e.g. the impossibility
|
||||
// to convert `const void* const` to `void*` when calling memchr from
|
||||
// corecrt_memory.h.
|
||||
#include <string>
|
||||
|
||||
using namespace mozilla::Compression;
|
||||
|
||||
namespace {
|
||||
|
Loading…
x
Reference in New Issue
Block a user