diff --git a/configure.ac b/configure.ac index d75422d8..78250621 100644 --- a/configure.ac +++ b/configure.ac @@ -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], diff --git a/solaris/Platform.h b/solaris/Platform.h index cf94fbb3..f83c4d1c 100644 --- a/solaris/Platform.h +++ b/solaris/Platform.h @@ -12,7 +12,15 @@ in the source distribution for its full text. #include "config.h" // IWYU pragma: keep #include + +/* 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 +#undef ERR +#define ERR (-1) + #include #include diff --git a/solaris/SolarisProcess.h b/solaris/SolarisProcess.h index 0b12aa0f..07b889c0 100644 --- a/solaris/SolarisProcess.h +++ b/solaris/SolarisProcess.h @@ -12,7 +12,14 @@ in the source distribution for its full text. #include #include + +/* 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 +#undef ERR +#define ERR (-1) #include "Settings.h"