mirror of
https://github.com/git-for-windows/git.git
synced 2026-04-10 08:22:54 -05:00
Git for Windows doesn't support anything prior to Windows 8.1 since 2.47.0
and Git followed along with commits like ce6ccba (mingw: drop Windows
7-specific work-around, 2025-08-04).
There is no need to pretend to the compiler that we still support Windows
Vista, just to lock us out of easy access to newer APIs. There is also no
need to have conflicting and unused definitions claiming we support some
versions of Windows XP or even Windows NT 4.0.
Bump all definitions of _WIN32_WINNT to a realistic value of Windows 8.1.
This will also simplify code for a followup commit that will improve cpu
core detection on multi-socket systems.
Signed-off-by: Matthias Aßhauer <mha1993@live.de>
Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
31 lines
730 B
C
31 lines
730 B
C
#include "git-compat-util.h"
|
|
#include <winternl.h>
|
|
#include "lazyload.h"
|
|
|
|
int win32_fsync_no_flush(int fd)
|
|
{
|
|
IO_STATUS_BLOCK io_status;
|
|
|
|
#ifndef FLUSH_FLAGS_FILE_DATA_ONLY
|
|
#define FLUSH_FLAGS_FILE_DATA_ONLY 1
|
|
#endif
|
|
|
|
DECLARE_PROC_ADDR(ntdll.dll, NTSTATUS, NTAPI, NtFlushBuffersFileEx,
|
|
HANDLE FileHandle, ULONG Flags, PVOID Parameters, ULONG ParameterSize,
|
|
PIO_STATUS_BLOCK IoStatusBlock);
|
|
|
|
if (!INIT_PROC_ADDR(NtFlushBuffersFileEx)) {
|
|
errno = ENOSYS;
|
|
return -1;
|
|
}
|
|
|
|
memset(&io_status, 0, sizeof(io_status));
|
|
if (NtFlushBuffersFileEx((HANDLE)_get_osfhandle(fd), FLUSH_FLAGS_FILE_DATA_ONLY,
|
|
NULL, 0, &io_status)) {
|
|
errno = EINVAL;
|
|
return -1;
|
|
}
|
|
|
|
return 0;
|
|
}
|