[tbb-commits] [tor-browser/tor-browser-31.2.0esr-4.5-1] Bug 13558: Allow download folder change on Win XP.
mikeperry at torproject.org
mikeperry at torproject.org
Fri Nov 7 07:38:20 UTC 2014
commit 6f12ba342e64dddd3b27b6f358b17dfd7345c1bd
Author: Georg Koppen <gk at torproject.org>
Date: Wed Nov 5 13:32:03 2014 +0000
Bug 13558: Allow download folder change on Win XP.
Changing the download folder on Win XP was crashing due to a mingw-w64
related Firefox bug. This is the backport of the fix provided in
https://bugzilla.mozilla.org/show_bug.cgi?id=1091594. Thanks to Jacek
Caban for the help.
---
mfbt/Char16.h | 37 +++++++++++++++++++++++++++++++++++--
1 file changed, 35 insertions(+), 2 deletions(-)
diff --git a/mfbt/Char16.h b/mfbt/Char16.h
index 7bcd008..3f03653 100644
--- a/mfbt/Char16.h
+++ b/mfbt/Char16.h
@@ -95,6 +95,24 @@ class char16ptr_t
explicit operator wchar_t*() const {
return const_cast<wchar_t*>(static_cast<const wchar_t*>(*this));
}
+ explicit operator int() const {
+ return reinterpret_cast<intptr_t>(ptr);
+ }
+ explicit operator unsigned int() const {
+ return reinterpret_cast<uintptr_t>(ptr);
+ }
+ explicit operator long() const {
+ return reinterpret_cast<intptr_t>(ptr);
+ }
+ explicit operator unsigned long() const {
+ return reinterpret_cast<uintptr_t>(ptr);
+ }
+ explicit operator long long() const {
+ return reinterpret_cast<intptr_t>(ptr);
+ }
+ explicit operator unsigned long long() const {
+ return reinterpret_cast<uintptr_t>(ptr);
+ }
/**
* Some Windows API calls accept BYTE* but require that data actually be WCHAR*.
@@ -130,8 +148,23 @@ class char16ptr_t
bool operator!=(decltype(nullptr)) const {
return ptr != nullptr;
}
- char16ptr_t operator+(size_t add) const {
- return char16ptr_t(ptr + add);
+ char16ptr_t operator+(int aValue) const {
+ return char16ptr_t(ptr + aValue);
+ }
+ char16ptr_t operator+(unsigned int aValue) const {
+ return char16ptr_t(ptr + aValue);
+ }
+ char16ptr_t operator+(long aValue) const {
+ return char16ptr_t(ptr + aValue);
+ }
+ char16ptr_t operator+(unsigned long aValue) const {
+ return char16ptr_t(ptr + aValue);
+ }
+ char16ptr_t operator+(long long aValue) const {
+ return char16ptr_t(ptr + aValue);
+ }
+ char16ptr_t operator+(unsigned long long aValue) const {
+ return char16ptr_t(ptr + aValue);
}
ptrdiff_t operator-(const char16ptr_t &other) const {
return ptr - other.ptr;
More information about the tbb-commits
mailing list