Skip to content

Commit 59d856e

Browse files
committed
fix for build using MINGW-10.0 with msys2
1 parent ab39b86 commit 59d856e

File tree

3 files changed

+14
-7
lines changed

3 files changed

+14
-7
lines changed

Makefile

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ DEVFLAGS = -O0 -g3 -DDEBUG -Wunused -Wreturn-type -Wimplicit-int #-Wall
77
OS := $(shell uname -s | tr "[:upper:]" "[:lower:]")
88

99
# Win-64
10-
ifeq (mingw32_nt-6.2,$(OS))
10+
ifeq (mingw64_nt-10.0,$(OS))
1111
CC=gcc -DWIN32=1
1212
PRODFLAGS += -D_FILE_OFFSET_BITS=64
1313
LDFLAGS = -lws2_32 -static -lpthread
@@ -19,7 +19,7 @@ OBJS= src/win/mman.o src/win/dlfcn.o src/win/safe-ctype.o src/win/fnmatch.o \
1919
endif
2020

2121
# Win-32
22-
ifeq (mingw32_nt-6.0,$(OS))
22+
ifeq (mingw32_nt-10.0,$(OS))
2323
CC=gcc -DWIN32=1
2424
LDFLAGS = -lws2_32 -static -lpthread
2525
OBJS= src/win/mman.o src/win/dlfcn.o src/win/safe-ctype.o src/win/fnmatch.o \
@@ -131,15 +131,15 @@ TAGS: *.c *.h
131131
.PHONY: all clean install android-debug
132132

133133
# Dependencies.
134-
ifeq (mingw32_nt-6.2,$(OS))
134+
ifeq (mingw64_nt-10.0,$(OS))
135135
src/win/dlfcn.c: src/win/dlfcn.h
136136
src/win/mman.c: src/win/mman.h
137137
src/win/safe-ctype.c: src/win/safe-ctype.h
138138
src/win/fnmatch.c: src/win/fnmatch.h src/win/safe-ctype.h src/win/ansidecl.h
139139
src/*.o: src/incs.h src/ts.h Makefile src/k.h src/win/mman.h src/win/dlfcn.h
140140
endif
141141

142-
ifeq (mingw32_nt-6.0,$(OS))
142+
ifeq (mingw32_nt-10.0,$(OS))
143143
src/win/dlfcn.c: src/win/dlfcn.h
144144
src/win/mman.c: src/win/mman.h
145145
src/win/safe-ctype.c: src/win/safe-ctype.h

src/c.c

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,9 @@ S fBreak = "t";
2929

3030
void boilerplate()
3131
{
32-
if(!isatty(STDOUT) || !isatty(STDIN)) R;
32+
#ifndef __MINGW32__
33+
if(!isatty(STDOUT) || !isatty(STDIN)) R; //kluge: isatty() fails using mingw-10.0 with msys2
34+
#endif
3335
O("K Console - Enter \\ for help\n\n");
3436
prompt(0);
3537
}

src/kc.c

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -249,8 +249,13 @@ I lines(FILE*f) {
249249
I line(FILE*f, S*a, I*n, PDA*p) { //just starting or just executed: *a=*n=*p=0, intermediate is non-zero
250250
S s=0; I b=0,c=0,m=0; K k; F d; fer=0;
251251

252-
//I o = isatty(STDIN) && f==stdin; //display results to stdout?
253-
I o = isatty(STDIN); //display results to stdout?
252+
//kluge: isatty() fails using mingw-10.0 with msys2
253+
#ifndef __MINGW32__
254+
//I o = isatty(STDIN) && f==stdin; //display results to stdout?
255+
I o = isatty(STDIN); //display results to stdout?
256+
#else
257+
I o = 1;
258+
#endif
254259

255260
if(-1==(c=getline_(&s,&m,f))) GC;
256261
if(fln&&(s[0]=='#' && s[1]=='!')) GC;

0 commit comments

Comments
 (0)