Skip to content

Commit 7c4be25

Browse files
committed
Fix
1 parent a668bfe commit 7c4be25

File tree

1 file changed

+9
-1
lines changed

1 file changed

+9
-1
lines changed

cpp-terminal/platforms/terminal.cpp

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -75,7 +75,11 @@ void Term::Terminal::store_and_restore()
7575
enabled = false;
7676
}
7777
#else
78+
#if defined(__mips__) || defined(__mips) || defined(__MIPS__)
79+
static termios orig_termios{0, 0, 0, 0, 0, {}};
80+
#else
7881
static termios orig_termios{0, 0, 0, 0, 0, {}, 0, 0};
82+
#endif
7983
if(!enabled)
8084
{
8185
int fd{open("/dev/tty", O_RDWR, O_NOCTTY)};
@@ -113,7 +117,11 @@ void Term::Terminal::setRawMode()
113117
int fd{open("/dev/tty", O_RDWR, O_NOCTTY)};
114118
if(fd >= 0)
115119
{
116-
termios raw{0, 0, 0, 0, 0, {0}, 0, 0};
120+
#if defined(__mips__) || defined(__mips) || defined(__MIPS__)
121+
static termios raw{0, 0, 0, 0, 0, {}};
122+
#else
123+
static termios raw{0, 0, 0, 0, 0, {}, 0, 0};
124+
#endif
117125
if(tcgetattr(fd, &raw) == -1) { throw Term::Exception("tcgetattr() failed"); }
118126
// Put terminal in raw mode
119127
raw.c_iflag &= ~(BRKINT | ICRNL | INPCK | ISTRIP | IXON);

0 commit comments

Comments
 (0)