Skip to content

Commit 5fa2202

Browse files
committed
Reverted use of tchar.h which should be considered deprecated.
GZDoom is Unicode only - as should be the norm for any Windows application - and will not work when compiled as ANSI so there's no good reason to use this wrapper.
1 parent f5c8681 commit 5fa2202

File tree

3 files changed

+6
-15
lines changed

3 files changed

+6
-15
lines changed

libraries/ZWidget/src/window/win32/win32window.cpp

+4-5
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,6 @@
11

22
#include "win32window.h"
33
#include <windowsx.h>
4-
#include <tchar.h>
54
#include <stdexcept>
65
#include <cmath>
76
#include <vector>
@@ -82,11 +81,11 @@ Win32Window::Win32Window(DisplayWindowHost* windowHost) : WindowHost(windowHost)
8281
Windows.push_front(this);
8382
WindowsIterator = Windows.begin();
8483

85-
WNDCLASSEX classdesc = {};
84+
WNDCLASSEXW classdesc = {};
8685
classdesc.cbSize = sizeof(WNDCLASSEX);
8786
classdesc.hInstance = GetModuleHandle(0);
8887
classdesc.style = CS_VREDRAW | CS_HREDRAW | CS_DBLCLKS;
89-
classdesc.lpszClassName = _T( "ZWidgetWindow" );
88+
classdesc.lpszClassName = L"ZWidgetWindow";
9089
classdesc.lpfnWndProc = &Win32Window::WndProc;
9190
RegisterClassEx(&classdesc);
9291

@@ -95,7 +94,7 @@ Win32Window::Win32Window(DisplayWindowHost* windowHost) : WindowHost(windowHost)
9594
// WS_CAPTION shows the caption (yay! actually a flag that does what it says it does!)
9695
// WS_SYSMENU shows the min/max/close buttons
9796
// WS_THICKFRAME makes the window resizable
98-
CreateWindowEx(WS_EX_APPWINDOW | WS_EX_DLGMODALFRAME, _T( "ZWidgetWindow" ), _T( "" ), WS_OVERLAPPED | WS_CAPTION | WS_SYSMENU | WS_THICKFRAME | WS_MINIMIZEBOX | WS_MAXIMIZEBOX, 0, 0, 100, 100, 0, 0, GetModuleHandle(0), this);
97+
CreateWindowExW(WS_EX_APPWINDOW | WS_EX_DLGMODALFRAME, L"ZWidgetWindow", L"", WS_OVERLAPPED | WS_CAPTION | WS_SYSMENU | WS_THICKFRAME | WS_MINIMIZEBOX | WS_MAXIMIZEBOX, 0, 0, 100, 100, 0, 0, GetModuleHandle(0), this);
9998

10099
/*
101100
RAWINPUTDEVICE rid;
@@ -299,7 +298,7 @@ double Win32Window::GetDpiScale() const
299298
static bool done = false;
300299
if (!done)
301300
{
302-
HMODULE hMod = GetModuleHandle( _T( "User32.dll" ));
301+
HMODULE hMod = GetModuleHandleA("User32.dll");
303302
if (hMod != nullptr) pGetDpiForWindow = reinterpret_cast<GetDpiForWindow_t>(GetProcAddress(hMod, "GetDpiForWindow"));
304303
done = true;
305304
}

src/CMakeLists.txt

+1-8
Original file line numberDiff line numberDiff line change
@@ -69,20 +69,13 @@ if( WIN32 )
6969
setupapi
7070
oleaut32
7171
dbghelp
72-
dxguid
73-
dwmapi
74-
)
75-
76-
if( NOT MINGW )
77-
list( APPEND PROJECT_LIBRARIES legacy_stdio_definitions )
78-
endif()
72+
legacy_stdio_definitions )
7973

8074
if( DEM_CMAKE_COMPILER_IS_GNUCXX_COMPATIBLE )
8175
if( DX_dxguid_LIBRARY )
8276
list( APPEND PROJECT_LIBRARIES "${DX_dxguid_LIBRARY}" )
8377
endif()
8478
endif()
85-
8679
else()
8780
if( APPLE )
8881
set( NO_GTK ON )

src/common/rendering/gl_load/gl_load.c

+1-2
Original file line numberDiff line numberDiff line change
@@ -46,7 +46,6 @@ static void* PosixGetProcAddress (const GLubyte* name)
4646
#undef APIENTRY
4747
#endif
4848
#include <windows.h>
49-
#include <tchar.h>
5049

5150

5251
#ifdef _MSC_VER
@@ -77,7 +76,7 @@ static void CheckOpenGL(void)
7776
{
7877
if (opengl32dll == 0)
7978
{
80-
opengl32dll = LoadLibrary(_T("OpenGL32.DLL"));
79+
opengl32dll = LoadLibraryA("OpenGL32.DLL");
8180
if (opengl32dll != 0)
8281
{
8382
createcontext = (HGLRC(WINAPI*)(HDC)) GetProcAddress(opengl32dll, "wglCreateContext");

0 commit comments

Comments
 (0)