mirror of
https://github.com/glfw/glfw.git
synced 2025-10-02 21:00:57 +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)
|
char* _glfwPlatformGetWindowTitle(_GLFWwindow* window)
|
||||||
{
|
{
|
||||||
int count = GetWindowTextLengthW(window->win32.handle);
|
int count;
|
||||||
|
SetLastError(0);
|
||||||
|
|
||||||
|
count = GetWindowTextLengthW(window->win32.handle);
|
||||||
if(count == 0)
|
if(count == 0)
|
||||||
{
|
{
|
||||||
SetLastError(0);
|
int error;
|
||||||
int error = GetLastError();
|
error = GetLastError();
|
||||||
|
|
||||||
if(error != 0)
|
if(error != 0)
|
||||||
{
|
{
|
||||||
@ -1481,11 +1484,14 @@ char* _glfwPlatformGetWindowTitle(_GLFWwindow* window)
|
|||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
|
WCHAR* wideTitle;
|
||||||
|
char* title;
|
||||||
count += 1; // the \0
|
count += 1; // the \0
|
||||||
WCHAR* wideTitle = calloc(count, sizeof(WCHAR));
|
|
||||||
|
wideTitle = calloc(count, sizeof(WCHAR));
|
||||||
GetWindowTextW(window->win32.handle, wideTitle, count);
|
GetWindowTextW(window->win32.handle, wideTitle, count);
|
||||||
|
|
||||||
char* title = _glfwCreateUTF8FromWideStringWin32(wideTitle);
|
title = _glfwCreateUTF8FromWideStringWin32(wideTitle);
|
||||||
if(!title)
|
if(!title)
|
||||||
return calloc(1, sizeof(char)); // single \0
|
return calloc(1, sizeof(char)); // single \0
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user