This patch was adapted from a 2.6 patch which came from upstream:
http://bugs.python.org/issue19561

--- Python-3.7.1/Include/pyport.h	2018-11-28 07:14:14.109375435 +0000
+++ Python-3.7.1/Include/pyport.h	2018-11-28 07:00:39.425497609 +0000
@@ -539,11 +539,6 @@ Please be conservative with adding new o
 in platform-specific #ifdefs.
 **************************************************************************/
 
-#ifdef SOLARIS
-/* Unchecked */
-extern int gethostname(char *, int);
-#endif
-
 #ifdef HAVE__GETPTY
 #include <sys/types.h>          /* we need to import mode_t */
 extern char * _getpty(int *, int, mode_t, int);