commit e6a12a65188a267ffc476e2a6cfb5a41240afe6e
Author: Roman Fomin <rfomin@gmail.com>
AuthorDate: Wed Sep 11 21:07:31 2024 +0700
Commit: Roman Fomin <rfomin@gmail.com>
CommitDate: Wed Sep 11 21:07:31 2024 +0700
Fix "mixing declarations and code is incompatible with standards before C99"
---
win32/win_opendir.c | 8 +++++---
1 file changed, 5 insertions(+), 3 deletions(-)
diff --git a/win32/win_opendir.c b/win32/win_opendir.c
index c8fff83c..f69b05ba 100644
--- a/win32/win_opendir.c
+++ b/win32/win_opendir.c
@@ -125,6 +125,8 @@ static __ino_t __inode(const wchar_t *name)
typedef BOOL(__stdcall * pfnGetFileInformationByHandleEx)(
HANDLE hFile, dirent_FILE_INFO_BY_HANDLE_CLASS FileInformationClass,
LPVOID lpFileInformation, DWORD dwBufferSize);
+ pfnGetFileInformationByHandleEx fnGetFileInformationByHandleEx;
+ HANDLE hFile;
HANDLE hKernel32 = GetModuleHandleW(L"kernel32.dll");
if (!hKernel32)
@@ -132,7 +134,7 @@ static __ino_t __inode(const wchar_t *name)
return value;
}
- pfnGetFileInformationByHandleEx fnGetFileInformationByHandleEx =
+ fnGetFileInformationByHandleEx =
(pfnGetFileInformationByHandleEx) GetProcAddress(
hKernel32, "GetFileInformationByHandleEx");
if (!fnGetFileInformationByHandleEx)
@@ -140,8 +142,8 @@ static __ino_t __inode(const wchar_t *name)
return value;
}
- HANDLE hFile = CreateFileW(name, GENERIC_READ, FILE_SHARE_READ, NULL,
- OPEN_EXISTING, 0, 0);
+ hFile = CreateFileW(name, GENERIC_READ, FILE_SHARE_READ, NULL,
+ OPEN_EXISTING, 0, 0);
if (hFile == INVALID_HANDLE_VALUE)
{
return value;