diff --git a/Makefile b/Makefile
index 58cc0e98b0d4feb617c17b50979d9021df68a914..6411de029ad5a59b2f37340f84eb60cfc3608977 100644
--- a/Makefile
+++ b/Makefile
@@ -304,7 +304,7 @@ else
 endif
 
 ifeq ($(OSARCH),SunOS)
-  SOLINK=-shared -fpic -L/usr/local/ssl/lib
+  SOLINK=-shared -fpic -L/usr/local/ssl/lib -lrt
 endif
 
 # comment to print directories during submakes
diff --git a/apps/Makefile b/apps/Makefile
index 22b8f6d7a3d54ec84f082b5dd4affc26b38516b9..d75b0301cd7b5376997b58201ec56acc0ad662be 100644
--- a/apps/Makefile
+++ b/apps/Makefile
@@ -25,11 +25,6 @@ ifneq ($(findstring IMAP_STORAGE,$(MENUSELECT_OPTS_app_voicemail)),)
   MENUSELECT_DEPENDS_app_directory+=$(MENUSELECT_DEPENDS_IMAP_STORAGE)
 endif
 
-ifeq (SunOS,$(shell uname))
-  MENUSELECT_DEPENDS_app_chanspy+=RT
-  RT_LIB=-lrt
-endif
-
 all: _all
 
 include $(ASTTOPDIR)/Makefile.moddir_rules
diff --git a/main/editline/np/vis.c b/main/editline/np/vis.c
index 7d9117faaeb6e36b4b5ff13fd92fa0e585d3e57e..bd8192440ad3c976b1312e69b22b38cc1f45e9a3 100644
--- a/main/editline/np/vis.c
+++ b/main/editline/np/vis.c
@@ -44,6 +44,7 @@ __RCSID("$NetBSD: vis.c,v 1.22 2002/03/23 17:38:27 christos Exp $");
 #include <assert.h>
 #include "np/vis.h"
 #include <stdlib.h>
+#include <stdint.h>
 
 #ifdef __weak_alias
 __weak_alias(strsvis,_strsvis)
@@ -167,8 +168,8 @@ do {									      \
 	if (isc) break;							      \
 	if (isextra || ((c & 0177) == ' ') || (flag & VIS_OCTAL)) {	      \
 		*dst++ = '\\';						      \
-		*dst++ = (u_char)(((u_int32_t)(u_char)c >> 6) & 03) + '0';    \
-		*dst++ = (u_char)(((u_int32_t)(u_char)c >> 3) & 07) + '0';    \
+		*dst++ = (u_char)(((uint32_t)(u_char)c >> 6) & 03) + '0';     \
+		*dst++ = (u_char)(((uint32_t)(u_char)c >> 3) & 07) + '0';     \
 		*dst++ =			     (c	      & 07) + '0';    \
 	} else {							      \
 		if ((flag & VIS_NOSLASH) == 0) *dst++ = '\\';		      \