File tree Expand file tree Collapse file tree 2 files changed +11
-13
lines changed Expand file tree Collapse file tree 2 files changed +11
-13
lines changed Original file line number Diff line number Diff line change 7
7
#include <wingdi.h>
8
8
#include <winreg.h>
9
9
10
- #ifdef USE_NTDLL
11
- #include <winternl.h>
12
- #include <ntstatus.h>
13
- #endif
14
-
15
10
/*
16
11
ANSI codes used by git: m, K
17
12
@@ -536,9 +531,12 @@ static HANDLE swap_osfhnd(int fd, HANDLE new_handle)
536
531
return old_handle ;
537
532
}
538
533
539
- #ifdef USE_NTDLL
534
+ #ifdef DETECT_MSYS_TTY
540
535
541
- static void msystty_init (int fd )
536
+ #include <winternl.h>
537
+ #include <ntstatus.h>
538
+
539
+ static void detect_msys_tty (int fd )
542
540
{
543
541
ULONG result ;
544
542
BYTE buffer [1024 ];
@@ -570,8 +568,6 @@ static void msystty_init(int fd)
570
568
_pioinfo (fd )-> osflags |= FDEV ;
571
569
}
572
570
573
- #else
574
- #define msystty_init (fd ) (void)0
575
571
#endif
576
572
577
573
void winansi_init (void )
@@ -583,10 +579,12 @@ void winansi_init(void)
583
579
con1 = is_console (1 );
584
580
con2 = is_console (2 );
585
581
if (!con1 && !con2 ) {
582
+ #ifdef DETECT_MSYS_TTY
586
583
/* check if stdin / stdout / stderr are msys pty pipes */
587
- msystty_init (0 );
588
- msystty_init (1 );
589
- msystty_init (2 );
584
+ detect_msys_tty (0 );
585
+ detect_msys_tty (1 );
586
+ detect_msys_tty (2 );
587
+ #endif
590
588
return ;
591
589
}
592
590
Original file line number Diff line number Diff line change 548
548
BASIC_LDFLAGS += -Wl,--large-address-aware
549
549
endif
550
550
CC = gcc
551
- COMPAT_CFLAGS += -D__USE_MINGW_ANSI_STDIO=0 -DUSE_NTDLL
551
+ COMPAT_CFLAGS += -D__USE_MINGW_ANSI_STDIO=0 -DDETECT_MSYS_TTY
552
552
EXTLIBS += -lntdll
553
553
INSTALL = /bin/install
554
554
NO_R_TO_GCC_LINKER = YesPlease
You can’t perform that action at this time.
0 commit comments