わたなべです.

考えみたらさっきのは全然だめですね.
stty の戻り値とか関係ないものと ERR と比較してるので.
((void)stty(...) でもそうなってるみたい)
sun4 curses を使うときはという条件にしてみました.

#if defined(sun)
#include <sys/param.h>
#if defined(MAXHOSTNAMELEN) && !defined(KEY_MIN)
#define SUN4_CURSES
#endif
#endif

#ifndef SUN4_CURSES
#define CHECK(c) if ((c)==ERR) {curses_err();}
#else
#define CHECK(c) c
#endif