Skip to content

Commit c851d65

Browse files
take care of various deprecateion and format warnings on windows
1 parent a6519ff commit c851d65

4 files changed

Lines changed: 15 additions & 10 deletions

File tree

src/frontend/duckstation/gl/context_wgl.cpp

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -96,7 +96,7 @@ bool ContextWGL::ChangeSurface(const WindowInfo& new_wi)
9696

9797
if (was_current && !wglMakeCurrent(m_dc, m_rc))
9898
{
99-
Log_ErrorPrintf("Failed to make context current again after surface change: 0x%08X", GetLastError());
99+
Log_ErrorPrintf("Failed to make context current again after surface change: 0x%08lX", GetLastError());
100100
return false;
101101
}
102102

@@ -120,7 +120,7 @@ bool ContextWGL::MakeCurrent()
120120
{
121121
if (!wglMakeCurrent(m_dc, m_rc))
122122
{
123-
Log_ErrorPrintf("wglMakeCurrent() failed: 0x%08X", GetLastError());
123+
Log_ErrorPrintf("wglMakeCurrent() failed: 0x%08lX", GetLastError());
124124
return false;
125125
}
126126

@@ -185,7 +185,7 @@ HDC ContextWGL::GetDCAndSetPixelFormat(HWND hwnd)
185185
HDC hDC = ::GetDC(hwnd);
186186
if (!hDC)
187187
{
188-
Log_ErrorPrintf("GetDC() failed: 0x%08X", GetLastError());
188+
Log_ErrorPrintf("GetDC() failed: 0x%08lX", GetLastError());
189189
return {};
190190
}
191191

@@ -194,7 +194,7 @@ HDC ContextWGL::GetDCAndSetPixelFormat(HWND hwnd)
194194
const int pf = ChoosePixelFormat(hDC, &pfd);
195195
if (pf == 0)
196196
{
197-
Log_ErrorPrintf("ChoosePixelFormat() failed: 0x%08X", GetLastError());
197+
Log_ErrorPrintf("ChoosePixelFormat() failed: 0x%08lX", GetLastError());
198198
::ReleaseDC(hwnd, hDC);
199199
return {};
200200
}
@@ -204,7 +204,7 @@ HDC ContextWGL::GetDCAndSetPixelFormat(HWND hwnd)
204204

205205
if (!SetPixelFormat(hDC, m_pixel_format.value(), &pfd))
206206
{
207-
Log_ErrorPrintf("SetPixelFormat() failed: 0x%08X", GetLastError());
207+
Log_ErrorPrintf("SetPixelFormat() failed: 0x%08lX", GetLastError());
208208
::ReleaseDC(hwnd, hDC);
209209
return {};
210210
}
@@ -338,15 +338,15 @@ bool ContextWGL::CreateAnyContext(HGLRC share_context, bool make_current)
338338
m_rc = wglCreateContext(m_dc);
339339
if (!m_rc)
340340
{
341-
Log_ErrorPrintf("wglCreateContext() failed: 0x%08X", GetLastError());
341+
Log_ErrorPrintf("wglCreateContext() failed: 0x%08lX", GetLastError());
342342
return false;
343343
}
344344

345345
if (make_current)
346346
{
347347
if (!wglMakeCurrent(m_dc, m_rc))
348348
{
349-
Log_ErrorPrintf("wglMakeCurrent() failed: 0x%08X", GetLastError());
349+
Log_ErrorPrintf("wglMakeCurrent() failed: 0x%08lX", GetLastError());
350350
return false;
351351
}
352352

@@ -360,7 +360,7 @@ bool ContextWGL::CreateAnyContext(HGLRC share_context, bool make_current)
360360

361361
if (share_context && !wglShareLists(share_context, m_rc))
362362
{
363-
Log_ErrorPrintf("wglShareLists() failed: 0x%08X", GetLastError());
363+
Log_ErrorPrintf("wglShareLists() failed: 0x%08lX", GetLastError());
364364
return false;
365365
}
366366

@@ -432,7 +432,7 @@ bool ContextWGL::CreateVersionContext(const Version& version, HGLRC share_contex
432432
{
433433
if (!wglMakeCurrent(m_dc, make_current ? new_rc : nullptr))
434434
{
435-
Log_ErrorPrintf("wglMakeCurrent() failed: 0x%08X", GetLastError());
435+
Log_ErrorPrintf("wglMakeCurrent() failed: 0x%08lX", GetLastError());
436436
wglDeleteContext(new_rc);
437437
return false;
438438
}

src/net/Netplay.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -441,7 +441,7 @@ printf("[MC] start blob type=%d len=%d\n", type, len);
441441
u8* dst = Blobs[type];
442442
if (!dst) return;
443443
if (BlobLens[type] != len) return;
444-
printf("[MC] recv blob data, type=%d pos=%08X len=%08X data=%08lX\n", type, pos, len, pkt->dataLength-16);
444+
printf("[MC] recv blob data, type=%d pos=%08X len=%08X data=%08zX\n", type, pos, len, pkt->dataLength-16);
445445
memcpy(&dst[pos], &buf[16], pkt->dataLength-16);
446446
}
447447
else if (buf[0] == 0x03)

src/net/libslirp/CMakeLists.txt

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -58,6 +58,7 @@ target_compile_definitions(slirp PRIVATE "G_LOG_DOMAIN=\"Slirp\"")
5858

5959
if (WIN32)
6060
target_link_libraries(slirp PRIVATE ws2_32 iphlpapi)
61+
target_compile_definitions(slirp PRIVATE -D_WINSOCK_DEPRECATED_NO_WARNINGS)
6162
elseif(HAIKU)
6263
target_Link_libraries(slirp PRIVATE network)
6364
elseif(APPLE)

src/net/libslirp/glib/glib.h

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,10 @@
1515
#include <io.h>
1616
#define open _open
1717
#define close _close
18+
#define strdup _strdup
19+
#define lseek _lseek
20+
#define read _read
21+
#define stricmp _stricmp
1822
typedef ptrdiff_t ssize_t;
1923
#endif
2024

0 commit comments

Comments
 (0)