summaryrefslogtreecommitdiff
path: root/Ports/llvm/patches/remove-wstring.patch
diff options
context:
space:
mode:
Diffstat (limited to 'Ports/llvm/patches/remove-wstring.patch')
-rw-r--r--Ports/llvm/patches/remove-wstring.patch69
1 files changed, 69 insertions, 0 deletions
diff --git a/Ports/llvm/patches/remove-wstring.patch b/Ports/llvm/patches/remove-wstring.patch
new file mode 100644
index 0000000000..b40d849120
--- /dev/null
+++ b/Ports/llvm/patches/remove-wstring.patch
@@ -0,0 +1,69 @@
+diff -ruN llvm-orig/llvm-project-llvmorg-12.0.0/llvm/include/llvm/Support/SwapByteOrder.h llvm-project-llvmorg-12.0.0/llvm/include/llvm/Support/SwapByteOrder.h
+--- llvm-orig/llvm-project-llvmorg-12.0.0/llvm/include/llvm/Support/SwapByteOrder.h 2021-04-06 19:38:18.000000000 +0300
++++ llvm-project-llvmorg-12.0.0/llvm/include/llvm/Support/SwapByteOrder.h 2021-06-09 16:00:20.111549941 +0300
+@@ -22,7 +22,7 @@
+ #endif
+
+ #if defined(__linux__) || defined(__GNU__) || defined(__HAIKU__) || \
+- defined(__Fuchsia__) || defined(__EMSCRIPTEN__)
++ defined(__Fuchsia__) || defined(__EMSCRIPTEN__) || defined(__serenity__)
+ #include <endian.h>
+ #elif defined(_AIX)
+ #include <sys/machine.h>
+diff -ruN llvm-orig/llvm-project-llvmorg-12.0.0/llvm/include/llvm/Support/ConvertUTF.h llvm-project-llvmorg-12.0.0/llvm/include/llvm/Support/ConvertUTF.h
+--- llvm-orig/llvm-project-llvmorg-12.0.0/llvm/include/llvm/Support/ConvertUTF.h 2021-04-06 19:38:18.000000000 +0300
++++ llvm-project-llvmorg-12.0.0/llvm/include/llvm/Support/ConvertUTF.h 2021-06-09 16:04:10.069288846 +0300
+@@ -200,19 +200,19 @@
+ * Converts a UTF-8 StringRef to a std::wstring.
+ * \return true on success.
+ */
+-bool ConvertUTF8toWide(llvm::StringRef Source, std::wstring &Result);
++bool ConvertUTF8toWide(llvm::StringRef Source, std::string &Result);
+
+ /**
+ * Converts a UTF-8 C-string to a std::wstring.
+ * \return true on success.
+ */
+-bool ConvertUTF8toWide(const char *Source, std::wstring &Result);
++bool ConvertUTF8toWide(const char *Source, std::string &Result);
+
+ /**
+ * Converts a std::wstring to a UTF-8 encoded std::string.
+ * \return true on success.
+ */
+-bool convertWideToUTF8(const std::wstring &Source, std::string &Result);
++bool convertWideToUTF8(const std::string &Source, std::string &Result);
+
+
+ /**
+diff -ruN llvm-orig/llvm-project-llvmorg-12.0.0/llvm/lib/Support/ConvertUTFWrapper.cpp llvm-project-llvmorg-12.0.0/llvm/lib/Support/ConvertUTFWrapper.cpp
+--- llvm-orig/llvm-project-llvmorg-12.0.0/llvm/lib/Support/ConvertUTFWrapper.cpp 2021-04-06 19:38:18.000000000 +0300
++++ llvm-project-llvmorg-12.0.0/llvm/lib/Support/ConvertUTFWrapper.cpp 2021-06-09 16:15:53.330400711 +0300
+@@ -196,15 +196,15 @@
+ Result.clear();
+ return false;
+ }
+- Result.resize(reinterpret_cast<wchar_t *>(ResultPtr) - &Result[0]);
++ Result.resize(reinterpret_cast<char *>(ResultPtr) - &Result[0]);
+ return true;
+ }
+
+-bool ConvertUTF8toWide(llvm::StringRef Source, std::wstring &Result) {
++bool ConvertUTF8toWide(llvm::StringRef Source, std::string &Result) {
+ return ConvertUTF8toWideInternal(Source, Result);
+ }
+
+-bool ConvertUTF8toWide(const char *Source, std::wstring &Result) {
++bool ConvertUTF8toWide(const char *Source, std::string &Result) {
+ if (!Source) {
+ Result.clear();
+ return true;
+@@ -212,7 +212,7 @@
+ return ConvertUTF8toWide(llvm::StringRef(Source), Result);
+ }
+
+-bool convertWideToUTF8(const std::wstring &Source, std::string &Result) {
++bool convertWideToUTF8(const std::string &Source, std::string &Result) {
+ if (sizeof(wchar_t) == 1) {
+ const UTF8 *Start = reinterpret_cast<const UTF8 *>(Source.data());
+ const UTF8 *End =