diff options
author | Bram Moolenaar <Bram@vim.org> | 2017-07-24 22:29:21 +0200 |
---|---|---|
committer | Bram Moolenaar <Bram@vim.org> | 2017-07-24 22:29:21 +0200 |
commit | 8a77306fa170f9d95f2402e73b4a94a2692ce84f (patch) | |
tree | 1b02486ba966cc5ee70636ce9d62aea4e6f3dd5a /src/libvterm | |
parent | 2155441460a6dc0a72125f7860507693112a1460 (diff) | |
download | vim-git-8a77306fa170f9d95f2402e73b4a94a2692ce84f.tar.gz |
patch 8.0.0769: build problems with terminal on MS-Windowsv8.0.0769
Problem: Build problems with terminal on MS-Windows using MSVC.
Solution: Remove stdbool.h dependency. Only use ScreenLinesUC when it was
allocated. Fix typos. (Ken Takata)
Diffstat (limited to 'src/libvterm')
-rw-r--r-- | src/libvterm/Makefile.msc | 7 | ||||
-rw-r--r-- | src/libvterm/bin/vterm-ctrl.c | 34 |
2 files changed, 24 insertions, 17 deletions
diff --git a/src/libvterm/Makefile.msc b/src/libvterm/Makefile.msc index 18280d256..c2313ba99 100644 --- a/src/libvterm/Makefile.msc +++ b/src/libvterm/Makefile.msc @@ -1,3 +1,5 @@ +CFLAGS = /DINLINE= /Iinclude + OBJS = \ src\encoding.c \ src\keyboard.c \ @@ -24,7 +26,10 @@ all : vterm.lib .c.obj : - cl /DINLINE= /Iinclude /Fo$@ /c $< + cl $(CFLAGS) /Fo$@ /c $< vterm.lib : $(OBJS) lib /OUT:$@ $(OBJS) + +clean: + del $(OBJS) vterm.lib diff --git a/src/libvterm/bin/vterm-ctrl.c b/src/libvterm/bin/vterm-ctrl.c index 14e35cda5..2568ee609 100644 --- a/src/libvterm/bin/vterm-ctrl.c +++ b/src/libvterm/bin/vterm-ctrl.c @@ -1,10 +1,11 @@ #define _XOPEN_SOURCE 500 /* strdup */ -#include <stdbool.h> #include <stdio.h> #include <stdlib.h> #include <string.h> #define streq(a,b) (strcmp(a,b)==0) +#define TRUE 1 +#define FALSE 0 #include <termios.h> @@ -60,13 +61,14 @@ static char *helptext[] = { NULL }; -static bool seticanon(bool icanon, bool echo) +static int seticanon(int icanon, int echo) { struct termios termios; + int ret; tcgetattr(0, &termios); - bool ret = (termios.c_lflag & ICANON); + ret = (termios.c_lflag & ICANON); if(icanon) termios.c_lflag |= ICANON; else termios.c_lflag &= ~ICANON; @@ -84,16 +86,16 @@ static void await_c1(int c1) int c; /* await CSI - 8bit or 2byte 7bit form */ - bool in_esc = false; + int in_esc = FALSE; while((c = getchar())) { if(c == c1) break; if(in_esc && c == (char)(c1 - 0x40)) break; if(!in_esc && c == 0x1b) - in_esc = true; + in_esc = TRUE; else - in_esc = false; + in_esc = FALSE; } } @@ -121,7 +123,7 @@ static char *read_csi() static char *read_dcs() { unsigned char dcs[32]; - bool in_esc = false; + int in_esc = FALSE; int i; await_c1(0x90); @@ -133,10 +135,10 @@ static char *read_dcs() if(in_esc && c == 0x5c) break; if(!in_esc && c == 0x1b) - in_esc = true; + in_esc = TRUE; else { dcs[i++] = c; - in_esc = false; + in_esc = FALSE; } } dcs[++i] = 0; @@ -158,7 +160,7 @@ static void usage(int exitcode) exit(exitcode); } -static bool query_dec_mode(int mode) +static int query_dec_mode(int mode) { char *s = NULL; @@ -189,12 +191,12 @@ static bool query_dec_mode(int mode) free(s); if(reply_value == 1 || reply_value == 3) - return true; + return TRUE; if(reply_value == 2 || reply_value == 4) - return false; + return FALSE; printf("Unrecognised reply to DECRQM: %d\n", reply_value); - return false; + return FALSE; } while(1); } @@ -247,11 +249,11 @@ static int query_rqss_numeric(char *cmd) } while(1); } -bool wasicanon; +int wasicanon; void restoreicanon(void) { - seticanon(wasicanon, true); + seticanon(wasicanon, TRUE); } int main(int argc, char *argv[]) @@ -261,7 +263,7 @@ int main(int argc, char *argv[]) if(argc == 1) usage(0); - wasicanon = seticanon(false, false); + wasicanon = seticanon(FALSE, FALSE); atexit(restoreicanon); while(argi < argc) { |