Skip to content

Commit

Permalink
tests: Use _getch() instead of getch()
Browse files Browse the repository at this point in the history
The latter is marked as deprecated in Microsoft's CRT.
  • Loading branch information
davidebeatrici committed Nov 8, 2024
1 parent c658b66 commit 09929f5
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/tests/Key.h
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@
enum Key { KEY_NONE, KEY_BREAK, KEY_PAUSE };

#if !defined(OS_WINDOWS)
static int getch(void) {
static int _getch(void) {
struct termios oldAttr;
tcgetattr(STDIN_FILENO, &oldAttr);
struct termios newAttr = oldAttr;
Expand All @@ -31,7 +31,7 @@ static int getch(void) {
#endif

static inline enum Key getKey(void) {
switch (getch()) {
switch (_getch()) {
case '\n':
case '\r':
return KEY_BREAK;
Expand Down

0 comments on commit 09929f5

Please sign in to comment.