From 57485b48ca9ce31e6b94b1ce5f1d892ff0b786bf Mon Sep 17 00:00:00 2001 From: Wohlstand Date: Thu, 7 Jan 2021 13:17:37 +0300 Subject: adlmidi2: Add the test check for termio and termios type #241 --- utils/adlmidi-2/input.hpp | 19 ++++++++++++++----- 1 file changed, 14 insertions(+), 5 deletions(-) (limited to 'utils/adlmidi-2/input.hpp') diff --git a/utils/adlmidi-2/input.hpp b/utils/adlmidi-2/input.hpp index 0cafd51..6d0a796 100644 --- a/utils/adlmidi-2/input.hpp +++ b/utils/adlmidi-2/input.hpp @@ -29,14 +29,23 @@ static const unsigned NewTimerFreq = 209; # include #endif +#if defined(HAS_TERMIO) +typedef struct termio InputTermio_t; +#elif defined(HAS_TERMIOS) +typedef struct termios InputTermio_t; +#else +# error Undefined type for termio; +#endif + class xInput { - #ifdef _WIN32 +#ifdef _WIN32 void *inhandle; - #endif - #if (!defined(_WIN32) || defined(__CYGWIN__)) && !defined(__DJGPP__) && !defined(__APPLE__) - struct termio back; - #endif +#endif +#if (!defined(_WIN32) || defined(__CYGWIN__)) && !defined(__DJGPP__) && !defined(__APPLE__) + InputTermio_t back; +#endif + public: xInput(); ~xInput(); -- cgit v1.2.3