Solaris: handle ERR macro redefinitions

On OmniOS /usr/include/sys/regset.h redefines ERR to 13 - \r, breaking
the Enter key.
Since ncruses macros use the ERR macro, we can not use another name.

Closes: #634
This commit is contained in:
Christian Göttsche 2021-05-20 18:27:10 +02:00
parent a62987c787
commit ee9e7edbc1
3 changed files with 20 additions and 0 deletions

View File

@ -298,6 +298,11 @@ fi
if test "$enable_static" = yes; then
AC_SEARCH_LIBS([Gpm_GetEvent], [gpm])
fi
if test "$my_htop_platform" = "solaris"; then
# On OmniOS /usr/include/sys/regset.h redefines ERR to 13 - \r, breaking the Enter key.
# Since ncruses macros use the ERR macro, we can not use another name.
AC_DEFINE([ERR], [(-1)], [Predefine ncurses macro.])
fi
AC_ARG_ENABLE([hwloc],

View File

@ -12,7 +12,15 @@ in the source distribution for its full text.
#include "config.h" // IWYU pragma: keep
#include <kstat.h>
/* On OmniOS /usr/include/sys/regset.h redefines ERR to 13 - \r, breaking the Enter key.
* Since ncruses macros use the ERR macro, we can not use another name.
*/
#undef ERR
#include <libproc.h>
#undef ERR
#define ERR (-1)
#include <signal.h>
#include <stdbool.h>

View File

@ -12,7 +12,14 @@ in the source distribution for its full text.
#include <zone.h>
#include <sys/proc.h>
/* On OmniOS /usr/include/sys/regset.h redefines ERR to 13 - \r, breaking the Enter key.
* Since ncruses macros use the ERR macro, we can not use another name.
*/
#undef ERR
#include <libproc.h>
#undef ERR
#define ERR (-1)
#include "Settings.h"