Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion compat/mingw.c
Original file line number Diff line number Diff line change
Expand Up @@ -2938,7 +2938,7 @@ int mingw_rename(const char *pold, const char *pnew)
if (supports_file_rename_info_ex) {
/*
* Our minimum required Windows version is still set to Windows
* Vista. We thus have to declare required infrastructure for
* 8.1. We thus have to declare required infrastructure for
* FileRenameInfoEx ourselves until we bump _WIN32_WINNT to
* 0x0A00. Furthermore, we have to handle cases where the
* FileRenameInfoEx call isn't supported yet.
Expand Down
2 changes: 1 addition & 1 deletion compat/nedmalloc/malloc.c.h
Original file line number Diff line number Diff line change
Expand Up @@ -500,7 +500,7 @@ MAX_RELEASE_CHECK_RATE default: 4095 unless not HAVE_MMAP
#ifdef WIN32
#define WIN32_LEAN_AND_MEAN
#ifndef _WIN32_WINNT
#define _WIN32_WINNT 0x403
#define _WIN32_WINNT 0x603
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Technically, this is not ours to change, it's nedmalloc. We should probably upstream the mimalloc vendoring-in, and then drop compat/nedmalloc/ from upstream, too: It's woefully unsupported.

As far as this PR is concerned, let's keep this change, it makes it simpler to verify that we haven't missed any _WIN32_WINNT definition.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We should probably upstream the mimalloc vendoring-in, and then drop compat/nedmalloc/ from upstream, too

That would be great, but somehow I have my doubts about Junio loving the frequency of our mimalloc updates, the churn of our 4-commit update method or the (very useful) commit message of 266c6eb.

I think he might prefer something more like contrib/update-unicode/update_unicode.sh and the corresponding commits.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Heh. I can always try to upstream as-is 😁

#endif
#include <windows.h>
#define HAVE_MMAP 1
Expand Down
4 changes: 2 additions & 2 deletions compat/poll/poll.c
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@

#define DISABLE_SIGN_COMPARE_WARNINGS

/* To bump the minimum Windows version to Windows Vista */
/* To bump the minimum Windows version to Windows 8.1 */
#include "git-compat-util.h"

/* Tell gcc not to warn about the (nfd < 0) tests, below. */
Expand All @@ -41,7 +41,7 @@
#if (defined _WIN32 || defined __WIN32__) && ! defined __CYGWIN__
# define WIN32_NATIVE
# if defined (_MSC_VER) && !defined(_WIN32_WINNT)
# define _WIN32_WINNT 0x0502
# define _WIN32_WINNT 0x0603
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Technically, this is not ours to change, but I guess it could come back to bite us if we don't. So let's keep this change.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

By "ours" do you mean Git for Windows or Git? Because it is a Git modification to the vendored code (git@56fb3dd), but I guess it makes sense to drop this all together, since git@e8dfcac made this obsolete.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I mean both Git and Git for Windows; Vendored-in code is harder to maintain if it is modified from the original version.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I could upstream a commit to drop this definition alltogether, which would reduce the modifications to vendored code, but I doubt we'll see many updates to the vendored code.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I doubt we'll see many updates to the vendored code.

True.

# endif
# include <winsock2.h>
# include <windows.h>
Expand Down
2 changes: 1 addition & 1 deletion compat/posix.h
Original file line number Diff line number Diff line change
Expand Up @@ -78,7 +78,7 @@

#if defined(WIN32) && !defined(__CYGWIN__) /* Both MinGW and MSVC */
# if !defined(_WIN32_WINNT)
# define _WIN32_WINNT 0x0600
# define _WIN32_WINNT 0x0603
# endif
#define WIN32_LEAN_AND_MEAN /* stops windows.h including winsock.h */
#include <winsock2.h>
Expand Down
2 changes: 2 additions & 0 deletions compat/win32/flush.c
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,9 @@ 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
Comment on lines +9 to +11
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We could even drop this altogether, right? If we require a new-enough _WIN32_WINNT, we require this flag to be defined, no?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I wasn't sure if that is always the case and we can reasonably expect this, so I thought wrapping it in #ifndef was the safe bet.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Sounds good to me.


DECLARE_PROC_ADDR(ntdll.dll, NTSTATUS, NTAPI, NtFlushBuffersFileEx,
HANDLE FileHandle, ULONG Flags, PVOID Parameters, ULONG ParameterSize,
Expand Down
37 changes: 4 additions & 33 deletions compat/winansi.c
Original file line number Diff line number Diff line change
Expand Up @@ -32,47 +32,18 @@ static int non_ascii_used = 0;
static HANDLE hthread, hread, hwrite;
static HANDLE hconsole1, hconsole2;

#ifdef __MINGW32__
#if !defined(__MINGW64_VERSION_MAJOR) || __MINGW64_VERSION_MAJOR < 5
typedef struct _CONSOLE_FONT_INFOEX {
ULONG cbSize;
DWORD nFont;
COORD dwFontSize;
UINT FontFamily;
UINT FontWeight;
WCHAR FaceName[LF_FACESIZE];
} CONSOLE_FONT_INFOEX, *PCONSOLE_FONT_INFOEX;
#endif
#endif

static void warn_if_raster_font(void)
{
DWORD fontFamily = 0;
DECLARE_PROC_ADDR(kernel32.dll, BOOL, WINAPI,
GetCurrentConsoleFontEx, HANDLE, BOOL,
PCONSOLE_FONT_INFOEX);
CONSOLE_FONT_INFOEX cfi;

/* don't bother if output was ascii only */
if (!non_ascii_used)
return;

/* GetCurrentConsoleFontEx is available since Vista */
if (INIT_PROC_ADDR(GetCurrentConsoleFontEx)) {
CONSOLE_FONT_INFOEX cfi;
cfi.cbSize = sizeof(cfi);
if (GetCurrentConsoleFontEx(console, 0, &cfi))
fontFamily = cfi.FontFamily;
} else {
/* pre-Vista: check default console font in registry */
HKEY hkey;
if (ERROR_SUCCESS == RegOpenKeyExA(HKEY_CURRENT_USER, "Console",
0, KEY_READ, &hkey)) {
DWORD size = sizeof(fontFamily);
RegQueryValueExA(hkey, "FontFamily", NULL, NULL,
(LPVOID) &fontFamily, &size);
RegCloseKey(hkey);
}
}
cfi.cbSize = sizeof(cfi);
if (GetCurrentConsoleFontEx(console, 0, &cfi))
fontFamily = cfi.FontFamily;

if (!(fontFamily & TMPF_TRUETYPE)) {
const wchar_t *msg = L"\nWarning: Your console font probably "
Expand Down
Loading