mirror of
https://github.com/glfw/glfw.git
synced 2025-06-15 20:22:15 +00:00
fix C89 forbidden mixed declarations
This commit is contained in:
parent
5ddb905a6a
commit
3c44229af8
@ -1464,11 +1464,14 @@ void _glfwPlatformDestroyWindow(_GLFWwindow* window)
|
||||
|
||||
char* _glfwPlatformGetWindowTitle(_GLFWwindow* window)
|
||||
{
|
||||
int count = GetWindowTextLengthW(window->win32.handle);
|
||||
int count;
|
||||
SetLastError(0);
|
||||
|
||||
count = GetWindowTextLengthW(window->win32.handle);
|
||||
if(count == 0)
|
||||
{
|
||||
SetLastError(0);
|
||||
int error = GetLastError();
|
||||
int error;
|
||||
error = GetLastError();
|
||||
|
||||
if(error != 0)
|
||||
{
|
||||
@ -1481,11 +1484,14 @@ char* _glfwPlatformGetWindowTitle(_GLFWwindow* window)
|
||||
}
|
||||
else
|
||||
{
|
||||
WCHAR* wideTitle;
|
||||
char* title;
|
||||
count += 1; // the \0
|
||||
WCHAR* wideTitle = calloc(count, sizeof(WCHAR));
|
||||
|
||||
wideTitle = calloc(count, sizeof(WCHAR));
|
||||
GetWindowTextW(window->win32.handle, wideTitle, count);
|
||||
|
||||
char* title = _glfwCreateUTF8FromWideStringWin32(wideTitle);
|
||||
title = _glfwCreateUTF8FromWideStringWin32(wideTitle);
|
||||
if(!title)
|
||||
return calloc(1, sizeof(char)); // single \0
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user