void-packages/srcpkgs/chuck/patches/musl-termios_h.patch

34 lines
946 B
Diff

The header file <termio.h> is obsolete. Instead use the
header <termios.h> and the struct termios for musl libc.
--- chuck-1.3.5.2/src/util_console.cpp 2015-10-21 11:04:45.000000000 +0200
+++ chuck-1.3.5.2/src/util_console.cpp 2015-10-25 15:50:25.091669947 +0100
@@ -95,9 +95,12 @@
#ifdef __PLATFORM_MACOSX__
#include <termios.h>
static struct termios g_save;
-#else
+#elif defined(__GLIBC__)
#include <termio.h>
static struct termio g_save;
+#else
+ #include <termios.h>
+ static struct termios g_save;
#endif
#include <unistd.h>
@@ -122,9 +125,12 @@
#ifdef __PLATFORM_MACOSX__
struct termios term;
if( ioctl( 0, TIOCGETA, &term ) == -1 )
-#else
+#elif defined(__GLIBC__)
struct termio term;
if( ioctl( 0, TCGETA, &term ) == -1 )
+#else
+ struct termios term;
+ if( ioctl( 0, TCGETA, &term ) == -1 )
#endif
{
EM_log( CK_LOG_SEVERE, "(kbhit disabled): standard input not a tty!");