Merge pull request #25959 from neo1973/TagLib_deprecation_warnings
[xbmc.git] / lib / libUPnP / patches / 0042-platinum-switch-build-to-unicode.patch
blobda4375661ca0930966ca3a7709384a894f952deb
1 diff --git a/lib/libUPnP/Neptune/Source/System/Win32/NptWin32Console.cpp b/lib/libUPnP/Neptune/Source/System/Win32/NptWin32Console.cpp
2 index 59ac92e..e897f8a 100644
3 --- a/lib/libUPnP/Neptune/Source/System/Win32/NptWin32Console.cpp
4 +++ b/lib/libUPnP/Neptune/Source/System/Win32/NptWin32Console.cpp
5 @@ -15,6 +15,7 @@
7 #include "NptConfig.h"
8 #include "NptConsole.h"
9 +#include "NptDebug.h"
11 /*----------------------------------------------------------------------
12 | NPT_Console::Output
13 @@ -22,7 +23,7 @@
14 void
15 NPT_Console::Output(const char* message)
17 - OutputDebugString(message);
18 + NPT_DebugOutput(message);
19 printf("%s", message);
22 diff --git a/lib/libUPnP/Neptune/Source/System/Win32/NptWin32Debug.cpp b/lib/libUPnP/Neptune/Source/System/Win32/NptWin32Debug.cpp
23 index c5b157d..5d9372a 100644
24 --- a/lib/libUPnP/Neptune/Source/System/Win32/NptWin32Debug.cpp
25 +++ b/lib/libUPnP/Neptune/Source/System/Win32/NptWin32Debug.cpp
26 @@ -11,16 +11,13 @@
27 | includes
28 +---------------------------------------------------------------------*/
29 #include <stdio.h>
30 -#if defined(_XBOX)
31 -#include <xtl.h>
32 -#else
33 #include <windows.h>
34 -#endif
36 #include "NptConfig.h"
37 #include "NptDefs.h"
38 #include "NptTypes.h"
39 #include "NptDebug.h"
40 +#include <memory>
42 /*----------------------------------------------------------------------
43 | NPT_DebugOutput
44 @@ -28,9 +25,16 @@
45 void
46 NPT_DebugOutput(const char* message)
48 -#if !defined(_WIN32_WCE)
49 - OutputDebugString(message);
50 -#endif
51 - printf("%s", message);
52 + int result = MultiByteToWideChar(CP_UTF8, MB_ERR_INVALID_CHARS, message, -1, nullptr, 0);
53 + if (result == 0)
54 + return;
56 + auto newStr = std::make_unique<wchar_t[]>(result + 1);
57 + result = MultiByteToWideChar(CP_UTF8, MB_ERR_INVALID_CHARS, message, result, newStr.get(), result);
59 + if (result == 0)
60 + return;
62 + OutputDebugString(newStr.get());
65 diff --git a/lib/libUPnP/Neptune/Source/System/Win32/NptWin32SerialPort.cpp b/lib/libUPnP/Neptune/Source/System/Win32/NptWin32SerialPort.cpp
66 index 8edd0ff..9428648 100644
67 --- a/lib/libUPnP/Neptune/Source/System/Win32/NptWin32SerialPort.cpp
68 +++ b/lib/libUPnP/Neptune/Source/System/Win32/NptWin32SerialPort.cpp
69 @@ -207,6 +207,8 @@ NPT_Win32SerialPort::Open(unsigned int speed,
70 NPT_SerialPortFlowControl flow_control,
71 NPT_SerialPortParity parity)
73 + return NPT_FAILURE; // We don't need serial port suppurt
74 +#if 0
75 // check if we're already open
76 if (!m_HandleReference.IsNull()) {
77 return NPT_ERROR_SERIAL_PORT_ALREADY_OPEN;
78 @@ -278,6 +280,7 @@ NPT_Win32SerialPort::Open(unsigned int speed,
79 m_HandleReference = new NPT_Win32HandleWrapper(handle);
81 return NPT_SUCCESS;
82 +#endif
85 /*----------------------------------------------------------------------