Skip to content

Commit 4f78a40

Browse files
committed
lisp/c/eusioctl.c: use termios.h instead of termio.h as this is old incldue file
fix for debia:unstable-slim, (cd c; gcc -c -Wno-old-style-definition -fPIC -Dx86_64 -DLinux -D_REENTRANT -DVERSION="9.31" -DLIB6 -falign-functions=8 -g -m64 -DTHREADED -DPTHREAD -DX_V11R6_1 -DGCC -DGCC3 -I/usr/include -I/usr/X11R6/include -I/ws/euslisp/include -o /ws/euslisp/Linux64/obj/eusioctl.o -O2 eusioctl.c) eusioctl.c:12:10: fatal error: termio.h: No such file or directory 12 | #include <termio.h> | ^~~~~~~~~~
1 parent 24edb32 commit 4f78a40

File tree

1 file changed

+13
-1
lines changed

1 file changed

+13
-1
lines changed

lisp/c/eusioctl.c

Lines changed: 13 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,15 @@ static char *rcsid="@(#)$Id$";
99
#include <sys/termios.h>
1010
#include <sys/ioctl.h>
1111
#ifndef Darwin
12-
#include <termio.h>
12+
#include <features.h>
13+
#if defined(__GLIBC__) && (__GLIBC__ > 2 || (__GLIBC__ == 2 && __GLIBC_MINOR__ >= 42))
14+
#warning "Since glibc 2.42, termio.h is no longer supported. Dropping TCGETA TCSETA TCSETAW TCSETAF"
15+
#define USE_TERMIOS
16+
#include <termios.h>
17+
#else
18+
#define USE_TERMIO
19+
#include <termio.h>
20+
#endif
1321
#endif
1422
/* #include <sgtty.h> */
1523

@@ -200,6 +208,7 @@ pointer argv[];
200208
{ return(ioctl_struct(n,argv,TCSETSF,sizeof(struct termios)));}
201209
#endif
202210

211+
#ifdef USE_TERMIO
203212
pointer IOCTL_TCGETA(ctx,n,argv)
204213
register context *ctx;
205214
int n;
@@ -223,6 +232,7 @@ int n;
223232
pointer argv[];
224233
{ return(ioctl_struct(n,argv,TCSETAW,sizeof(struct termio)));}
225234
#endif
235+
#endif
226236

227237
pointer TCGETATTR(ctx,n,argv)
228238
register context *ctx;
@@ -281,10 +291,12 @@ register pointer mod;
281291
defunpkg(ctx,"TCSETSW",mod,IOCTL_TCSETSW,unixpkg);
282292
defunpkg(ctx,"TCSETSF",mod,IOCTL_TCSETSF,unixpkg);
283293
#endif
294+
#ifdef USE_TERMIO
284295
defunpkg(ctx,"TCGETA",mod,IOCTL_TCGETA,unixpkg);
285296
defunpkg(ctx,"TCSETA",mod,IOCTL_TCSETA,unixpkg);
286297
defunpkg(ctx,"TCSETAW",mod,(pointer(*)(context*,int,pointer*))IOCTL_TCSETAW,unixpkg);
287298
defunpkg(ctx,"TCSETAF",mod,IOCTL_TCSETAF,unixpkg);
299+
#endif
288300
#endif
289301
defunpkg(ctx,"TCGETATTR",mod,TCGETATTR,unixpkg);
290302
defunpkg(ctx,"TCSETATTR",mod,TCSETATTR,unixpkg);

0 commit comments

Comments
 (0)